social-app
social-app copied to clipboard
Problem of languagePrefs (BCP 47 and ISO 639-1)
Describe the bug
If change the app display language before login, the AppLanguage
code will be added to languagePrefs.contentLanguages
array, instead of add LANGUAGES
AppLanguage
is manage by lingui
, and it use BCP 47
which can contain region code (for example zh-TW
)
LANGUAGES
is set of ISO 639
(in this case it will only have zh)
That will make (for this example) zh-TW
stuck in contentLanguages
and settings in UI will neither show nor be able to removing it.
And
if (!preferredLangsCode2.length || preferredLangsCode2.length === 0) {
return slices
}
this code will take no effect in src\lib\api\feed-manip.ts
, since there is always one string in array (for this example zh-TW
)
The only possible way to remove (for this example) zh-TW
is to reset all settings
Details
- Platform: Web are tested, other platform would also be affected