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

I18n support with statically generated class #145

Conversation

HenrikJannsen
Copy link
Contributor

@HenrikJannsen HenrikJannsen commented Jan 7, 2025

Superseded #140 and #134

As using the generated file in the build directory still does not work on iOS, this PR writes the files into the source directory. Further it adds UTF8 support and splits the bundles per language as otherwise the build fails as the file got too large.

@rodvar
Copy link
Collaborator

rodvar commented Jan 7, 2025

solution for #137

@rodvar rodvar force-pushed the i18n-support-with-statically-generated-class branch from fce6afd to 83fc291 Compare January 7, 2025 22:32
@rodvar
Copy link
Collaborator

rodvar commented Jan 7, 2025

rebased to main

Copy link
Collaborator

@rodvar rodvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant work @HenrikJannsen
Just deleted some commented code, merging now.

@@ -36,15 +37,15 @@ class ClientApplicationBootstrapFacade(
if (!trustedNodeService.isConnected()) {
try {
trustedNodeService.connect()
setState("Connected to Trusted Node")
setState("bootstrap.connectedToTrustedNode".i18n())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nostrbuddha for the MVP we are ok as we commited support for english-only initially, but right after we need to use this technique "KEY_STRING".i18n() for every text used in the app after this PR gets merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All mobile only strings should end up in the mobile resource file, and then the generate task should be run to update the kotlin files (only engl. if no translations added). We should stick to a good naming convention to keep the strings well organized with first token as general section (e.g. offerbook) then the subsection (e.g. createOffer),... and we use camelCase in bisq 2 so we should stick to same style. Basically it should follow as close as possible the bisq 2 strings convention and existing keys (e.g. if we only add one new string to an area where bisq2 strings are used we should use the same key prefixes.

@rodvar rodvar merged commit be6bc51 into bisq-network:main Jan 7, 2025
1 check passed
@HenrikJannsen
Copy link
Contributor Author

Brilliant work @HenrikJannsen Just deleted some commented code, merging now.

I left it as one day when we spend more time on it to get it working with files generated to the build directory or even to use the property files in resources directly those gradle snippets might be useful. But its in the history anyway...

@rodvar
Copy link
Collaborator

rodvar commented Jan 8, 2025

Brilliant work @HenrikJannsen Just deleted some commented code, merging now.

I left it as one day when we spend more time on it to get it working with files generated to the build directory or even to use the property files in resources directly those gradle snippets might be useful. But its in the history anyway...

haha yeah indeed that code sounded familiar.. its ok - we are good for now with this improvement

@HenrikJannsen HenrikJannsen deleted the i18n-support-with-statically-generated-class branch January 8, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants