From 36808b95ea694cfae34f01e1925cef786fb2a94e Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Fri, 22 May 2020 11:33:22 +0800 Subject: [PATCH] Update docs for i18n --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- README.md | 2 +- docs/ru/README.md | 2 +- docs/zh-CN/README.md | 2 +- languages/README.md | 37 +++++++++++++ languages/hu.yml | 90 -------------------------------- 6 files changed, 41 insertions(+), 94 deletions(-) create mode 100644 languages/README.md delete mode 100644 languages/hu.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2c224d9..f5cb0c9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -25,7 +25,7 @@ - [ ] Refactoring (no functional changes, no api changes). - [ ] Build & CI related changes. - [ ] Documentation. -- [ ] Translation. +- [ ] Translation. - [ ] Other... Please describe: ## What is the current behavior? diff --git a/README.md b/README.md index 42b01f2..8fe1295 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Also, we welcome Issue or PR to our [official-plugins][official-plugins-url]. [docs-update-5-1-x-url]: https://theme-next.js.org/docs/getting-started/update-from-v5.html [gitter-url]: https://gitter.im/hexo-next -[i18n-url]: https://i18n.theme-next.org +[i18n-url]: https://crowdin.com/project/hexo-theme-next [awesome-next-url]: https://github.com/next-theme/awesome-next [issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md diff --git a/docs/ru/README.md b/docs/ru/README.md index edea0c4..1a6b555 100644 --- a/docs/ru/README.md +++ b/docs/ru/README.md @@ -108,7 +108,7 @@ $ git pull [docs-update-5-1-x-url]: https://theme-next.js.org/docs/getting-started/update-from-v5.html [gitter-url]: https://gitter.im/hexo-next -[i18n-url]: https://i18n.theme-next.org +[i18n-url]: https://crowdin.com/project/hexo-theme-next [awesome-next-url]: https://github.com/next-theme/awesome-next [issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index fe249f9..4cfd0c0 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -126,7 +126,7 @@ $ git pull [docs-update-5-1-x-url]: https://theme-next.js.org/docs/getting-started/update-from-v5.html [gitter-url]: https://gitter.im/hexo-next -[i18n-url]: https://i18n.theme-next.org +[i18n-url]: https://crowdin.com/project/hexo-theme-next [awesome-next-url]: https://github.com/next-theme/awesome-next [issues-bug-url]: https://github.com/next-theme/hexo-theme-next/issues/new?assignees=&labels=Bug&template=bug-report.md diff --git a/languages/README.md b/languages/README.md new file mode 100644 index 0000000..60685a4 --- /dev/null +++ b/languages/README.md @@ -0,0 +1,37 @@ +# Internationalization (i18n) + +You can use internationalization to present your site in different languages. The default language is set by modifying the `language` setting in `_config.yml`. You can also set multiple languages and modify the order of default languages. + +```yaml +language: en +``` + +```yaml +language: + - zh-cn + - en +``` + +## Override Default Translations + +If you would like to customize the default translation, you do not need to modify the translation files in the `languages` directory. You can override all translations using [Data files](https://hexo.io/docs/data-files). + +1. Creat a `languages.yml` in `source/_data`. +2. Insert following codes: (be careful about the two-space indent) + + ```yaml + # language + zh-CN: + # items + post: + copyright: + # the translation you perfer + author: 本文博主 + en: + menu: + schedule: Calendar + ``` + +## Improve Translations + +The files in the `language` directory are automatically generated, you do not need to modify them directly. Please submit translations via [Crowdin](https://crowdin.com/project/hexo-theme-next) if you would like to add or improve translation for NexT theme. diff --git a/languages/hu.yml b/languages/hu.yml deleted file mode 100644 index e9bd099..0000000 --- a/languages/hu.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -name: magyar -title: - archive: Archive - category: Category - tag: Tag - schedule: Ütemterv -menu: - home: Home - archives: Archives - categories: Categories - tags: Tags - about: About - search: Search - schedule: Schedule - sitemap: Sitemap - commonweal: Commonweal 404 -sidebar: - overview: Overview - toc: Table of Contents -post: - posted: Posted on - edited: Edited on - created: Created - modified: Modified - edit: Edit this post - in: In - read_more: Read more - untitled: Untitled - sticky: Sticky - views: Views - related_posts: Related Posts - copyright: - author: Post author - link: Post link - license_title: Copyright Notice - license_content: "All articles in this blog are licensed under %s unless stating additionally." -footer: - powered: "Powered by %s" - total_views: Total Views - total_visitors: Total Visitors -counter: - tag_cloud: - zero: No tags - one: 1 tag in total - other: "%d tags in total" - categories: - zero: No categories - one: 1 category in total - other: "%d categories in total" - archive_posts: - zero: No posts. - one: 1 post. - other: "%d posts in total." -state: - posts: posts - tags: tags - categories: categories -search: - placeholder: Searching... -cheers: - um: Um.. - ok: OK - nice: Nice - good: Good - great: Great - excellent: Excellent -keep_on: Keep on posting. -symbol: - comma: ", " - period: ". " - colon: ": " -reward: - donate: Donate - wechatpay: WeChat Pay - alipay: Alipay - paypal: PayPal - bitcoin: Bitcoin -follow_me: - welcome: Welcome to my other publishing channels -accessibility: - nav_toggle: Toggle navigation bar - prev_page: Previous page - next_page: Next page -symbols_count_time: - count: Symbols count in article - count_total: Symbols count total - time: Reading time - time_total: Reading time total - time_minutes: mins.