New config.json variable to set the ACS default language#12863
New config.json variable to set the ACS default language#12863hsato03 wants to merge 1 commit intoapache:mainfrom
Conversation
|
@blueorangutan package |
|
@hsato03 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12863 +/- ##
============================================
- Coverage 18.02% 18.02% -0.01%
+ Complexity 16450 16448 -2
============================================
Files 5968 5968
Lines 537086 537090 +4
Branches 65961 65961
============================================
- Hits 96819 96797 -22
- Misses 429347 429373 +26
Partials 10920 10920
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17201 |
There was a problem hiding this comment.
Pull request overview
Adds a defaultLanguage setting to the UI configuration/theme flow so ACS can start in a configured locale by default (instead of always defaulting to English unless the user previously selected a locale).
Changes:
- Adds
defaultLanguagetoui/public/config.json(defaulten). - Propagates
defaultLanguagethrough GUI theme application and persists it intoLOCALEstorage. - Allows
defaultLanguagethrough the GUI theme JSON configuration API validation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ui/src/utils/guiTheme.js | Reads/sets defaultLanguage, writes LOCALE, and triggers locale loading during theme application. |
| ui/src/components/header/TranslationMenu.vue | Uses configured default language when LOCALE isn’t present. |
| ui/public/config.json | Adds new defaultLanguage config entry with default en. |
| server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java | Allows defaultLanguage in theme JSON primitive properties whitelist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| vueProps.$config.css = response?.css ?? null | ||
|
|
||
| vueProps.$localStorage.set('LOCALE', vueProps.$config.defaultLanguage) | ||
| loadLanguageAsync(vueProps.$config.defaultLanguage) |
There was a problem hiding this comment.
loadLanguageAsync(...) returns a Promise but is not awaited/handled here. Since main.js calls loadLanguageAsync() right after applyCustomGuiTheme, this can trigger duplicate concurrent locale fetches and a race on loadedLanguage/setLocaleMessage. Either await this Promise (and handle errors) or remove this call and rely on the main.js initialization load after setting LOCALE.
| loadLanguageAsync(vueProps.$config.defaultLanguage) |
Description
This PR aims to extend the
config.jsonfile with thedefaultLanguagevariable to allow the definition of the default language used by ACS.The default value of this variable is
en, meaning the default language will be English. To change the variable's value to other languages, it must be set with the language code of the desired language. For example, to set the default ACS language to Brazilian Portuguese, the variable should have the valuept_BR.Table of supported language codes
enhija_JPko_KRzh_CNarcade_DEesfr_FRit_IThunl_NLnb_NOplpt_BRru_RUel_GRTypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
config.jsonfile by setting thedefaultLanguagevariable to the valueja_JP. Then, I opened the ACS GUI in an incognito tab and verified that ACS was in Japanese;pt_BR. Then, I opened the ACS GUI in an incognito tab and verified that ACS was in Brazilian Portuguese;defaultLanguagevariable from theconfig.jsonfile. Then, I opened the ACS GUI in an incognito tab and verified that the English language was still used by default.How did you try to break this feature and the system with this change?