1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Re-factor the L10n-implementations to use lowercase language-codes internally

This is consistent with the implementation used in the (now removed) webL10n-library, and by only using lowercase language-codes internally in the `L10n`-implementations we should avoid future issues e.g. when users manually set the `locale`-option (in the default viewer).
This commit is contained in:
Jonas Jenwald 2023-11-13 13:55:01 +01:00
parent 44cde3ccca
commit 1f9533bae9
6 changed files with 27 additions and 21 deletions

View file

@ -896,10 +896,11 @@ gulp.task("locale", function () {
locales.push(locale);
if (checkFile(dirPath + "/viewer.ftl")) {
viewerOutput[locale] = `${locale}/viewer.ftl`;
// The L10n-implementations, in the viewer, use lowercase language-codes
// internally.
viewerOutput[locale.toLowerCase()] = `${locale}/viewer.ftl`;
}
}
const glob = locales.length === 1 ? locales[0] : `{${locales.join(",")}}`;
return merge([