You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I would like to report a wrong behaviour in the library.
The documentation for loadCurrentLanguageAsync states the following:
Note that for a key contained in both fr and fr_FR, the one in fr_FR will be used
Which later, is wrong because those two segments do the opposite:
fileLocales[languageTag]?.let {
fileList.addAll(it)
}
// Add the complete tags after the language tag so that if there is the same key// The complete tag value will override the basic one
fileLocales[completeTag]?.let {
fileList.addAll(it)
}
So when iterating on localeTexts (parsed version of fileLocales, in the same order they were added) using firstOrNull, you hit data from languageTag before hitting data from completeTag.
If languageTag is added before completeTag, then firstOrNull should be replaced by lastOrNull.
Or locales have to be loaded in the opposite order (which seems better, because firstOrNull is on average quicker to return than lastOrNull)
The text was updated successfully, but these errors were encountered:
Hello!
I would like to report a wrong behaviour in the library.
The documentation for
loadCurrentLanguageAsync
states the following:Which later, is wrong because those two segments do the opposite:
And this (same problem also in
pluralForKey
):So when iterating on
localeTexts
(parsed version offileLocales
, in the same order they were added) usingfirstOrNull
, you hit data fromlanguageTag
before hitting data fromcompleteTag
.If
languageTag
is added beforecompleteTag
, thenfirstOrNull
should be replaced bylastOrNull
.Or locales have to be loaded in the opposite order (which seems better, because
firstOrNull
is on average quicker to return thanlastOrNull
)The text was updated successfully, but these errors were encountered: