Skip to content

Commit

Permalink
get started with Japanese translation
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Apr 29, 2024
1 parent 7033d1c commit e9bdb6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Each localization lives in its own repository:

- Russian: [https://github.com/test-prof/docs-ru](https://github.com/test-prof/docs-ru)
- Chinese: [https://github.com/test-prof/docs-zh-cn](https://github.com/test-prof/docs-zh-cn)
- Japanese: [https://github.com/test-prof/docs-ja](https://github.com/test-prof/docs-ja)

See [the guide on working on translations](TRANSLATIONS.md).

Expand Down
6 changes: 1 addition & 5 deletions TRANSLATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ Thus, it's possible to gradually introduce a localization.

We recommend loading assets from the main documentation (and not copy them across translations).

However, Docsify tries to be smart and automatically update relative image sources in the markdown source. The only way to hack it around is to use plain html, e.g.:
However, Docsify tries to be smart and automatically update relative image sources in the markdown source. The only way to hack it around is to use absolute URLs, e.g.:

```md
<!-- Original -->
![TagProf UI](../assets/tag-prof.gif)

<!-- Translation -->
<img alt="TagProf UI" data-origin="/assets/tag-prof.gif" src="/assets/tag-prof.gif">
```
11 changes: 6 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'<option value="">English</option>' +
'<option value="ru">Русский</option>' +
'<option value="zh-cn">中文</option>' +
'<option value="ja">日本語</option>' +
'</select>',
nameLink: false,
repo: 'https://github.com/test-prof/test-prof',
Expand All @@ -60,23 +61,23 @@
auto2top: true,
relativePath: true,
alias: {
'/(ru|zh-cn)/.*_sidebar.md': 'https://raw.githubusercontent.com/test-prof/docs-$1/master/docs/_sidebar.md',
'/(ru|zh-cn|ja)/.*_sidebar.md': 'https://raw.githubusercontent.com/test-prof/docs-$1/master/docs/_sidebar.md',
'/.*/_sidebar.md': 'https://raw.githubusercontent.com/test-prof/test-prof/master/docs/_sidebar.md',
'/(ru|zh-cn)/(.*)': 'https://raw.githubusercontent.com/test-prof/docs-$1/master/docs/$2',
'/(ru|zh-cn|ja)/(.*)': 'https://raw.githubusercontent.com/test-prof/docs-$1/master/docs/$2',
'/(.*)': 'https://raw.githubusercontent.com/test-prof/test-prof/master/docs/$1',
},
fallbackLanguages: ['ru', 'zh-cn'],
fallbackLanguages: ['ru', 'zh-cn', 'ja'],
search: {
paths: 'auto',
namespace: 'test-prof-'+window.DOCSIFY_ROUTER_MODE,
hideOtherSidebarContent: true,
depth: 3,
pathNamespaces: /^(\/(ru|zh-cn))?/
pathNamespaces: /^(\/(ru|zh-cn|ja))?/
},
namespaces: [
{
id: "lang",
values: ["ru", "zh-cn"],
values: ["ru", "zh-cn", "ja"],
optional: true,
selector: "#lang-selector"
}
Expand Down

0 comments on commit e9bdb6f

Please sign in to comment.