Skip to content

Commit

Permalink
feat: update locale
Browse files Browse the repository at this point in the history
  • Loading branch information
kitian616 committed Jan 5, 2019
1 parent 6f57aa4 commit e4e9602
Show file tree
Hide file tree
Showing 19 changed files with 214 additions and 139 deletions.
195 changes: 96 additions & 99 deletions _data/locale.yml
Original file line number Diff line number Diff line change
@@ -1,106 +1,103 @@
SUBSCRIBE:
en: "Subscribe"
zh: "订阅"
zh-Hans: "订阅"
zh-Hant: "訂閱"
ko: "등록"
## => Engish
########################
en: &EN
SUBSCRIBE : "Subscribe"
READMORE : "Read more"
SEARCH : "Search"
CANCEL : "Cancel"
VIEWS : "views"
LAST_UPDATED : "Last updated"
PREVIOUS : "PREVIOUS"
NEXT : "NEXT"
ARTICLE_DATE_FORMAT : "%b %d, %Y"
ARTICLE_LIST_DATE_FORMAT: "%b %d"
STATISTICS : "[POST_COUNT] post articles, [PAGE_COUNT] pages."
LICENSE_ANNOUNCE : "This work is licensed under a [LICENSE] license."
POST_ON_GITHUB : "Edit on Github"
FOLLOW_ME : "Follow me on [NAME]."
EMAIL_ME : "Send me Email."
COPYRIGHT_DATES : "2019"

READMORE:
en: "Read more"
zh: "阅读更多"
zh-Hans: "阅读更多"
zh-Hant: "閱讀更多"
ko: "더보기"
en-US:
<<: *EN
en-CA:
<<: *EN
en-GB:
<<: *EN
en-AU:
<<: *EN

SEARCH:
en: "Search"
zh: "搜索"
zh-Hans: "搜索"
zh-Hant: "搜索"
ko: "검색"
## => Simplified Chinese
########################
zh-Hans: &ZH_HANS
SUBSCRIBE : "订阅"
READMORE : "阅读更多"
SEARCH : "搜索"
CANCEL : "取消"
VIEWS : "阅读"
LAST_UPDATED : "更新于"
PREVIOUS : "上篇"
NEXT : "下篇"
ARTICLE_DATE_FORMAT : "%Y年 %m月%d日"
ARTICLE_LIST_DATE_FORMAT: "%m月%d日"
STATISTICS : "共计 [POST_COUNT] 篇文章,[PAGE_COUNT] 页。"
LICENSE_ANNOUNCE : "本文遵守 [LICENSE] 许可协议。"
POST_ON_GITHUB : "在 Github 上修改"
FOLLOW_ME : "在 [NAME] 上关注我。"
EMAIL_ME : "给我发邮件。"
COPYRIGHT_DATES : "2019"

CANCEL:
en: "Cancel"
zh: "取消"
zh-Hans: "取消"
zh-Hant: "取消"
ko: "취소"
zh:
<<: *ZH_HANS
zh-CN:
<<: *ZH_HANS
zh-SG:
<<: *ZH_HANS

VIEWS:
en: "views"
zh: "阅读"
zh-Hans: "阅读"
zh-Hant: "閱讀"
ko: "조회"
## => Traditional Chinese
########################
zh-Hant: &ZH_HANT
SUBSCRIBE : "訂閱"
READMORE : "閱讀更多"
SEARCH : "搜索"
CANCEL : "取消"
VIEWS : "閱讀"
LAST_UPDATED : "更新於"
PREVIOUS : "上篇"
NEXT : "下篇"
ARTICLE_DATE_FORMAT : "%Y年 %m月%d日"
ARTICLE_LIST_DATE_FORMAT: "%m月%d日"
STATISTICS : "共計 [POST_COUNT] 篇文章,[PAGE_COUNT] 頁。"
LICENSE_ANNOUNCE : "本文遵守 [LICENSE] 許可協議。"
POST_ON_GITHUB : "在 Github 上修改"
FOLLOW_ME : "在 [NAME] 上關注我。"
EMAIL_ME : "給我發郵件。"
COPYRIGHT_DATES : "2019"

LAST_UPDATED:
en: "Last updated"
zh: "更新于"
zh-Hans: "更新于"
zh-Hant: "更新於"
ko: "마지막 수정"
zh-TW:
<<: *ZH_HANT
zh-HK:
<<: *ZH_HANT

