arozos icon indicating copy to clipboard operation
arozos copied to clipboard

[Optimization] Translations

Open GT-610 opened this issue 1 year ago • 3 comments

Translation Issues & Code Improvements

While working on localization efforts, I've identified multiple systemic issues affecting translation workflows. These should be addressed to improve internationalization support:

1. Hardcoded UI Strings

Multiple components use hardcoded English text instead of localization keys (e.g. in viewer.properties files):

// Code snippet from src/mod/auth/oauth2/github.go
req.Header.Set("Accept", "application/vnd.github.v3+json") // Should be configurable

2. Auto detect language should be deafult

When not logged in and set, default language configuration should be "browser language" instead of fallback, but currently it seems that it uses fallback instead of any locales.

For example, My browser language is Simplified Chinese, and I've made some translation commits in Login page. Still, when loaded in InPrivate mode (simulate a new user), it still shows the content in the HTML.

Image

3. "System Settings" WebApp translations not working

I've made translations in "System Settings" page src\web\SystemAO\info\overview.html using , but still it doesn't work. This might be a bug and need to be tracked. BTW same methods work on translations of 404 page and 401 page.

Image

Long-Term Commitment

First, let me thank @tobychui and all ArozOS contributors for this great project. I'm using ArozOS on an internally shared AIO machine for a long time.

Together with community efforts, I will provide updated translations and help test fixes. I hope the translations will be improved soon.

GT-610 avatar Mar 08 '25 11:03 GT-610

Here's my fork. There might be some translation mistakes or code errors.

I'll create a PR after most of translations are completed, so now I just put my fork link here.

GT-610 avatar Mar 08 '25 11:03 GT-610

@GT-610 Love your work!

The reason for so many hardcoded string in this system was due to the fact that during the system is developed back in 2018 (as I recall), I didn't consider about localization at all. This help with the development speed but now it is a hassle to make it support multi-languages.

If you are ready, please open a PR directly. I will review them during my free-time.

tobychui avatar Mar 09 '25 09:03 tobychui

Thanks! I've made some progress for the translation issue:

  • [x] #183 finished.
  • [ ] Korean language locale is broken. I'm still investigating into it.
  • [x] #184 . I've rewritten applocale.js with modern JS features, and it runs much faster after rewriting applocale.js.

GT-610 avatar Mar 21 '25 09:03 GT-610