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

l10n (localization) support #8

Merged
merged 3 commits into from
Apr 16, 2024
Merged

l10n (localization) support #8

merged 3 commits into from
Apr 16, 2024

Conversation

tobozo
Copy link
Contributor

@tobozo tobozo commented Apr 15, 2024

  • most UI text labels have been moved to properties file in the resources/l10n folder.
  • no language selector, just inherits Arduino IDE language or system default locale
  • UTF8-safe, tested with different alphabets and symbol systems

Obviously English is the default language; I've added French as a first example, maybe ChatGPT could take care of more languages?

@serifpersia
Copy link
Owner

Yeah GPT should be good option for translating into at least few main languages, unless someone hops in and contributes most correct translation from English, mainly the about panel has bulk of the text. I will look into this PR tomorrow and provide some translation but they won't be as good as native speaker. I could do Serbian without issues.

@tobozo
Copy link
Contributor Author

tobozo commented Apr 15, 2024

the about panel may need a couple of changes to make sure it keeps a consistant size across languages, currently it's using html breaks to prevent horizontal expansion and the text has to be split to simulate word wrap

ideally the right side of the about panel should have a fixed width and not use htlm breaks at all

@serifpersia
Copy link
Owner

serifpersia commented Apr 16, 2024

I couldn't build seems the script is broken and its not this PR its latest upstream commit have no idea what I changed for it to break... Oh I think i don't have java 8 jdk I think that has to do something with it haha.

@tobozo
Copy link
Contributor Author

tobozo commented Apr 16, 2024

took me a couple hours to figure out I was using jdk11 too 🤣

if the CI didn't complain then it's probably a local problem

@serifpersia
Copy link
Owner

serifpersia commented Apr 16, 2024

took me a couple hours to figure out I was using jdk11 too 🤣

if the CI didn't complain then it's probably a local problem

I will add check to do nothing or at least display something is wrong with java jdk for build_specific scripts. Your cl scripts should work just fine my scripts for building specific tool was not able to run bc of missing jdk it just did some folder creation and extraction but no jar. Once i installed jdk 8 it worked just fine.

@tobozo
Copy link
Contributor Author

tobozo commented Apr 16, 2024

btw I'm not sure languages not listed in that file can be used in the plugin (arduino version), it seems the Arduino IDE overwrites the default system locale with its own default supported locale

@serifpersia
Copy link
Owner

I tried to do serbian display language in my windows 11 and set system default in arduino ide but it changed to english but it did work for french. I assume it won't work if the language doesn't exist in that list in arduino preferences?

@tobozo
Copy link
Contributor Author

tobozo commented Apr 16, 2024

it should work with platformio version though, try this:

LANG=sr java -cp /path/to/ESP32PartitionTool.jar com.platformio.ESP32PartitionToolStandalone

@serifpersia
Copy link
Owner

Oh so platformio version also has support for localization as well it has auto detect system language right? If so I could add my language properties file as well if thats the case.

@tobozo
Copy link
Contributor Author

tobozo commented Apr 16, 2024

this is how the locale is extracted for both platformio and arduino:

Locale.getDefault().getLanguage()

Arduino IDE probably overrides this with English when the language isn't in the translations list

@serifpersia
Copy link
Owner

serifpersia commented Apr 16, 2024

No worries I verified at least for Arduino IDE it detects the language and does load the properties file correctly. If you need anything else to add feel free this is fine for merge.

@tobozo
Copy link
Contributor Author

tobozo commented Apr 16, 2024

I'll probably make the aboutPanel localizable later in a separate PR, I have nothing to add to this PR

no peer review for the translations -> I hope the AI didn't hallucinate too much 🤣

@serifpersia
Copy link
Owner

I'll probably make the aboutPanel localizable later in a separate PR, I have nothing to add to this PR

no peer review for the translations -> I hope the AI didn't hallucinate too much 🤣

I worry if the text label will fit in the ui hahah. I checked for my language it was semi correct not very specific terms used but it wasn't off by a lot.

@serifpersia serifpersia merged commit b78deec into serifpersia:main Apr 16, 2024
2 checks passed
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