PREVIOUS:
en: "PREVIOUS"
zh: "上篇"
zh-Hans: "上篇"
zh-Hant: "上篇"
ko: "이전"
## => Korean
########################
ko: &KO
SUBSCRIBE : "등록"
READMORE : "더보기"
SEARCH : "검색"
CANCEL : "취소"
VIEWS : "조회"
LAST_UPDATED : "마지막 수정"
PREVIOUS : "이전"
NEXT : "다음"
ARTICLE_DATE_FORMAT : "%Y년 %m월 %d일"
ARTICLE_LIST_DATE_FORMAT: "%m월 %d일"
STATISTICS : "전체 글 [POST_COUNT]개, [PAGE_COUNT] 페이지"
LICENSE_ANNOUNCE : "이 글의 저작권은 [LICENSE] 라이센스를 따릅니다."
POST_ON_GITHUB : "Github에서 확인하기"
FOLLOW_ME : "[NAME]에서 팔로우하기"
EMAIL_ME : "이메일 보내기"
COPYRIGHT_DATES : "2019"

NEXT:
en: "NEXT"
zh: "下篇"
zh-Hans: "下篇"
zh-Hant: "下篇"
ko: "다음"

ARTICLE_DATE_FORMAT:
en: "%b %d, %Y"
zh: "%Y年 %m月%d日"
zh-Hans: "%Y年 %m月%d日"
zh-Hant: "%Y年 %m月%d日"
ko: "%Y년 %m월 %d일"

ARTICLE_LIST_DATE_FORMAT:
en: "%b %d"
zh: "%m月%d日"
zh-Hans: "%m月%d日"
zh-Hant: "%m月%d日"
ko: "%m월 %d일"

STATISTICS:
en: "[POST_COUNT] post articles, [PAGE_COUNT] pages."
zh: "共计 [POST_COUNT] 篇文章,[PAGE_COUNT] 页。"
zh-Hans: "共计 [POST_COUNT] 篇文章,[PAGE_COUNT] 页。"
zh-Hant: "共計 [POST_COUNT] 篇文章,[PAGE_COUNT] 頁。"
ko: "전체 글 [POST_COUNT]개, [PAGE_COUNT] 페이지"

LICENSE_ANNOUNCE:
en: "This work is licensed under a [LICENSE] license."
zh: "本文遵守 [LICENSE] 许可协议。"
zh-Hans: "本文遵守 [LICENSE] 许可协议。"
zh-Hant: "本文遵守 [LICENSE] 許可協議。"
ko: "이 글의 저작권은 [LICENSE] 라이센스를 따릅니다."

POST_ON_GITHUB:
en: "Edit on Github"
zh: "在 Github 上修改"
zh-Hans: "在 Github 上修改"
zh-Hant: "在 Github 上修改"
ko: "Github에서 확인하기"

FOLLOW_ME:
en: "Follow me on [NAME]."
zh: "在 [NAME] 上关注我。"
zh-Hans: "在 [NAME] 上关注我。"
zh-Hant: "在 [NAME] 上關注我。"
ko: "[NAME]에서 팔로우하기"

EMAIL_ME:
en: "Send me Email."
zh: "给我发邮件。"
zh-Hans: "给我发邮件。"
zh-Hant: "給我發郵件。"
ko: "이메일 보내기"

COPYRIGHT_DATES: "2019"
ko-KR:
<<: *KO
47 changes: 37 additions & 10 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
header:
- titles:
en: Archive
zh: 归档
zh-Hans: 归档
zh-Hant: 歸檔
ko: 아카이브
en : &EN Archive
en-US : *EN
en-CA : *EN
en-GB : *EN
en-AU : *EN

zh-Hans : &ZH_HANS 归档
zh : *ZH_HANS
zh-CN : *ZH_HANS
zh-SG : *ZH_HANS

zh-Hant : &ZH_HANT 歸檔
zh-TW : *ZH_HANT
zh-HK : *ZH_HANT

ko : &KO 아카이브
ko-KR : *KO

url: /archive.html

- titles:
en: About
zh: 关于
zh-Hans: 关于
zh-Hant: 關於
ko: 소개
en : &EN About
en-US : *EN
en-CA : *EN
en-GB : *EN
en-AU : *EN

