-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add i18n support using java property files #134
Add i18n support using java property files #134
Conversation
Not working yet on ios. Processing of the file content need more work (manual linebreaks not detected yet) and testing.
FOr ios its still not working. several attempts are kept in commented out form...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for russian chars are not displated properly, probably our current font doesn't support cyrilic ?
I fixed a crash when switching languages, and also detected device language.
I've spent almost 3 hours trying it to get the resources in iOS and couldn't make it (tried from xcode as well).
I think let's parked this one for now and come back to it later down. the road when we are at the polishing stage for MVP?
shared/domain/src/commonMain/kotlin/network/bisq/mobile/i18n/I18nSupport.kt
Show resolved
Hide resolved
Yes, looks like a font issue. We need to have the files in UTF8 encoding then all languages should work.
Oh, seems to be not that easy. ChatGPT told me its doable and suggested various things but none worked out. |
probably good to give priority to this one #140 when we re-engage with this task |
Known issues/missing:
Loading if the resources takes a few ms. The size is about 260 kb per language.
We need to put the files in a sub directory in resources as otherwise it would conflict with the resources in node from the i18n jar.
We have for node the resources from the i18n jar already loaded, thus its wasteful to load it again. We could optimize that so that only android client loads the resources. In that case we could remove the mobile subdirectory as the conflict only happens in node. In fact for node we could just delegate the call to the bisq 2 API via Res.
It would be good if we could use only one location where we load the files for ios and android. Not sure if that is possible with the approach to load it from resources.
If not possible maybe a gradle task takes care that the ios files are always up to date with the android files. Or maybe someone has a better idea....
For the usage I used an extension function on String.
"myKey".i18n()
or"myKey".i18n(1, "BTC")
when arguments are passed.If that style is not welcome feel free to change it.
In Bisq2 the api is:
Res.get("myKey", 1, "BTC")