Skip to content

Commit

Permalink
Add l10n.toml for l10n testing with compare-locales, and automation t…
Browse files Browse the repository at this point in the history
…o run it.

On PRs, this just runs validation after the unit tests.
On master, this triggers another task in the graph w/out dependencies,
either in nor out.
We might want to replace check_translations.py eventually, but not yet.
  • Loading branch information
Pike authored and colintheshots committed Oct 18, 2018
1 parent 448df4b commit c68e8e1
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ tasks:
&& echo "--" > .adjust_token
&& python tools/l10n/check_locales.py
&& ./gradlew --no-daemon clean assembleFocusX86Debug assembleKlarX86Nightly assembleRelease detektCheck ktlint lintFocusX86Debug lintKlarX86Nightly pmd checkstyle spotbugs assembleFocusX86DebugAndroidTest testFocusX86DebugUnitTest testKlarX86NightlyUnitTest
&& pip install compare-locales>=4.0.1,<5.0
&& compare-locales --validate l10n.toml .
artifacts:
public:
type: directory
Expand Down
106 changes: 106 additions & 0 deletions l10n.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

basepath = "."

locales = [
"ace",
"af",
"am",
"an",
"anp",
"ar",
"ast",
"ay",
"az",
"bg",
"bn-BD",
"bn-IN",
"bo",
"bs",
"ca",
"cak",
"cs",
"cy",
"da",
"de",
"dsb",
"el",
"en-CA",
"eo",
"es-AR",
"es-CL",
"es-ES",
"es-MX",
"eu",
"fa",
"fi",
"fr",
"fy-NL",
"ga-IE",
"gl",
"gu-IN",
"he",
"hi-IN",
"hr",
"hsb",
"hu",
"hus",
"hy-AM",
"ia",
"id",
"it",
"ixl",
"ja",
"jv",
"ka",
"kab",
"kk",
"ko",
"kw",
"lo",
"lt",
"meh",
"mix",
"mr",
"ms",
"my",
"nb-NO",
"ne-NP",
"nl",
"nn-NO",
"oc",
"pa-IN",
"pai",
"pl",
"ppl",
"pt-BR",
"quc",
"quy",
"ro",
"ru",
"sk",
"sl",
"sq",
"sr",
"su",
"sv-SE",
"ta",
"te",
"th",
"tr",
"trs",
"tsz",
"tt",
"uk",
"ur",
"vi",
"wo",
"yua",
"zam",
"zh-CN",
"zh-TW",
]
[env]

[[paths]]
reference = "app/src/main/res/values/strings.xml"
l10n = "{l10n_base}/app/src/main/res/values-{android_locale}/strings.xml"
12 changes: 12 additions & 0 deletions tools/taskcluster/schedule-master-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ def generate_code_quality_task(buildTaskId):
dependencies = [ buildTaskId ])


def generate_compare_locales_task():
return taskcluster.slugId(), generate_task(
name = "(Focus for Android) String validation",
description = "Check Focus/Klar for Android for errors in en-US and l10n.",
command = ('pip install compare-locales>=4.0.1,<5.0'
' && compare-locales --validate l10n.toml .'
' && compare-locales l10n.toml .'))


def generate_webview_X86_ui_test_task(dependencies):
return taskcluster.slugId(), generate_task(
name = "(Focus for Android) UI tests - Webview X86",
Expand Down Expand Up @@ -189,6 +198,9 @@ def generate_task(name, description, command, dependencies = [], artifacts = {},
codeQualityTaskId, codeQualityTask = generate_code_quality_task(buildTaskId)
schedule_task(queue, codeQualityTaskId, codeQualityTask)

clTaskId, clTask = generate_compare_locales_task()
schedule_task(queue, clTaskId, clTask)

uiWebviewARMTestTaskId, uiWebviewARMTestTask = generate_webview_ARM_ui_test_task([unitTestTaskId, codeQualityTaskId])
schedule_task(queue, uiWebviewARMTestTaskId, uiWebviewARMTestTask)

Expand Down

0 comments on commit c68e8e1

Please sign in to comment.