From c8200c506732fb6a9f77c81143e5fac147ae6842 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 7 Aug 2024 18:57:14 +0200 Subject: [PATCH 1/2] Add a test locale --- apps/locale/locales.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/apps/locale/locales.js b/apps/locale/locales.js index 8fbf428daf..66bbe22fce 100644 --- a/apps/locale/locales.js +++ b/apps/locale/locales.js @@ -755,4 +755,27 @@ var locales = { day: "ראשון,שני,שלישי,רביעי,חמישי,שישי,שבת", trans: { yes: "כן", Yes: "כן", no: "לא", No: "לא", ok: "אישור", on: "פעיל", off: "כבוי" } }*/ + /** + * These test strings are designed to be as wide and tall as real locale strings can be. + * All apps should be able to display them properly, to ensure that they work with all locales. + * To make the strings as long as possible, wide characters like "w" and "m" is used, + * and to make them taller, "k" and "g" are used together. + */ + "test": { + lang: "test", + icon: "🐛", + notes: "Produces the longest possible output. Useful for testing.", + decimal_point: ",", + thousands_sep: ",", + speed: "km/h", + distance: { 0: "kmi", 1: "kmi" }, + temperature: "°C", + ampm: { 0: "dop", 1: "odp" }, + timePattern: { 0: "%HHh%MM:%SS", 1: "%HHh%MM" }, + datePattern: { 0: "%b, %d, %Y", 1: "%d. %m %Y" }, + abmonth: Array(12).fill("mgmk").join(","), + month: Array(12).fill("megmmaskuum").join(","), + abday: Array(7).fill("mgmk").join(","), + day: Array(7).fill("megmavammkkom").join(","), + }, }; From 8367a865c4db5aaa2c19b0ccd3b785c2c5460ce2 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 22 Sep 2024 08:52:42 +0200 Subject: [PATCH 2/2] Fix linter --- apps/locale/sanitycheck.js | 2 +- bin/sanitycheck.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/locale/sanitycheck.js b/apps/locale/sanitycheck.js index 192fa338aa..06c7ad3d68 100644 --- a/apps/locale/sanitycheck.js +++ b/apps/locale/sanitycheck.js @@ -91,7 +91,7 @@ function checkLocale(locale, {speedUnits, distanceUnits, codePages, CODEPAGE_CON const speeds = Object.keys(speedUnits); const distances = Object.keys(distanceUnits); - checkLength("lang", locale.lang, 5, undefined); + checkLength("lang", locale.lang, 4, undefined); checkLength("decimal point", locale.decimal_point, 1, 1); checkLength("thousands separator", locale.thousands_sep, 1, 1); checkLength("speed", locale.speed, 2, 4); diff --git a/bin/sanitycheck.js b/bin/sanitycheck.js index eceb0d4918..82856b639d 100755 --- a/bin/sanitycheck.js +++ b/bin/sanitycheck.js @@ -109,7 +109,9 @@ var KNOWN_WARNINGS = [ `In locale it_CH, long time format might not work in some apps if it is not "%HH:%MM:%SS"`, `In locale it_IT, long time format might not work in some apps if it is not "%HH:%MM:%SS"`, `In locale wae_CH, long time format might not work in some apps if it is not "%HH:%MM:%SS"`, + `In locale test, long time format might not work in some apps if it is not "%HH:%MM:%SS"`, `In locale wae_CH, short time format might not work in some apps if it is not "%HH:%MM"`, + `In locale test, short time format might not work in some apps if it is not "%HH:%MM"`, ]; var apps = [];