feat(docs): allow edit any locale file (#2099)

This commit is contained in:
Joaquín Sánchez 2023-05-15 14:35:43 +02:00 committed by GitHub
parent f635e0a634
commit 69f9004917
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 13 deletions

View file

@ -9,12 +9,12 @@ interface LocaleObjectData extends LocaleObject {
pluralRule?: PluralizationRule
}
const countryLocaleVariants: Record<string, LocaleObjectData[]> = {
export const countryLocaleVariants: Record<string, (LocaleObjectData & { country?: boolean }) []> = {
ar: [
// ar.json contains ar-EG translations
// { code: 'ar-DZ', name: 'Arabic (Algeria)' },
// { code: 'ar-BH', name: 'Arabic (Bahrain)' },
{ code: 'ar-EG', name: 'العربية' },
{ country: true, code: 'ar-EG', name: 'العربية' },
// { code: 'ar-EG', name: 'Arabic (Egypt)' },
// { code: 'ar-IQ', name: 'Arabic (Iraq)' },
// { code: 'ar-JO', name: 'Arabic (Jordan)' },
@ -32,13 +32,13 @@ const countryLocaleVariants: Record<string, LocaleObjectData[]> = {
],
en: [
// en.json contains en-US translations
{ code: 'en-US', name: 'English (US)' },
{ country: true, code: 'en-US', name: 'English (US)' },
{ code: 'en-GB', name: 'English (UK)' },
],
ca: [
// ca.json contains ca-ES translations
// { code: 'ca-AD', name: 'Català (Andorra)' },
{ code: 'ca-ES', name: 'Català (Espanya)' },
{ country: true, code: 'ca-ES', name: 'Català (Espanya)' },
{ code: 'ca-valencia', name: 'Català (valencià)' },
// { code: 'ca-FR', name: 'Català (França)' },
// { code: 'ca-IT', name: 'Català (Itàlia)' },
@ -52,7 +52,7 @@ const countryLocaleVariants: Record<string, LocaleObjectData[]> = {
// { code: 'es-CR', name: 'Español (Costa Rica)' },
// { code: 'es-DO', name: 'Español (República Dominicana)' },
// { code: 'es-EC', name: 'Español (Ecuador)' },
{ code: 'es-ES', name: 'Español (España)' },
{ country: true, code: 'es-ES', name: 'Español (España)' },
// TODO: Support es-419, if we include spanish country variants remove also fix on utils/language.ts module
{ code: 'es-419', name: 'Español (Latinoamérica)' },
// { code: 'es-GT', name: 'Español (Guatemala)' },
@ -69,7 +69,7 @@ const countryLocaleVariants: Record<string, LocaleObjectData[]> = {
],
pt: [
// pt.json contains pt-PT translations
{ code: 'pt-PT', name: 'Português (Portugal)' },
{ country: true, code: 'pt-PT', name: 'Português (Portugal)' },
{ code: 'pt-BR', name: 'Português (Brasil)' },
],
}