forked from jazzband/djangorestframework-simplejwt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Inlang to enable community translations / make the contribution o…
…f translations easier (jazzband#662) * init inlang.config.js The inlang config has to exist at the root of the repository. See opral/monorepo#258. * init th en. pot file * Create po file as reference language. Add instead of a pot file * remove whitespace right after LC_MESSAGES. * update config and remove en files * update inlang config * Update README.rst * fix title underline * Update README.rst --------- Co-authored-by: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com>
- Loading branch information
1 parent
b959771
commit e67944a
Showing
2 changed files
with
53 additions
and
0 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
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,47 @@ | ||
// filename: inlang.config.js | ||
|
||
export async function defineConfig(env) { | ||
// importing a plugin | ||
const plugin = await env.$import( | ||
"https://cdn.jsdelivr.net/gh/jannesblobel/inlang-plugin-po@1/dist/index.js" | ||
); | ||
|
||
// most plugins require additional config, read the plugins documentation | ||
// for the required config and correct usage. | ||
const pluginConfig = { | ||
pathPattern: | ||
"./rest_framework_simplejwt/locale/{language}/LC_MESSAGES/django.po", | ||
referenceResourcePath: null, | ||
}; | ||
|
||
return { | ||
referenceLanguage: "en", | ||
languages: [ | ||
"en", | ||
"cs", | ||
"de", | ||
"es", | ||
"es_AR", | ||
"es_CL", | ||
"fa_IR", | ||
"fr", | ||
"id_ID", | ||
"it_IT", | ||
"ko_KR", | ||
"nl_NL", | ||
"pl_PL", | ||
"pt_BR", | ||
"ro", | ||
"ru_RU", | ||
"sl", | ||
"sv", | ||
"tr", | ||
"uk_UA", | ||
"zh_Hans", | ||
], | ||
readResources: (args) => | ||
plugin.readResources({ ...args, ...env, pluginConfig }), | ||
writeResources: (args) => | ||
plugin.writeResources({ ...args, ...env, pluginConfig }), | ||
}; | ||
} |