Closed jcfranco closed 2 years ago
More information is required to proceed with this issue:
This issue will be automatically closed in five days if the information is not provided. Thanks for your understanding.
Is it expected that "zh" or "ZH" doesn't work but "pt" does work? Normally the language codes for those languages are more specific like "zh-ch" or "pt-br".
Looking at the implementation, it is expected. pt
works because we have the fallback available. @raje9276 In this case, should we always provide the fallback alongside the specific locale values or just the latter?
FWIW, pt-PT.json
is available, but pt-BR.json
is missing.
Installed and assigned for verification.
FWIW, pt-PT.json is available, but pt-BR.json is missing.
We have a language code pt-BR. So what's the plan for that one? Currently it shows in English.
zh-cn, zh-hk, zh-tw work now. zh doesn't, but that seems to be expected.
We have a language code pt-BR. So what's the plan for that one? Currently it shows in English.
I think we should do 2 things:
pt-BR
I'll create issues for these.
Actually, the base language lookup worked before. We didn't have a test for this case, so this ended up introducing a regression. I'll create an issue for this. cc @y0n4
Regression issue created.
Would we still need to add the pt-BR
locale file or would the existing pt
one suffice? cc @raje9276
Would we still need to add the pt-BR locale file or would the existing pt one suffice?
Olga says pt and pt-BR are the same for calendar.
@jcfranco pt is default for pt-PT (Portuguese Portugal) and it is different from pt-BR (Portuguese Brazilian). For Calendar the translations and formats are same but ESRI translation (resource files) are translated for pt-PT and pt-BR (different translations).
Did translation services team give you the translations?
@raje9276 Thanks for the info!
We have calendar resource files for pt.json
and pt-PT.json
, but none for pt-BR
. If I understood correctly, this isn't an issue for our calendar use case.
Long term, in terms of maintainability would you suggest:
pt-PT.json
and rely on pt.json
?pt-BR.json
even if it introduces another redundant file?All of the above are from the context of calendar.
@jcfranco you need 2 files pt-PT.json (pt.json) and pt-BR.json even though they are the same.
We need 2 files because there is a possibility that the translations may change as we add more strings or the current translations change as part of language update.
Got it. I'll submit a PR to add the missing file. Thanks again!
verified on beta.76
Actual Behavior
Stems from https://github.com/Esri/calcite-components/issues/3602#issuecomment-1011314264
When using
locale="zh-CN"
andlocale="zh-cn"
, only the former works as it matches its localization file (the former defaults to English).Note: this also applies to any supported locale with a language and region code
Expected Behavior
Using
locale="zh-CN"
orlocale="zh-cn"
should load thezh-CN.json
localization file.Reproduction Sample
https://codepen.io/jcfranco/pen/RwLqvme?editors=1000
Reproduction Steps
locale
values.Reproduction Version
@esri/calcite-components@1.0.0-beta.74
Relevant Info
Regression? Last working version:
@esri/calcite-components@1.0.0-VERSION
Per https://tools.ietf.org/search/bcp47#section-2.1.1, the value of
locale
should be case-insensitive:Source