1
0
Fork 0

Move release locales to a separate config file.

We should leave l10n.toml untouched unless the l10n team wants to
change it.
master
Kainalu Hagiwara 2020-07-21 09:10:22 -07:00
parent b898965426
commit 6b8eca0700
3 changed files with 98 additions and 99 deletions

View File

@ -8,7 +8,7 @@ from __future__ import absolute_import, print_function, unicode_literals
import re import re
OPEN_LOCALES = "release_locales = [" OPEN_LOCALES = "locales = ["
CLOSE_LOCALES = "]" CLOSE_LOCALES = "]"
def trim_to_locale(str): def trim_to_locale(str):
@ -18,11 +18,11 @@ def trim_to_locale(str):
return match.group(1) return match.group(1)
# This file is a dumb parser that converts values from '/l10n.toml' to be easily consumed from # This file is a dumb parser that converts values from '/l10n-release.toml' to be easily
# Python. # consumed from Python.
# #
# 'l10n.toml' has a very simple structure, and it is reasonable to believe that this (very basic) # 'l10n-release.toml' has a very simple structure, and it is reasonable to believe that this
# algorithm will continue to work as it is changed. # (very basic) algorithm will continue to work as it is changed.
# #
# Alternatives to custom parsing that were considered: # Alternatives to custom parsing that were considered:
# - Using standard library module --- none exists to parse TOML # - Using standard library module --- none exists to parse TOML
@ -31,7 +31,7 @@ def trim_to_locale(str):
# - Vendoring a TOML module --- large amount of code given the use case. Introduces a security # - Vendoring a TOML module --- large amount of code given the use case. Introduces a security
# risk # risk
def get_release_locales(): def get_release_locales():
with open(r"l10n.toml") as f: with open(r"l10n-release.toml") as f:
file = f.read().splitlines() file = f.read().splitlines()
locales_opened = False locales_opened = False
@ -42,7 +42,7 @@ def get_release_locales():
for line in file: for line in file:
if line == OPEN_LOCALES: if line == OPEN_LOCALES:
locales_opened = True locales_opened = True
elif line == CLOSE_LOCALES and locales_opened == True: elif line == CLOSE_LOCALES:
locales_closed = True locales_closed = True
break break
elif locales_opened: elif locales_opened:

91
l10n-release.toml 100644
View File

@ -0,0 +1,91 @@
# Locales that should be present in release builds
# Locales that are at 70% or higher completion on https://pontoon.mozilla.org/projects/android-l10n/
# should be in this list
locales = [
"an",
"ar",
"ast",
"az",
"be",
"bn",
"br",
"bs",
"ca",
"cak",
"co",
"cs",
"cy",
"da",
"de",
"dsb",
"el",
"en-CA",
"en-GB",
"eo",
"es",
"es-AR",
"es-CL",
"es-ES",
"es-MX",
"et",
"eu",
"fa",
"ff",
"fi",
"fr",
"fy-NL",
"ga-IE",
"gd",
"gn",
"gu-IN",
"he",
"hi-IN",
"hr",
"hsb",
"hu",
"hy-AM",
"id",
"is",
"it",
"ja",
"ka",
"kab",
"kk",
"kn",
"ko",
"lij",
"lo",
"lt",
"ml",
"mr",
"my",
"nb-NO",
"nl",
"nn-NO",
"oc",
"pa-IN",
"pl",
"pt-BR",
"pt-PT",
"rm",
"ro",
"ru",
"sk",
"sl",
"sq",
"sr",
"su",
"sv-SE",
"ta",
"te",
"th",
"tr",
"trs",
"uk",
"ur",
"vec",
"vi",
"zh-CN",
"zh-TW",
]

View File

@ -1,7 +1,6 @@
basepath = "." basepath = "."
# Locales that should be present in non-release builds and on Pontoon
locales = [ locales = [
"an", "an",
"ar", "ar",
@ -95,97 +94,6 @@ locales = [
"zh-TW", "zh-TW",
] ]
# Locales that should be present in release builds
# Locales that are at 70% or higher completion on https://pontoon.mozilla.org/projects/android-l10n/
# should be in this list
release_locales = [
"an",
"ar",
"ast",
"az",
"be",
"bn",
"br",
"bs",
"ca",
"cak",
"co",
"cs",
"cy",
"da",
"de",
"dsb",
"el",
"en-CA",
"en-GB",
"eo",
"es",
"es-AR",
"es-CL",
"es-ES",
"es-MX",
"et",
"eu",
"fa",
"ff",
"fi",
"fr",
"fy-NL",
"ga-IE",
"gd",
"gn",
"gu-IN",
"he",
"hi-IN",
"hr",
"hsb",
"hu",
"hy-AM",
"id",
"is",
"it",
"ja",
"ka",
"kab",
"kk",
"kn",
"ko",
"lij",
"lo",
"lt",
"ml",
"mr",
"my",
"nb-NO",
"nl",
"nn-NO",
"oc",
"pa-IN",
"pl",
"pt-BR",
"pt-PT",
"rm",
"ro",
"ru",
"sk",
"sl",
"sq",
"sr",
"su",
"sv-SE",
"ta",
"te",
"th",
"tr",
"trs",
"uk",
"ur",
"vec",
"vi",
"zh-CN",
"zh-TW",
]
# Expose the following branches to localization # Expose the following branches to localization
# Changes to this list should be announced to the l10n team ahead of time. # Changes to this list should be announced to the l10n team ahead of time.
branches = [ branches = [