Skip to content

Can language strings be normalized across platforms? #57

@thehans

Description

@thehans

I am using this package to reduce code bloat in my app which is being packaged for Linux targets (from a Linux dev machine).

The README shows sample code with: afterCopy: [setLanguages(['en', 'en_GB'])]
This is apparently the correct way to specify languages on Mac, but it fails on Linux, because the filenames use a hyphen instead of underscore.

I was attempting to only include US english. So I had afterCopy: [setLanguages(['en_US'])]
This results in a confusing error where attempting to open DevTools fails with an error on the console:

[333085:0522/153303.240453:ERROR:CONSOLE(1)] "Uncaught RangeError: Incorrect locale information provided", source: devtools://devtools/bundled/models/trace/helpers/helpers.js (1)

Changing to afterCopy: [setLanguages(['en-US'])] fixed it for me.

For reference, here is the full listing of ./out/APPNAME-linux-x64/locales/ on my Linux Mint 21.1 (when I omit the afterCopy: command)

af.pak
am.pak
ar.pak
bg.pak
bn.pak
ca.pak
cs.pak
da.pak
de.pak
el.pak
en-GB.pak
en-US.pak
es-419.pak
es.pak
et.pak
fa.pak
fil.pak
fi.pak
fr.pak
gu.pak
he.pak
hi.pak
hr.pak
hu.pak
id.pak
it.pak
ja.pak
kn.pak
ko.pak
lt.pak
lv.pak
ml.pak
mr.pak
ms.pak
nb.pak
nl.pak
pl.pak
pt-BR.pak
pt-PT.pak
ro.pak
ru.pak
sk.pak
sl.pak
sr.pak
sv.pak
sw.pak
ta.pak
te.pak
th.pak
tr.pak
uk.pak
ur.pak
vi.pak
zh-CN.pak
zh-TW.pak

It would be nice if there were a common way to specify languages that worked across platforms.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions