We welcome contributions to make De4py accessible to everyone! Adding a new language or updating an existing one is straightforward.
De4py uses a JSON-based translation system located in de4py/lang/locales/.
Each language has its own .json file named after its ISO 639-1 code (e.g., en.json, es.json, ar.json).
The system automatically detects new language files in this directory.
-
Find the Language Code: Identify the ISO 639-1 code for your language (e.g.,
frfor French,defor German,jafor Japanese). -
Create the File: Create a new file in
de4py/lang/locales/named<code.json>. -
Add Metadata: Start the file with the required metadata:
{ "LANG_NAME": "Français", "IS_RTL": false, ... }LANG_NAME: The name of the language as it should appear in the settings menu (in native script).IS_RTL: Set totrueif the language is Right-to-Left (like Arabic or Hebrew), otherwisefalse.
-
Copy Keys: Copy the content from
en.json(English) into your new file. -
Translate values: Translate the values (right side) into your language. Do not change the keys (left side).
Example:
"nav.home": "Accueil", "common.btn.save": "Enregistrer"
-
Test:
- Open De4py.
- Go to Settings.
- Select your new language from the dropdown.
- Verify that text appears correctly and layout is correct.
- Open the relevant
.jsonfile inde4py/lang/locales/. - Find the key you want to update.
- Change the text value.
- Save and restart the app (or switch languages) to see changes.
Some strings contain placeholders like {name} or {count}. Keep these exactly as they are in the translated string.
English: "Hello {name}!"
French: "Bonjour {name} !"
We support pluralization for keys starting with plural.. These keys map to an object containing different forms based on the count.
Supported forms (based on CLDR):
zero,one,two,few,many,other
Example:
"plural.files": {
"one": "{count} fichier",
"other": "{count} fichiers"
}At minimum, other is required. one is highly recommended.
We use Crowdin for translations.
.
You can export the JSON files from these platforms and place them in the locales folder.