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 generated class #140

Conversation

HenrikJannsen
Copy link
Contributor

@HenrikJannsen HenrikJannsen commented Dec 24, 2024

As after several more hours wasted to try to get the resources into iOS, I tried a different approach by creating a gradle task which converts the resources into a kotlin object.

It can be created by:
./gradlew generateResourceBundles
and will be located in build/generated/commonMain/network/bisq/mobile/i18n/GeneratedResourceBundles.kt
It should be triggered by the relevant build tasks.

The generated kotlin object though seems to not be accessible in the build as it fails with:

Caused by: java.io.FileNotFoundException: /Users/dev/StudioProjects/bisq-mobile/shared/domain/build/tmp/kotlin-classes/debug/network/bisq/mobile/i18n/GeneratedResourceBundles.class (No such file or directory)

Maybe @rodvar has an idea what causes that error and how to fix it.

If we get that build error resolved, we could either use that generated kotlin object for all deploy targets or only for iOS and use the normal resources for android.

There would be some headroom for optimisation to only use the selected language to avoid loading all language strings. The generated kotlin object is 1.6 MB, the resources about 2.2 MB.

@rodvar rodvar force-pushed the i18n-support-with-generated-class branch from 909b7e9 to 032d484 Compare December 28, 2024 05:49
@rodvar
Copy link
Collaborator

rodvar commented Dec 28, 2024

rebased against main

@rodvar
Copy link
Collaborator

rodvar commented Dec 28, 2024

gave a time-boxed effort but couldn't get it to work on iOS yet. needs more work.

@rodvar
Copy link
Collaborator

rodvar commented Jan 7, 2025

this is also trying to solve #137

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