Add i18n support using java property files #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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")