Move release locales to a separate config file.

We should leave l10n.toml untouched unless the l10n team wants to
change it.
releases/v80.0.0
Kainalu Hagiwara 4 years ago
parent b898965426
commit 6b8eca0700

@ -8,7 +8,7 @@ from __future__ import absolute_import, print_function, unicode_literals
import re
OPEN_LOCALES = "release_locales = ["
OPEN_LOCALES = "locales = ["
CLOSE_LOCALES = "]"
def trim_to_locale(str):
@ -18,11 +18,11 @@ def trim_to_locale(str):
return match.group(1)
# This file is a dumb parser that converts values from '/l10n.toml' to be easily consumed from
# Python.
# This file is a dumb parser that converts values from '/l10n-release.toml' to be easily
# consumed from Python.
#
# 'l10n.toml' has a very simple structure, and it is reasonable to believe that this (very basic)
# algorithm will continue to work as it is changed.
# 'l10n-release.toml' has a very simple structure, and it is reasonable to believe that this
# (very basic) algorithm will continue to work as it is changed.
#
# Alternatives to custom parsing that were considered:
# - 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
# risk
def get_release_locales():
with open(r"l10n.toml") as f:
with open(r"l10n-release.toml") as f:
file = f.read().splitlines()
locales_opened = False
@ -42,7 +42,7 @@ def get_release_locales():
for line in file:
if line == OPEN_LOCALES:
locales_opened = True
elif line == CLOSE_LOCALES and locales_opened == True:
elif line == CLOSE_LOCALES:
locales_closed = True
break
elif locales_opened:

@ -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",
]

@ -1,7 +1,6 @@
basepath = "."
# Locales that should be present in non-release builds and on Pontoon
locales = [
"an",
"ar",
@ -95,97 +94,6 @@ locales = [
"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
# Changes to this list should be announced to the l10n team ahead of time.
branches = [

Loading…
Cancel
Save