From 2a39506c7da9ef79671d4c21539313b6d49b1884 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 May 2020 16:39:49 +0200 Subject: [PATCH] Revert "Remove oc locale support" This reverts commit 8323c435c19ac6ed1656ee8436b175bce7bd2c82. --- client/angular.json | 7 ++ client/src/app/app.module.ts | 6 +- client/src/app/shared/locale/oc.ts | 104 +++++++++++++++++++++++++++++ scripts/build/client.sh | 3 + shared/models/i18n/i18n.ts | 1 + 5 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 client/src/app/shared/locale/oc.ts diff --git a/client/angular.json b/client/angular.json index a64596a08..44749d6b1 100644 --- a/client/angular.json +++ b/client/angular.json @@ -41,6 +41,10 @@ "translation": "src/locale/angular.es-ES.xlf", "baseHref": "/client/es-ES/" }, + "oc": { + "translation": "src/locale/angular.oc.xlf", + "baseHref": "/client/oc/" + }, "pt": { "translation": "src/locale/angular.pt-BR.xlf", "baseHref": "/client/pt-BR/" @@ -208,6 +212,9 @@ "es-ES": { "localize": [ "es" ] }, + "oc": { + "localize": [ "oc" ] + }, "pt-BR": { "localize": [ "pt" ] }, diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 6e74cd394..e61346dac 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -2,7 +2,6 @@ import { LOCALE_ID, NgModule, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular import { BrowserModule } from '@angular/platform-browser' import { ServerService } from '@app/core' import { ResetPasswordModule } from '@app/reset-password' - import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' import 'focus-visible' @@ -18,9 +17,12 @@ import { SearchModule } from '@app/search' import { WelcomeModalComponent } from '@app/modal/welcome-modal.component' import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component' import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/models' -import { APP_BASE_HREF } from '@angular/common' +import { APP_BASE_HREF, registerLocaleData } from '@angular/common' import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' import { CustomModalComponent } from '@app/modal/custom-modal.component' +import localeOc from '@app/shared/locale/oc' + +registerLocaleData(localeOc, 'oc') @NgModule({ bootstrap: [ AppComponent ], diff --git a/client/src/app/shared/locale/oc.ts b/client/src/app/shared/locale/oc.ts new file mode 100644 index 000000000..d3b2e8407 --- /dev/null +++ b/client/src/app/shared/locale/oc.ts @@ -0,0 +1,104 @@ + +// This code is not generated +// See angular/tools/gulp-tasks/cldr/extract.js + +const u: any = undefined + +function plural (n: number): number { + const i = Math.floor(Math.abs(n)) + if (i === 0 || i === 1) return 1 + return 5 +} + +export default [ + 'oc', + [['a. m.', 'p. m.'], u, u], + u, + [ + ['dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds'], ['dg.', 'dl.', 'dm.', 'dc.', 'dj.', 'dv.', 'ds.'], + ['dimenge', 'diluns', 'dimars', 'dimècres', 'dijòus', 'divendres', 'dissabte'], + ['dg.', 'dl.', 'dm.', 'dc.', 'dj.', 'dv.', 'ds.'] + ], + u, + [ + ['GN', 'FB', 'MÇ', 'AB', 'MA', 'JN', 'JL', 'AG', 'ST', 'OC', 'NV', 'DC'], + [ + 'de gen.', 'de febr.', 'de març', 'd’abr.', 'de mai', 'de junh', 'de jul.', 'd’ag.', + 'de set.', 'd’oct.', 'de nov.', 'de dec.' + ], + [ + 'de genièr', 'de febrièr', 'de març', 'd’abril', 'de mai', 'de junh', 'de julhet', + 'd’agòst', 'de setembre', 'd’octòbre', 'de novembre', 'de decembre' + ] + ], + [ + ['GN', 'FB', 'MÇ', 'AB', 'MA', 'JN', 'JL', 'AG', 'ST', 'OC', 'NV', 'DC'], + [ + 'gen.', 'febr.', 'març', 'abr.', 'mai', 'junh', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', + 'dec.' + ], + [ + 'genièr', 'febrièr', 'març', 'abril', 'mai', 'junh', 'julhet', 'agòst', 'setembre', 'octòbre', + 'novembre', 'decembre' + ] + ], + [['aC', 'dC'], u, ['abans Jèsus-Crist', 'aprèp Jèsus-Crist']], + 1, + [6, 0], + ['d/M/yy', 'd MMM y', 'd MMMM \'de\' y', 'EEEE, d MMMM \'de\' y'], + ['H:mm', 'H:mm:ss', 'H:mm:ss z', 'H:mm:ss zzzz'], + ['{1} {0}', '{1}, {0}', '{1} \'a\' \'les\' {0}', u], + [',', '.', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'], + ['#,##0.###', '#,##0%', '#,##0.00 ¤', '#E0'], + 'EUR', + '€', + 'euro', + { + 'ARS': ['$AR', '$'], + 'AUD': ['$AU', '$'], + 'BEF': ['FB'], + 'BMD': ['$BM', '$'], + 'BND': ['$BN', '$'], + 'BZD': ['$BZ', '$'], + 'CAD': ['$CA', '$'], + 'CLP': ['$CL', '$'], + 'CNY': [u, '¥'], + 'COP': ['$CO', '$'], + 'CYP': ['£CY'], + 'EGP': [u, '£E'], + 'FJD': ['$FJ', '$'], + 'FKP': ['£FK', '£'], + 'FRF': ['F'], + 'GBP': ['£GB', '£'], + 'GIP': ['£GI', '£'], + 'HKD': [u, '$'], + 'IEP': ['£IE'], + 'ILP': ['£IL'], + 'ITL': ['₤IT'], + 'JPY': [u, '¥'], + 'KMF': [u, 'FC'], + 'LBP': ['£LB', '£L'], + 'MTP': ['£MT'], + 'MXN': ['$MX', '$'], + 'NAD': ['$NA', '$'], + 'NIO': [u, '$C'], + 'NZD': ['$NZ', '$'], + 'RHD': ['$RH'], + 'RON': [u, 'L'], + 'RWF': [u, 'FR'], + 'SBD': ['$SB', '$'], + 'SGD': ['$SG', '$'], + 'SRD': ['$SR', '$'], + 'TOP': [u, '$T'], + 'TTD': ['$TT', '$'], + 'TWD': [u, 'NT$'], + 'USD': ['$US', '$'], + 'UYU': ['$UY', '$'], + 'WST': ['$WS'], + 'XCD': [u, '$'], + 'XPF': ['FCFP'], + 'ZMW': [u, 'Kw'] + }, + 'ltr', + plural +] diff --git a/scripts/build/client.sh b/scripts/build/client.sh index 05c40b5bb..e7475f56c 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh @@ -53,6 +53,8 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then languages=(["el"]="el-GR") elif [ ! -z ${1+x} ] && [ "$1" == "--light-es" ]; then languages=(["es"]="es-ES") + elif [ ! -z ${1+x} ] && [ "$1" == "--light-oc" ]; then + languages=(["oc"]="oc") elif [ ! -z ${1+x} ] && [ "$1" == "--light-pt" ]; then languages=(["pt"]="pt-BR") elif [ ! -z ${1+x} ] && [ "$1" == "--light-pt-PT" ]; then @@ -93,6 +95,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then ["gd"]="gd" ["el"]="el-GR" ["es"]="es-ES" + ["oc"]="oc" ["pt"]="pt-BR" ["pt-PT"]="pt-PT" ["sv"]="sv-SE" diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts index 46940772f..9a5ea27dc 100644 --- a/shared/models/i18n/i18n.ts +++ b/shared/models/i18n/i18n.ts @@ -18,6 +18,7 @@ export const I18N_LOCALES = { 'it-IT': 'Italiano', 'ja-JP': '日本語', 'nl-NL': 'Nederlands', + 'oc': 'Occitan', 'pl-PL': 'Polski', 'pt-BR': 'Português (Brasil)', 'pt-PT': 'Português (Portugal)',