You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/locales/README.md
+48-3Lines changed: 48 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,36 @@
1
+
# i18n Solution
2
+
3
+
The i18n implementation uses [i18next](https://www.i18next.com/). We chose this over `chrome.i18n` because the latter
4
+
does not support dynamic language switching. However, to meet the requirements of certain extension markets, we still
5
+
add `chrome.i18n` language files in the `src/assets/_locales` directory.
6
+
7
+
## Language Files
8
+
9
+
Language files are located in the `src/locales` directory and are divided by pages, with each page having a
10
+
corresponding language file. These files are ultimately merged and exported through `locales.ts`.
11
+
12
+
## Keyword Conflicts
13
+
14
+
If keywords in a page are the same but their translations differ, you can distinguish them using the `page.key` format,
15
+
for example:
16
+
17
+
```json
18
+
{
19
+
"list": {
20
+
"confirm_delete": "Are you sure you want to delete? Please note that this is an irreversible operation.",
21
+
"confirm_update": "Are you sure you want to update? Please note that this is an irreversible operation."
22
+
}
23
+
}
24
+
```
25
+
26
+
### Help Us Translate
27
+
28
+
[Crowdin](https://crowdin.com/project/scriptcat)
29
+
is an online localization platform that helps us manage translations. If you're interested in helping us translate ScriptCat, you can find the project on Crowdin and start contributing.
30
+
31
+
-`src/locales` is the translation file directory for the [extension](https://github.com/scriptscat/scriptcat)
32
+
-`public/locales` is the translation file directory for the [script website](https://github.com/scriptscat/scriptlist-frontend)
0 commit comments