Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When the *.ini file path contains opt,report error #1

Closed
ependi-buzz opened this issue Apr 30, 2020 · 2 comments
Closed

[BUG] When the *.ini file path contains opt,report error #1

ependi-buzz opened this issue Apr 30, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ependi-buzz
Copy link

iris v12.1.8
go 1.14.2
locales not found in /opt/etc/rcacs/locales/en-US.ini

@ependi-buzz
Copy link
Author

app.I18n.Load("/home/rcacs/locales/*.ini", "zh-CN", "en-US")
report error locales not found in /opt/etc/rcacs/locales/en-US.ini

kataras added a commit to kataras/iris that referenced this issue Apr 30, 2020
@kataras
Copy link
Owner

kataras commented Apr 30, 2020

Hello @lovezyy495926,

This is caused because opt and even etc are considering as a valid language code based on: https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.

This i18n package tries to match a folder with a language code automatically, e.g. /en-US/example.ini filenames as well, e.g. en-US.example.ini.

It's fixed, with reversing the order of matching, it now starts the search from the end instead of the start of the path.

Thank you for the bug report.

@kataras kataras added the bug Something isn't working label Apr 30, 2020
kataras added a commit to kataras/iris that referenced this issue Jul 26, 2020
Former-commit-id: 12b75f1e54ebf3d7f78a09b8d5594859a344422d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants