Skip to content

Commit e67944a

Browse files
Add Inlang to enable community translations / make the contribution of translations easier (#662)
* init inlang.config.js The inlang config has to exist at the root of the repository. See inlang/inlang#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 <[email protected]>
1 parent b959771 commit e67944a

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ Framework <http://www.django-rest-framework.org/>`__.
2626

2727
For full documentation, visit `django-rest-framework-simplejwt.readthedocs.io
2828
<https://django-rest-framework-simplejwt.readthedocs.io/en/latest/>`__.
29+
30+
31+
Translations
32+
------------
33+
34+
Contribute translations directly with PRs or via inlang https://inlang.com/editor/github.com/jazzband/djangorestframework-simplejwt

inlang.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// filename: inlang.config.js
2+
3+
export async function defineConfig(env) {
4+
// importing a plugin
5+
const plugin = await env.$import(
6+
"https://cdn.jsdelivr.net/gh/jannesblobel/inlang-plugin-po@1/dist/index.js"
7+
);
8+
9+
// most plugins require additional config, read the plugins documentation
10+
// for the required config and correct usage.
11+
const pluginConfig = {
12+
pathPattern:
13+
"./rest_framework_simplejwt/locale/{language}/LC_MESSAGES/django.po",
14+
referenceResourcePath: null,
15+
};
16+
17+
return {
18+
referenceLanguage: "en",
19+
languages: [
20+
"en",
21+
"cs",
22+
"de",
23+
"es",
24+
"es_AR",
25+
"es_CL",
26+
"fa_IR",
27+
"fr",
28+
"id_ID",
29+
"it_IT",
30+
"ko_KR",
31+
"nl_NL",
32+
"pl_PL",
33+
"pt_BR",
34+
"ro",
35+
"ru_RU",
36+
"sl",
37+
"sv",
38+
"tr",
39+
"uk_UA",
40+
"zh_Hans",
41+
],
42+
readResources: (args) =>
43+
plugin.readResources({ ...args, ...env, pluginConfig }),
44+
writeResources: (args) =>
45+
plugin.writeResources({ ...args, ...env, pluginConfig }),
46+
};
47+
}

0 commit comments

Comments
 (0)