zh-Hans : &ZH_HANS 关于
zh : *ZH_HANS
zh-CN : *ZH_HANS
zh-SG : *ZH_HANS

zh-Hant : &ZH_HANT 關於
zh-TW : *ZH_HANT
zh-HK : *ZH_HANT

ko : &KO 소개
ko-KR : *KO

url: /about.html
4 changes: 2 additions & 2 deletions _includes/article-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

<footer class="article__footer">
{%- if page.modify_date -%}
{%- include snippets/locale-to-string.html locale=site.data.locale.ARTICLE_DATE_FORMAT -%}
{%- include snippets/get-locale-string.html key='ARTICLE_DATE_FORMAT' -%}
{%- assign _locale_date_format = __return -%}

{%- include snippets/locale-to-string.html locale=site.data.locale.LAST_UPDATED -%}
{%- include snippets/get-locale-string.html key='LAST_UPDATED' -%}
{%- assign _locale_last_update = __return -%}
<span>{{ _locale_last_update }}
<time itemprop="dateModified" datetime="{{ page.modify_date | date_to_xmlschema }}">{{ page.modify_date | date: _locale_date_format }}</time>
Expand Down
2 changes: 1 addition & 1 deletion _includes/article-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{%- if site.repository and site.repository_tree -%}
{%- include snippets/is_collection.html page=include.article -%}
{%- assign _is_article_collection = __return -%}
{%- include snippets/locale-to-string.html locale=site.data.locale.POST_ON_GITHUB -%}
{%- include snippets/get-locale-string.html key='POST_ON_GITHUB' -%}
{%- assign _locale_post_on_github = __return -%}
{%- if _is_article_collection -%}
{%- include snippets/prepend-path.html path=include.article.path prepend_path=site.collections_dir -%}
Expand Down
4 changes: 2 additions & 2 deletions _includes/article-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@

{%- if _show_date -%}
<li>
{%- include snippets/locale-to-string.html locale=site.data.locale.ARTICLE_DATE_FORMAT -%}
{%- include snippets/get-locale-string.html key='ARTICLE_DATE_FORMAT' -%}
<i class="far fa-calendar-alt"></i> <span>{{ include.article.date | date: __return }}</span>
</li>
{%- endif -%}

{%- if _pageview -%}
{%- if site.pageview.provider -%}
{%- include snippets/locale-to-string.html locale=site.data.locale.VIEWS -%}
{%- include snippets/get-locale-string.html key='VIEWS' -%}
{%- assign _locale_views = __return -%}
<li><i class="far fa-eye"></i> <span class="js-pageview" data-page-key="{{ include.article.key }}">0</span> {{ _locale_views }}</li>
{%- endif -%}
Expand Down
4 changes: 2 additions & 2 deletions _includes/article-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{%- assign _excerpt_type = include.excerpt_type -%}

{%- include snippets/locale-to-string.html locale=site.data.locale.READMORE -%}
{%- include snippets/get-locale-string.html key='READMORE' -%}
{%- assign _locale_readmore = __return -%}

{%- assign _sorted_list = include.articles -%}
Expand Down Expand Up @@ -98,7 +98,7 @@
{%- assign _date = _currentdate -%}
{%- endif -%}
{%- endif -%}
{%- include snippets/locale-to-string.html locale=site.data.locale.ARTICLE_LIST_DATE_FORMAT -%}
{%- include snippets/get-locale-string.html key='ARTICLE_LIST_DATE_FORMAT' -%}
<li class="item" itemscope itemtype="http://schema.org/BlogPosting" data-tags="{{ _tags }}">
<div class="item__content">
{%- if include.show_info -%}
Expand Down
4 changes: 2 additions & 2 deletions _includes/article-section-navigator.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
{%- if _previous -%}
{%- include snippets/prepend-baseurl.html path=_previous.url -%}
{%- assign _href = __return -%}
{%- include snippets/locale-to-string.html locale=site.data.locale.PREVIOUS -%}
{%- include snippets/get-locale-string.html key='PREVIOUS' -%}
{%- assign _locale_previous = __return -%}
<div class="previous"><span>{{ _locale_previous }}</span><a href="{{ _href }}">{{ _previous.title }}</a></div>
{%- endif -%}
{%- if _next -%}
{%- include snippets/prepend-baseurl.html path=_next.url -%}
{%- assign _href = __return -%}
{%- include snippets/locale-to-string.html locale=site.data.locale.NEXT -%}
{%- include snippets/get-locale-string.html key='NEXT' -%}
{%- assign _locale_next = __return -%}
<div class="next"><span>{{ _locale_next }}</span><a href="{{ _href }}">{{ _next.title }}</a></div>
{%- endif -%}
Expand Down
2 changes: 1 addition & 1 deletion _includes/article/footer/license.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- include snippets/locale-to-string.html locale=site.data.locale.LICENSE_ANNOUNCE -%}
{%- include snippets/get-locale-string.html key='LICENSE_ANNOUNCE' -%}
{%- assign _license_announce = __return -%}

