Skip to content

Commit

Permalink
Merge pull request #3530 from atjn/test-locale
Browse files Browse the repository at this point in the history
Add a test locale
  • Loading branch information
gfwilliams authored Sep 30, 2024
2 parents 6f8871c + 8367a86 commit e87a715
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
23 changes: 23 additions & 0 deletions apps/locale/locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,4 +753,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(","),
},
};
2 changes: 1 addition & 1 deletion apps/locale/sanitycheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions bin/sanitycheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down

0 comments on commit e87a715

Please sign in to comment.