Skip to content

Commit

Permalink
add i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
RuochenLyu committed Oct 13, 2014
1 parent 418fc59 commit 2234eee
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 14 additions & 1 deletion lib/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,21 @@ Gallery = (function(_super) {
wrapCls: ""
};

Gallery.i18n = {
'zh-CN': {
rotate_image: '旋转图片方向',
download_image: '下载图片',
view_full_size: '在新窗口查看原图'
},
'en': {
rotate_image: 'Rotate this image',
download_image: 'Download this image',
view_full_size: 'View full size'
}
};

Gallery._tpl = {
gallery: "<div class=\"simple-gallery loading\">\n <div class=\"gallery-img\">\n <img src=\"\" />\n <div class=\"loading-indicator\"></div>\n </div>\n <div class=\"gallery-detail hide\">\n <span class=\"name\"></span>\n <div class=\"gallery-control\">\n <a class=\"turn-right\" href=\"javascript:;\" title=\"旋转图片方向\"><i class=\"fa fa-repeat\"></i></a>\n <a class=\"link-download\" href=\"\" title=\"下载图片\" target=\"_blank\"><i class=\"fa fa-download\"></i></a>\n <a class=\"link-show-origin\" href=\"\" title=\"在新窗口查看原图\" target=\"_blank\"><i class=\"fa fa-external-link\"></i></a>\n </div>\n </div>\n</div>",
gallery: "<div class=\"simple-gallery loading\">\n <div class=\"gallery-img\">\n <img src=\"\" />\n <div class=\"loading-indicator\"></div>\n </div>\n <div class=\"gallery-detail hide\">\n <span class=\"name\"></span>\n <div class=\"gallery-control\">\n <a class=\"turn-right\" href=\"javascript:;\" title=\"" + (Gallery.prototype._t('download_image')) + "\"><i class=\"fa fa-repeat\"></i></a>\n <a class=\"link-download\" href=\"\" title=\"" + (Gallery.prototype._t('download_image')) + "\" target=\"_blank\"><i class=\"fa fa-download\"></i></a>\n <a class=\"link-show-origin\" href=\"\" title=\"" + (Gallery.prototype._t('view_full_size')) + "\" target=\"_blank\"><i class=\"fa fa-external-link\"></i></a>\n </div>\n </div>\n</div>",
thumbs: "<div class=\"gallery-list\"></div>",
thumb: "<p class=\"thumb\"><a class=\"link\" href=\"javascript:;\"><img src=\"\" /></a></p>"
};
Expand Down
15 changes: 12 additions & 3 deletions src/gallery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ class Gallery extends SimpleModule
itemCls: ""
wrapCls: ""

@i18n:
'zh-CN':
rotate_image: '旋转图片方向'
download_image: '下载图片'
view_full_size: '在新窗口查看原图'
'en':
rotate_image: 'Rotate this image'
download_image: 'Download this image'
view_full_size: 'View full size'

@_tpl:
gallery: """
Expand All @@ -16,9 +25,9 @@ class Gallery extends SimpleModule
<div class="gallery-detail hide">
<span class="name"></span>
<div class="gallery-control">
<a class="turn-right" href="javascript:;" title="旋转图片方向"><i class="fa fa-repeat"></i></a>
<a class="link-download" href="" title="下载图片" target="_blank"><i class="fa fa-download"></i></a>
<a class="link-show-origin" href="" title="在新窗口查看原图" target="_blank"><i class="fa fa-external-link"></i></a>
<a class="turn-right" href="javascript:;" title="#{@::_t('download_image')}"><i class="fa fa-repeat"></i></a>
<a class="link-download" href="" title="#{@::_t('download_image')}" target="_blank"><i class="fa fa-download"></i></a>
<a class="link-show-origin" href="" title="#{@::_t('view_full_size')}" target="_blank"><i class="fa fa-external-link"></i></a>
</div>
</div>
</div>
Expand Down

0 comments on commit 2234eee

Please sign in to comment.