forked from zadam/trilium
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from TriliumNext/feature/i18n_first_steps
i18n: First steps
- Loading branch information
Showing
11 changed files
with
147 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"lokalise.i18n-ally" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# An array of strings which contain Language Ids defined by VS Code | ||
# You can check available language ids here: https://code.visualstudio.com/docs/languages/identifiers | ||
languageIds: | ||
- javascript | ||
- typescript | ||
|
||
# An array of RegExes to find the key usage. **The key should be captured in the first match group**. | ||
# You should unescape RegEx strings in order to fit in the YAML file | ||
# To help with this, you can use https://www.freeformatter.com/json-escape.html | ||
usageMatchRegex: | ||
# The following example shows how to detect `t("your.i18n.keys")` | ||
# the `{key}` will be placed by a proper keypath matching regex, | ||
# you can ignore it and use your own matching rules as well | ||
- "[^\\w\\d]t\\(['\"`]({key})['\"`]" | ||
|
||
# A RegEx to set a custom scope range. This scope will be used as a prefix when detecting keys | ||
# and works like how the i18next framework identifies the namespace scope from the | ||
# useTranslation() hook. | ||
# You should unescape RegEx strings in order to fit in the YAML file | ||
# To help with this, you can use https://www.freeformatter.com/json-escape.html | ||
scopeRangeRegex: "useTranslation\\(\\s*\\[?\\s*['\"`](.*?)['\"`]" | ||
|
||
# An array of strings containing refactor templates. | ||
# The "$1" will be replaced by the keypath specified. | ||
refactorTemplates: | ||
- t("$1") | ||
|
||
|
||
# If set to true, only enables this custom framework (will disable all built-in frameworks) | ||
monopoly: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import library_loader from "./library_loader.js"; | ||
|
||
await library_loader.requireLibrary(library_loader.I18NEXT); | ||
|
||
await i18next | ||
.use(i18nextHttpBackend) | ||
.init({ | ||
lng: "en", | ||
debug: true, | ||
backend: { | ||
loadPath: `/${window.glob.assetPath}/translations/{{lng}}/{{ns}}.json` | ||
} | ||
}); | ||
|
||
export const t = i18next.t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"about": { | ||
"title": "About TriliumNext Notes", | ||
"homepage": "Homepage:", | ||
"app_version": "App version:", | ||
"db_version": "DB version:", | ||
"sync_version": "Sync version:", | ||
"build_date": "Build date:", | ||
"build_revision": "Build revision:", | ||
"data_directory": "Data directory:" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"about": { | ||
"title": "Despre TriliumNext Notes", | ||
"homepage": "Site web:", | ||
"app_version": "Versiune aplicație:", | ||
"db_version": "Versiune bază de date:", | ||
"sync_version": "Versiune sincronizare:", | ||
"build_date": "Data compilării:", | ||
"build_revision": "Revizia compilării:", | ||
"data_directory": "Directorul de date:" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters