From 79df69adceb87898121a58920b61bc3598b9423b Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Thu, 9 May 2024 11:57:25 -0700 Subject: [PATCH 1/3] Fix incorrect language code for Chewa. Use ny instead of nyn. Add intl locale data for ny language code. --- .../core/assets/src/utils/intl-locale-data.js | 8 +- .../assets/src/utils/vue-intl-locale-data.js | 4 +- .../0026_update_language_code_nyn_to_ny.py | 177 +++++++++++++++ .../0022_update_language_code_nyn_to_ny.py | 192 ++++++++++++++++ kolibri/core/device/upgrade.py | 9 + kolibri/deployment/default/settings/base.py | 4 +- kolibri/locale/language_info.json | 2 +- .../locale/{nyn => ny}/LC_MESSAGES/README.md | 0 .../locale/{nyn => ny}/LC_MESSAGES/django.mo | Bin .../locale/{nyn => ny}/LC_MESSAGES/django.po | 0 ...olibri.core.default_frontend-messages.json | 0 .../kolibri.plugins.coach.app-messages.json | 0 ...libri.plugins.coach.side_nav-messages.json | 0 ...bri.plugins.demo_server.main-messages.json | 0 .../kolibri.plugins.device.app-messages.json | 0 ...ibri.plugins.device.side_nav-messages.json | 0 ...bri.plugins.epub_viewer.main-messages.json | 0 ...kolibri.plugins.facility.app-messages.json | 0 ...ri.plugins.html5_viewer.main-messages.json | 0 .../kolibri.plugins.learn.app-messages.json | 0 ...ugins.learn.my_downloads_app-messages.json | 0 ...libri.plugins.learn.side_nav-messages.json | 0 ...ri.plugins.media_player.main-messages.json | 0 ...ibri.plugins.pdf_viewer.main-messages.json | 0 ....plugins.perseus_viewer.main-messages.json | 0 ...kolibri.plugins.policies.app-messages.json | 0 ...bri.plugins.setup_wizard.app-messages.json | 0 ...lugins.slideshow_viewer.main-messages.json | 0 ...olibri.plugins.user_auth.app-messages.json | 0 ...bri.plugins.user_profile.app-messages.json | 0 kolibri/utils/i18n.py | 2 +- .../kolibri-tools/lib/i18n/intl_code_gen.js | 2 +- .../lib/i18n/locale-data/intl/ny.js | 213 ++++++++++++++++++ 33 files changed, 602 insertions(+), 11 deletions(-) create mode 100644 kolibri/core/auth/migrations/0026_update_language_code_nyn_to_ny.py create mode 100644 kolibri/core/device/migrations/0022_update_language_code_nyn_to_ny.py rename kolibri/locale/{nyn => ny}/LC_MESSAGES/README.md (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/django.mo (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/django.po (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.core.default_frontend-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.coach.app-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.coach.side_nav-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.demo_server.main-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.device.app-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.device.side_nav-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.epub_viewer.main-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.facility.app-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.html5_viewer.main-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.learn.app-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.learn.my_downloads_app-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.learn.side_nav-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.media_player.main-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.pdf_viewer.main-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.perseus_viewer.main-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.policies.app-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.setup_wizard.app-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.slideshow_viewer.main-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.user_auth.app-messages.json (100%) rename kolibri/locale/{nyn => ny}/LC_MESSAGES/kolibri.plugins.user_profile.app-messages.json (100%) create mode 100644 packages/kolibri-tools/lib/i18n/locale-data/intl/ny.js diff --git a/kolibri/core/assets/src/utils/intl-locale-data.js b/kolibri/core/assets/src/utils/intl-locale-data.js index 5e14a36de32..acc96761de5 100644 --- a/kolibri/core/assets/src/utils/intl-locale-data.js +++ b/kolibri/core/assets/src/utils/intl-locale-data.js @@ -2,7 +2,7 @@ * This is an auto-generated file, any manual edits will be overridden. * * To regenerate, see instructions here: - * https://kolibri-dev.readthedocs.io/en/develop/references/i18n.html + * https://kolibri-dev.readthedocs.io/en/develop/i18n.html * * This file was generated by kolibri-tools i18n-code-gen * @@ -142,10 +142,10 @@ module.exports = function(locale) { resolve(() => require('intl/locale-data/jsonp/my.js')); }); }); - case 'nyn': + case 'ny': return new Promise(function(resolve) { - require.ensure(['intl/locale-data/jsonp/nyn.js'], function(require) { - resolve(() => require('intl/locale-data/jsonp/nyn.js')); + require.ensure(['kolibri-tools/lib/i18n/locale-data/intl/ny.js'], function(require) { + resolve(() => require('kolibri-tools/lib/i18n/locale-data/intl/ny.js')); }); }); case 'pt-br': diff --git a/kolibri/core/assets/src/utils/vue-intl-locale-data.js b/kolibri/core/assets/src/utils/vue-intl-locale-data.js index 78d795f7b4d..52af39d846e 100644 --- a/kolibri/core/assets/src/utils/vue-intl-locale-data.js +++ b/kolibri/core/assets/src/utils/vue-intl-locale-data.js @@ -2,7 +2,7 @@ * This is an auto-generated file, any manual edits will be overridden. * * To regenerate, see instructions here: - * https://kolibri-dev.readthedocs.io/en/develop/references/i18n.html + * https://kolibri-dev.readthedocs.io/en/develop/i18n.html * * This file was generated by kolibri-tools i18n-code-gen * @@ -32,7 +32,7 @@ module.exports = function() { data.push(require('vue-intl/locale-data/ko.js')); data.push(require('vue-intl/locale-data/mr.js')); data.push(require('vue-intl/locale-data/my.js')); - data.push(require('vue-intl/locale-data/nyn.js')); + data.push(require('vue-intl/locale-data/ny.js')); data.push(require('vue-intl/locale-data/pt.js')); data.push(require('vue-intl/locale-data/pt.js')); data.push(require('vue-intl/locale-data/sw.js')); diff --git a/kolibri/core/auth/migrations/0026_update_language_code_nyn_to_ny.py b/kolibri/core/auth/migrations/0026_update_language_code_nyn_to_ny.py new file mode 100644 index 00000000000..e5b7c63fbab --- /dev/null +++ b/kolibri/core/auth/migrations/0026_update_language_code_nyn_to_ny.py @@ -0,0 +1,177 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2024-05-10 21:02 +from __future__ import unicode_literals + +from django.db import migrations + +import kolibri.core.auth.constants.demographics +import kolibri.core.fields +import kolibri.core.utils.validators + + +class Migration(migrations.Migration): + + dependencies = [ + ("kolibriauth", "0025_custom_demographic_schema"), + ] + + operations = [ + migrations.AlterField( + model_name="facilitydataset", + name="extra_fields", + field=kolibri.core.fields.JSONField( + blank=True, + default={"facility": {}, "on_my_own_setup": False, "pin_code": ""}, + null=True, + validators=[ + kolibri.core.utils.validators.JSON_Schema_Validator( + { + "properties": { + "demographic_fields": { + "items": { + "properties": { + "description": {"type": "string"}, + "enumValues": { + "items": { + "properties": { + "defaultLabel": { + "type": "string" + }, + "translations": { + "items": { + "properties": { + "language": { + "enum": [ + "ar", + "bg-bg", + "bn-bd", + "de", + "el", + "en", + "es-419", + "es-es", + "fa", + "ff-cm", + "fr-fr", + "gu-in", + "ha", + "hi-in", + "ht", + "id", + "it", + "ka", + "km", + "ko", + "mr", + "my", + "ny", + "pt-br", + "pt-mz", + "sw-tz", + "te", + "uk", + "ur-pk", + "vi", + "yo", + "zh-hans", + ], + "type": "string", + }, + "message": { + "type": "string" + }, + }, + "type": "object", + }, + "optional": True, + "type": "array", + }, + "value": {"type": "string"}, + }, + "type": "object", + }, + "type": "array", + }, + "id": {"type": "string"}, + "translations": { + "items": { + "properties": { + "language": { + "enum": [ + "ar", + "bg-bg", + "bn-bd", + "de", + "el", + "en", + "es-419", + "es-es", + "fa", + "ff-cm", + "fr-fr", + "gu-in", + "ha", + "hi-in", + "ht", + "id", + "it", + "ka", + "km", + "ko", + "mr", + "my", + "ny", + "pt-br", + "pt-mz", + "sw-tz", + "te", + "uk", + "ur-pk", + "vi", + "yo", + "zh-hans", + ], + "type": "string", + }, + "message": {"type": "string"}, + }, + "type": "object", + }, + "optional": True, + "type": "array", + }, + }, + "type": "object", + }, + "optional": True, + "type": "array", + }, + "facility": {"optional": True, "type": "object"}, + "on_my_own_setup": { + "optional": True, + "type": "boolean", + }, + "pin_code": { + "optional": True, + "type": ["string", "null"], + }, + }, + "type": "object", + } + ), + kolibri.core.auth.constants.demographics.UniqueIdsValidator( + "demographic_fields" + ), + kolibri.core.auth.constants.demographics.DescriptionTranslationValidator( + "demographic_fields" + ), + kolibri.core.auth.constants.demographics.EnumValuesValidator( + "demographic_fields" + ), + kolibri.core.auth.constants.demographics.LabelTranslationValidator( + "demographic_fields" + ), + ], + ), + ), + ] diff --git a/kolibri/core/device/migrations/0022_update_language_code_nyn_to_ny.py b/kolibri/core/device/migrations/0022_update_language_code_nyn_to_ny.py new file mode 100644 index 00000000000..52984130557 --- /dev/null +++ b/kolibri/core/device/migrations/0022_update_language_code_nyn_to_ny.py @@ -0,0 +1,192 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2024-05-10 21:02 +from __future__ import unicode_literals + +from django.db import migrations + +import kolibri.core.auth.constants.demographics +import kolibri.core.fields +import kolibri.core.utils.validators + + +class Migration(migrations.Migration): + + dependencies = [ + ("device", "0021_default_demographic_fields"), + ] + + operations = [ + migrations.AlterField( + model_name="devicesettings", + name="extra_settings", + field=kolibri.core.fields.JSONField( + default={ + "allow_download_on_metered_connection": False, + "allow_learner_download_resources": False, + "enable_automatic_download": True, + "limit_for_autodownload": 0, + "set_limit_for_autodownload": False, + }, + validators=[ + kolibri.core.utils.validators.JSON_Schema_Validator( + { + "properties": { + "allow_download_on_metered_connection": { + "type": "boolean" + }, + "allow_learner_download_resources": { + "optional": True, + "type": "boolean", + }, + "default_demographic_field_schema": { + "items": { + "properties": { + "description": {"type": "string"}, + "enumValues": { + "items": { + "properties": { + "defaultLabel": { + "type": "string" + }, + "translations": { + "items": { + "properties": { + "language": { + "enum": [ + "ar", + "bg-bg", + "bn-bd", + "de", + "el", + "en", + "es-419", + "es-es", + "fa", + "ff-cm", + "fr-fr", + "gu-in", + "ha", + "hi-in", + "ht", + "id", + "it", + "ka", + "km", + "ko", + "mr", + "my", + "ny", + "pt-br", + "pt-mz", + "sw-tz", + "te", + "uk", + "ur-pk", + "vi", + "yo", + "zh-hans", + ], + "type": "string", + }, + "message": { + "type": "string" + }, + }, + "type": "object", + }, + "optional": True, + "type": "array", + }, + "value": {"type": "string"}, + }, + "type": "object", + }, + "type": "array", + }, + "id": {"type": "string"}, + "translations": { + "items": { + "properties": { + "language": { + "enum": [ + "ar", + "bg-bg", + "bn-bd", + "de", + "el", + "en", + "es-419", + "es-es", + "fa", + "ff-cm", + "fr-fr", + "gu-in", + "ha", + "hi-in", + "ht", + "id", + "it", + "ka", + "km", + "ko", + "mr", + "my", + "ny", + "pt-br", + "pt-mz", + "sw-tz", + "te", + "uk", + "ur-pk", + "vi", + "yo", + "zh-hans", + ], + "type": "string", + }, + "message": {"type": "string"}, + }, + "type": "object", + }, + "optional": True, + "type": "array", + }, + }, + "type": "object", + }, + "optional": True, + "type": "array", + }, + "enable_automatic_download": {"type": "boolean"}, + "limit_for_autodownload": { + "optional": True, + "type": "integer", + }, + "set_limit_for_autodownload": { + "optional": True, + "type": "boolean", + }, + }, + "required": [ + "allow_download_on_metered_connection", + "enable_automatic_download", + ], + "type": "object", + } + ), + kolibri.core.auth.constants.demographics.UniqueIdsValidator( + "default_demographic_field_schema" + ), + kolibri.core.auth.constants.demographics.DescriptionTranslationValidator( + "default_demographic_field_schema" + ), + kolibri.core.auth.constants.demographics.EnumValuesValidator( + "default_demographic_field_schema" + ), + kolibri.core.auth.constants.demographics.LabelTranslationValidator( + "default_demographic_field_schema" + ), + ], + ), + ), + ] diff --git a/kolibri/core/device/upgrade.py b/kolibri/core/device/upgrade.py index 79162166f30..b175125a917 100644 --- a/kolibri/core/device/upgrade.py +++ b/kolibri/core/device/upgrade.py @@ -13,3 +13,12 @@ @version_upgrade(old_version="<0.15.0") def clear_static_dir(): rmtree(settings.STATIC_ROOT, ignore_errors=True) + + +@version_upgrade(old_version="<0.16.2") +def migrate_nyn_to_ny(): + from kolibri.core.device.utils import get_device_setting + from kolibri.core.device.utils import set_device_settings + + if get_device_setting("language_id") == "nyn": + set_device_settings(language_id="ny") diff --git a/kolibri/deployment/default/settings/base.py b/kolibri/deployment/default/settings/base.py index 0a13e93d0ad..110fe1d2c61 100644 --- a/kolibri/deployment/default/settings/base.py +++ b/kolibri/deployment/default/settings/base.py @@ -273,9 +273,9 @@ "name_local": "ქართული", }, "km": {"bidi": False, "code": "km", "name": "Khmer", "name_local": "ភាសាខ្មែរ"}, - "nyn": { + "ny": { "bidi": False, - "code": "nyn", + "code": "ny", "name": "Chichewa, Chewa, Nyanja", "name_local": "Chinyanja", }, diff --git a/kolibri/locale/language_info.json b/kolibri/locale/language_info.json index d9b61bb6bf4..5826dce67d3 100644 --- a/kolibri/locale/language_info.json +++ b/kolibri/locale/language_info.json @@ -162,7 +162,7 @@ }, { "crowdin_code": "ny", - "intl_code": "nyn", + "intl_code": "ny", "language_name": "Chinyanja", "english_name": "Chichewa, Chewa, Nyanja", "default_font": "NotoSans" diff --git a/kolibri/locale/nyn/LC_MESSAGES/README.md b/kolibri/locale/ny/LC_MESSAGES/README.md similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/README.md rename to kolibri/locale/ny/LC_MESSAGES/README.md diff --git a/kolibri/locale/nyn/LC_MESSAGES/django.mo b/kolibri/locale/ny/LC_MESSAGES/django.mo similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/django.mo rename to kolibri/locale/ny/LC_MESSAGES/django.mo diff --git a/kolibri/locale/nyn/LC_MESSAGES/django.po b/kolibri/locale/ny/LC_MESSAGES/django.po similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/django.po rename to kolibri/locale/ny/LC_MESSAGES/django.po diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.core.default_frontend-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.core.default_frontend-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.core.default_frontend-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.core.default_frontend-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.coach.app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.coach.app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.coach.app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.coach.app-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.coach.side_nav-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.coach.side_nav-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.coach.side_nav-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.coach.side_nav-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.demo_server.main-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.demo_server.main-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.demo_server.main-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.demo_server.main-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.device.app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.device.app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.device.app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.device.app-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.device.side_nav-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.device.side_nav-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.device.side_nav-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.device.side_nav-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.epub_viewer.main-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.epub_viewer.main-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.epub_viewer.main-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.epub_viewer.main-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.facility.app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.facility.app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.facility.app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.facility.app-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.html5_viewer.main-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.html5_viewer.main-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.html5_viewer.main-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.html5_viewer.main-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.learn.app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.learn.app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.learn.app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.learn.app-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.learn.my_downloads_app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.learn.my_downloads_app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.learn.my_downloads_app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.learn.my_downloads_app-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.learn.side_nav-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.learn.side_nav-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.learn.side_nav-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.learn.side_nav-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.media_player.main-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.media_player.main-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.media_player.main-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.media_player.main-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.pdf_viewer.main-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.pdf_viewer.main-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.pdf_viewer.main-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.pdf_viewer.main-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.perseus_viewer.main-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.perseus_viewer.main-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.perseus_viewer.main-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.perseus_viewer.main-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.policies.app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.policies.app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.policies.app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.policies.app-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.setup_wizard.app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.setup_wizard.app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.setup_wizard.app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.setup_wizard.app-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.slideshow_viewer.main-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.slideshow_viewer.main-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.slideshow_viewer.main-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.slideshow_viewer.main-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.user_auth.app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.user_auth.app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.user_auth.app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.user_auth.app-messages.json diff --git a/kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.user_profile.app-messages.json b/kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.user_profile.app-messages.json similarity index 100% rename from kolibri/locale/nyn/LC_MESSAGES/kolibri.plugins.user_profile.app-messages.json rename to kolibri/locale/ny/LC_MESSAGES/kolibri.plugins.user_profile.app-messages.json diff --git a/kolibri/utils/i18n.py b/kolibri/utils/i18n.py index 3c572bfa331..817cb51b318 100644 --- a/kolibri/utils/i18n.py +++ b/kolibri/utils/i18n.py @@ -67,7 +67,7 @@ def _get_language_info(): "ko", "mr", "my", - "nyn", + "ny", "pt-br", "pt-mz", "sw-tz", diff --git a/packages/kolibri-tools/lib/i18n/intl_code_gen.js b/packages/kolibri-tools/lib/i18n/intl_code_gen.js index c7c5facc367..f260b463952 100644 --- a/packages/kolibri-tools/lib/i18n/intl_code_gen.js +++ b/packages/kolibri-tools/lib/i18n/intl_code_gen.js @@ -12,7 +12,7 @@ module.exports = function(outputDir, languageInfoPath) { * This is an auto-generated file, any manual edits will be overridden. * * To regenerate, see instructions here: - * https://kolibri-dev.readthedocs.io/en/develop/references/i18n.html + * https://kolibri-dev.readthedocs.io/en/develop/i18n.html * * This file was generated by kolibri-tools i18n-code-gen * diff --git a/packages/kolibri-tools/lib/i18n/locale-data/intl/ny.js b/packages/kolibri-tools/lib/i18n/locale-data/intl/ny.js new file mode 100644 index 00000000000..a58f7ca4e57 --- /dev/null +++ b/packages/kolibri-tools/lib/i18n/locale-data/intl/ny.js @@ -0,0 +1,213 @@ +// Generated using Intl.js with updated cldr data +// eslint-disable-next-line no-undef +IntlPolyfill.__addLocaleData({ + locale: 'ny', + date: { + ca: ['gregory', 'generic'], + hourNo0: true, + hour12: true, + formats: { + short: '{1} {0}', + medium: '{1} {0}', + full: '{1} {0}', + long: '{1} {0}', + availableFormats: { + Bh: 'h B', + Bhm: 'h:mm B', + Bhms: 'h:mm:ss B', + d: 'd', + E: 'ccc', + EBhm: 'E h:mm B', + EBhms: 'E h:mm:ss B', + Ed: 'd, E', + Ehm: 'E h:mm a', + EHm: 'E HH:mm', + Ehms: 'E h:mm:ss a', + EHms: 'E HH:mm:ss', + Gy: 'G y', + GyMd: 'GGGGG y-MM-dd', + GyMMM: 'G y MMM', + GyMMMd: 'G y MMM d', + GyMMMEd: 'G y MMM d, E', + h: 'h a', + H: 'HH', + hm: 'h:mm a', + Hm: 'HH:mm', + hms: 'h:mm:ss a', + Hms: 'HH:mm:ss', + hmsv: 'h:mm:ss a v', + Hmsv: 'HH:mm:ss v', + hmv: 'h:mm a v', + Hmv: 'HH:mm v', + M: 'L', + Md: 'MM-dd', + MEd: 'MM-dd, E', + MMM: 'LLL', + MMMd: 'MMM d', + MMMEd: 'MMM d, E', + MMMMd: 'MMMM d', + 'MMMMW-count-other': "'week' W 'of' MMMM", + ms: 'mm:ss', + y: 'y', + yM: 'y-MM', + yMd: 'y-MM-dd', + yMEd: 'y-MM-dd, E', + yMMM: 'y MMM', + yMMMd: 'y MMM d', + yMMMEd: 'y MMM d, E', + yMMMM: 'y MMMM', + yQQQ: 'y QQQ', + yQQQQ: 'y QQQQ', + 'yw-count-other': "'week' w 'of' Y", + }, + dateFormats: { + yMMMMEEEEd: 'y MMMM d, EEEE', + yMMMMd: 'y MMMM d', + yMMMd: 'y MMM d', + yMd: 'y-MM-dd', + }, + timeFormats: { + hmmsszzzz: 'h:mm:ss a zzzz', + hmsz: 'h:mm:ss a z', + hms: 'h:mm:ss a', + hm: 'h:mm a', + }, + }, + calendars: { + generic: { + months: { + narrow: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], + short: [ + 'M01', + 'M02', + 'M03', + 'M04', + 'M05', + 'M06', + 'M07', + 'M08', + 'M09', + 'M10', + 'M11', + 'M12', + ], + long: [ + 'M01', + 'M02', + 'M03', + 'M04', + 'M05', + 'M06', + 'M07', + 'M08', + 'M09', + 'M10', + 'M11', + 'M12', + ], + }, + days: { + narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], + short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + long: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + }, + eras: { narrow: ['ERA0', 'ERA1'], short: ['ERA0', 'ERA1'], long: ['ERA0', 'ERA1'] }, + dayPeriods: { am: 'AM', pm: 'PM' }, + }, + gregory: { + months: { + narrow: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], + short: [ + 'M01', + 'M02', + 'M03', + 'M04', + 'M05', + 'M06', + 'M07', + 'M08', + 'M09', + 'M10', + 'M11', + 'M12', + ], + long: [ + 'M01', + 'M02', + 'M03', + 'M04', + 'M05', + 'M06', + 'M07', + 'M08', + 'M09', + 'M10', + 'M11', + 'M12', + ], + }, + days: { + narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], + short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + long: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + }, + eras: { + narrow: ['BCE', 'CE', 'BCE', 'CE'], + short: ['BCE', 'CE', 'BCE', 'CE'], + long: ['BCE', 'CE', 'BCE', 'CE'], + }, + dayPeriods: { am: 'AM', pm: 'PM' }, + }, + }, + }, + number: { + nu: ['latn'], + patterns: { + decimal: { positivePattern: '{number}', negativePattern: '{minusSign}{number}' }, + currency: { + positivePattern: '{currency} {number}', + negativePattern: '{minusSign}{currency} {number}', + }, + percent: { + positivePattern: '{number}{percentSign}', + negativePattern: '{minusSign}{number}{percentSign}', + }, + }, + symbols: { + latn: { + decimal: '.', + group: ',', + nan: 'NaN', + plusSign: '+', + minusSign: '-', + percentSign: '%', + infinity: '∞', + }, + }, + currencies: { + AUD: 'A$', + BRL: 'R$', + CAD: 'CA$', + CNY: 'CN¥', + EUR: '€', + GBP: '£', + HKD: 'HK$', + ILS: '₪', + INR: '₹', + JPY: 'JP¥', + KRW: '₩', + MXN: 'MX$', + NZD: 'NZ$', + PHP: '₱', + TWD: 'NT$', + USD: 'US$', + VND: '₫', + XAF: 'FCFA', + XCD: 'EC$', + XCG: 'Cg.', + XOF: 'F CFA', + XPF: 'CFPF', + XXX: '¤', + }, + }, +}); From 4b5de0c575660def1b56c3d43bf418f883e657de Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Thu, 9 May 2024 12:58:38 -0700 Subject: [PATCH 2/3] Fix copies modal display. --- kolibri/plugins/learn/assets/src/views/CopiesModal.vue | 6 +++--- .../learn/assets/src/views/HomePage/ContinueLearning.vue | 2 +- .../assets/src/views/LibraryPage/ResumableContentGrid.vue | 2 +- .../plugins/learn/assets/src/views/SearchResultsGrid.vue | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kolibri/plugins/learn/assets/src/views/CopiesModal.vue b/kolibri/plugins/learn/assets/src/views/CopiesModal.vue index 09189952994..4395e6ef734 100644 --- a/kolibri/plugins/learn/assets/src/views/CopiesModal.vue +++ b/kolibri/plugins/learn/assets/src/views/CopiesModal.vue @@ -1,7 +1,7 @@