{%- if include.license -%}
Expand Down
2 changes: 1 addition & 1 deletion _includes/article/footer/subscribe.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- assign _paths_rss = site.paths.rss | default: site.data.variables.default.paths.rss -%}
{%- include snippets/get-nav-url.html path=_paths_rss -%}
{%- assign _paths_rss = __return -%}
{%- include snippets/locale-to-string.html locale=site.data.locale.SUBSCRIBE -%}
{%- include snippets/get-locale-string.html key='SUBSCRIBE' -%}
{%- assign _locale_nav_subscribe = __return -%}
<div class="subscribe"><i class="fas fa-rss"></i> <a type="application/rss+xml" href="{{ _paths_rss }}">{{ _locale_nav_subscribe }}</a></div>
4 changes: 2 additions & 2 deletions _includes/author-links.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<link itemprop="url" href="{{ _author.url }}">
{%- endif -%}

{%- include snippets/locale-to-string.html locale=site.data.locale.EMAIL_ME -%}
{%- include snippets/get-locale-string.html key='EMAIL_ME' -%}
{%- if _author.email -%}
<li title="{{ __return }}">
<a class="button button--circle mail-button" itemprop="email" href="mailto:{{ _author.email }}" target="_blank">
<i class="fas fa-envelope"></i>
</a>
{%- endif -%}

{%- include snippets/locale-to-string.html locale=site.data.locale.FOLLOW_ME -%}
{%- include snippets/get-locale-string.html key='FOLLOW_ME' -%}

{%- if _author.weibo -%}
<li title="{{ __return | replace: '[NAME]', 'Weibo' }}">
Expand Down
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{%- assign _nav_url = __return -%}
{%- include snippets/get-nav-url.html path=page.url -%}
{%- assign _page_url = __return -%}
{%- include snippets/locale-to-string.html locale=_item.titles -%}
{%- include snippets/get-string-from-locale-config.html locale=_item.titles -%}
{%- if _nav_url == _page_url -%}
<li class="navigation__link navigation__link--active"><a href="{{ _nav_url }}">{%- if _item.title -%}{{ _item.title }}{%- else -%}{{ __return }}{%- endif -%}</a></li>
{%- else -%}
Expand Down
2 changes: 1 addition & 1 deletion _includes/paginator.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{%- if paginator.total_pages > 1 -%}
<div class="pagination">

{%- include snippets/locale-to-string.html locale=site.data.locale.STATISTICS -%}
{%- include snippets/get-locale-string.html key='STATISTICS' -%}
{%- assign _locale_statistics = __return -%}

{%- assign _post_count = site.posts | size -%}
Expand Down
4 changes: 2 additions & 2 deletions _includes/search.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- include snippets/locale-to-string.html locale=site.data.locale.CANCEL -%}
{%- include snippets/get-locale-string.html key='CANCEL' -%}
{%- assign _locale_cancel = __return -%}
{%- include snippets/locale-to-string.html locale=site.data.locale.SEARCH -%}
{%- include snippets/get-locale-string.html key='SEARCH' -%}
{%- assign _locale_search = __return -%}

<div class="search search--dark">
Expand Down
2 changes: 1 addition & 1 deletion _includes/snippets/get-article-title.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- if _title -%}
{%- assign __return = _title -%}
{%- elsif _titles -%}
{%- include snippets/locale-to-string.html locale=_titles -%}
{%- include snippets/get-string-from-locale-config.html locale=_titles -%}
{%- assign __return = __return -%}
{%- else -%}
{%- assign __return = nil -%}
Expand Down
Loading

0 comments on commit e4e9602

Please sign in to comment.