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
When the user's locale is set to 'am' or 'ml', the code in the load_directory function of resource_loader.py incorrectly assumes that a corresponding localization file exists. This leads to an i18n.loaders.loader.I18nFileLoadError. The error message displayed is:
I18nFileLoadError: error getting data from resources/translations/de.yaml: ml not defined
This issue arises due to improper file existence checking. The locales 'ml' and 'am' are mistakenly identified as existing because they are substrings of the ".yaml" file extension. This results in the erroneous assumption that the relevant localization files are present.
Suggested Fix
A more robust method of checking for the existence of localization files should be implemented to prevent substring matches within file extensions.
The text was updated successfully, but these errors were encountered:
I met similar issue too.
load_directory function choose the wrong translation file due to wrong translation filename is substring matched first.
In my case, when locale is 'zh', it should load 'zh.json', but it loads 'zh-tw.json' instead.
Body
Hello,
When the user's locale is set to 'am' or 'ml', the code in the
load_directory
function ofresource_loader.py
incorrectly assumes that a corresponding localization file exists. This leads to ani18n.loaders.loader.I18nFileLoadError
. The error message displayed is:This issue arises due to improper file existence checking. The locales 'ml' and 'am' are mistakenly identified as existing because they are substrings of the ".yaml" file extension. This results in the erroneous assumption that the relevant localization files are present.
Suggested Fix
A more robust method of checking for the existence of localization files should be implemented to prevent substring matches within file extensions.
The text was updated successfully, but these errors were encountered: