Repository navigation
Expand file tree
/
Copy pathcrowdin.yml
More file actions
92 lines (92 loc) · 9.35 KB
/
Copy pathcrowdin.yml
File metadata and controls
92 lines (92 loc) · 9.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
# Crowdin CLI configuration for Kolibri
# See https://crowdin.github.io/crowdin-cli/configuration for more information
# See https://support.crowdin.com/developer/configuration-file/ for all available options
#
#
# Your Crowdin credentials
#
"project_id": "201933"
"base_path": "."
"base_url": "https://api.crowdin.com"
#
# Defines whether to preserve the original directory structure in the Crowdin project.
# Must be true, but NOT to get the source hierarchy: every entry below carries a
# `dest`, and those dests define the Crowdin layout — flat at the project root for
# what translators work on, plus an optional_plugins/ folder for the de-prioritised
# plugin catalogs. It is true only because the CLI rejects `dest` otherwise; flipping
# it to false would drop every dest and reinstate the source paths.
#
# `dest` is also what keeps same-named files distinct (each plugin's django.po), which
# preserve_hierarchy: false could not do at all.
#
# Crowdin keys files by their project path, so editing a `dest` below creates a new
# file and leaves the old one holding its translations — move it in the Crowdin UI
# instead, which preserves the file ID.
#
# A `dest` for a CSV MUST end in a literal `.csv` (not `%original_file_name%`):
# UploadSourcesAction.isSpreadsheet() extension-tests the UNRESOLVED dest string, and
# on a miss silently drops `scheme`/`first_line_contains_header`, so the file uploads
# clean but parses to nothing. `type: csv` does not help — isSpreadsheet ignores it.
#
"preserve_hierarchy": true
#
# Files configuration.
# See https://support.crowdin.com/developer/configuration-file/ for all available options
# Note that this only works because of the additional language mapping in the Crowdin project settings
# This allows us to use two-letter language codes in our locale folder names
# but override with specific locale codes in Crowdin where needed
#
files: [
# CSV translation files
{"source": "/kolibri/locale/en/LC_MESSAGES/*.csv", "dest": "/%file_name%.csv", "first_line_contains_header": true, "scheme": "identifier,source_phrase,context,translation", "update_option": "update_as_unapproved", "translation": "/kolibri/locale/%locale_with_underscore%/LC_MESSAGES/%original_file_name%", "languages_mapping": &language_mapping {"locale_with_underscore": {
# Generated mapping from crowdin_code to Django locale code
# Generated by build_tools/i18n/generate_mapping.py
"ach": "ach_UG", "ar": "ar", "bg": "bg_BG", "bn": "bn_BD", "de": "de", "el": "el", "en": "en", "es-ES": "es_ES", "fa": "fa", "fr": "fr_FR", "fv": "ff_CM", "gu-IN": "gu_IN", "ha": "ha", "hi": "hi_IN", "ht": "ht", "id": "id", "it": "it", "ka": "ka", "km": "km", "ko": "ko", "la": "es_419", "mr": "mr", "my": "my", "ny": "ny", "pa-IN": "pa", "pt-BR": "pt_BR", "pt-mz": "pt_MZ", "sw-TZ": "sw_TZ", "te": "te", "uk": "uk", "ur-PK": "ur_PK", "vi": "vi", "yo": "yo", "zh-CN": "zh_Hans"}}},
# Frontend i18n for ALL python_packages/* plugins (issue #14970) — one entry, which
# rests on plugin frontend CSVs being namespace-prefixed (kolibri_sentry_plugin-
# messages.csv): the basenames are globally unique, so one flattening `dest` cannot
# collide the way the per-plugin django.po below would.
# `dest` files them under optional_plugins/ in the Crowdin project: they are not a
# translation priority, so they stay out of the top-level file list. The `**` in
# source and translation carries each plugin's <dist>/<module> subpath through, so
# downloads land back in the correct plugin locale/ regardless. A new frontend
# plugin needs NO change here. (Ignore node_modules so the recursive `**` can't
# pick up any vendored CSVs.)
{"source": "/python_packages/**/locale/en/LC_MESSAGES/*.csv", "dest": "/optional_plugins/%file_name%.csv", "ignore": ["/python_packages/**/node_modules/**"], "first_line_contains_header": true, "scheme": "identifier,source_phrase,context,translation", "update_option": "update_as_unapproved", "translation": "/python_packages/**/locale/%locale_with_underscore%/LC_MESSAGES/%original_file_name%", "languages_mapping": *language_mapping},
# PO translation files
{"source": "/kolibri/locale/en/LC_MESSAGES/*.po", "dest": "/%file_name%.po", "update_option": "update_as_unapproved", "translation": "/kolibri/locale/%locale_with_underscore%/LC_MESSAGES/%original_file_name%", "ignore": ["/kolibri/locale/en/LC_MESSAGES/*.json", "/kolibri/locale/en/LC_MESSAGES/*.mo", "/kolibri/locale/en/LC_MESSAGES/README.md"], "languages_mapping": *language_mapping},
# Plugin backend PO — one entry PER plugin, unlike the frontend CSVs above, and
# likewise filed under optional_plugins/. Django makemessages emits no domain but
# `django`, so every plugin's catalog is named django.po and they would collide
# with each other inside the folder. No placeholder can separate them either:
# `%file_name%` is the source basename, which is `django` for every plugin, and
# `%original_path%` is the whole relative source directory, which would rebuild the
# python_packages/<dist>/<module>/locale/en/LC_MESSAGES hierarchy under
# optional_plugins/. So a literal `dest` per plugin it is.
# `dest` renames only in the Crowdin project; the `translation` template still
# writes downloads to the real local django.po, so compile / message-file steps are
# unaffected. A plugin gaining its first backend string needs a new entry mirroring
# this one.
{"source": "/python_packages/kolibri-oidc-client-plugin/kolibri_oidc_client_plugin/locale/en/LC_MESSAGES/django.po", "dest": "/optional_plugins/kolibri_oidc_client_plugin.django.po", "update_option": "update_as_unapproved", "translation": "/python_packages/kolibri-oidc-client-plugin/kolibri_oidc_client_plugin/locale/%locale_with_underscore%/LC_MESSAGES/django.po", "languages_mapping": *language_mapping},
# desktop-app (issue #15073) — two i18n subsystems with different locale-code
# conventions. The wxPython app reuses the shared underscore anchor (its folders
# are Django/gettext codes like es_ES). The Inno Setup installer needs its own
# inline hyphen-lowercase %locale% map because installer/translations/definitions.py
# keys the locale definitions by hyphen-lowercase codes (es-es, zh-hans). Both
# maps derive from the same language_info.json via generate_mapping.py.
{"source": "/platforms/desktop-app/src/kolibri_app/locales/en/LC_MESSAGES/wxapp.po", "dest": "/desktop_app.po", "update_option": "update_as_unapproved", "translation": "/platforms/desktop-app/src/kolibri_app/locales/%locale_with_underscore%/LC_MESSAGES/wxapp.po", "languages_mapping": *language_mapping},
# Inno Setup installer — `type: ini` forces the INI parser past the unrecognised
# .isl extension. excluded_target_languages is generated by generate_mapping.py from
# definitions.py and asserted in test_i18n_desktop_crowdin.py; a code the project
# does not have as a target language fails the whole entry, which rules out `ach`
# (the in-context pseudo-language).
{"source": "/platforms/desktop-app/installer/translations/locale/en/custom.isl", "type": "ini", "dest": "/desktop_installer.isl", "update_option": "update_as_unapproved", "translation": "/platforms/desktop-app/installer/translations/locale/%locale%/custom.isl", "languages_mapping": &installer_language_mapping {"locale": {"ach": "ach-ug", "ar": "ar", "bg": "bg-bg", "bn": "bn-bd", "de": "de", "el": "el", "en": "en", "es-ES": "es-es", "fa": "fa", "fr": "fr-fr", "fv": "ff-cm", "gu-IN": "gu-in", "ha": "ha", "hi": "hi-in", "ht": "ht", "id": "id", "it": "it", "ka": "ka", "km": "km", "ko": "ko", "la": "es-419", "mr": "mr", "my": "my", "ny": "ny", "pa-IN": "pa", "pt-BR": "pt-br", "pt-mz": "pt-mz", "sw-TZ": "sw-tz", "te": "te", "uk": "uk", "ur-PK": "ur-pk", "vi": "vi", "yo": "yo", "zh-CN": "zh-hans"}}}, {"source": "/platforms/desktop-app/installer/translations/locale/en/messages.isl", "type": "ini", "dest": "/desktop_installer_messages.isl", "update_option": "update_as_unapproved", "translation": "/platforms/desktop-app/installer/translations/locale/%locale%/messages.isl", "excluded_target_languages": ["ar", "bg", "bn", "de", "el", "es-ES", "fa", "fr", "hi", "id", "it", "ka", "ko", "la", "mr", "pt-BR", "pt-mz", "uk", "ur-PK", "vi", "zh-CN"], "languages_mapping": *installer_language_mapping},
# Android installer UI strings (issue #15074). type: android forces Crowdin's
# Android-resource parser (not .xml auto-detect), which honours
# translatable="false" (so task_worker_process is not uploaded) and
# Android-encodes downloads. %android_code% expands to the values-<code>
# qualifier; the android_code mapping (generated by
# build_tools/i18n/generate_mapping.py) overrides Crowdin's defaults so folders
# match Kolibri's language set.
{"source": "/platforms/android/app/src/main/res/values/strings.xml", "type": "android", "dest": "/android_strings.xml", "translation": "/platforms/android/app/src/main/res/values-%android_code%/strings.xml", "update_option": "update_as_unapproved", "languages_mapping": {"android_code": {"ach": "ach-rUG", "ar": "ar", "bg": "bg-rBG", "bn": "bn-rBD", "de": "de", "el": "el", "en": "en", "es-ES": "es-rES", "fa": "fa", "fr": "fr-rFR", "fv": "ff-rCM", "gu-IN": "gu-rIN", "ha": "ha", "hi": "hi-rIN", "ht": "ht", "id": "id", "it": "it", "ka": "ka", "km": "km", "ko": "ko", "la": "b+es+419", "mr": "mr", "my": "my", "ny": "ny", "pa-IN": "pa", "pt-BR": "pt-rBR", "pt-mz": "pt-rMZ", "sw-TZ": "sw-rTZ", "te": "te", "uk": "uk", "ur-PK": "ur-rPK", "vi": "vi", "yo": "yo", "zh-CN": "zh"}}}]