discourse/app/assets/javascripts/admin/addon/components/site-settings
Natalie Tay 235c673fe8
FEATURE: Localize language names (#33790)
This PR adds localized language names to settings. The language names
are localized in the frontend, not the backend, due to setting
initialization complexity.

This change affects these areas:
- `SiteSetting.available_locales` 
- this "setting" is a lookup table to get language names. use
`languageNameLookup` service to get the name for a locale
- it returns an object that looks like the following, then gets
re-hydrated with client localized values when initializing the
`siteSettingService` in the frontend.
  ```
  [
{"native_name":"اللغة العربية","value":"ar","name":"languages.ar.name"},
    ...
  ]  
  ```

- `SiteSetting.default_locale` 
- this is a single-value `enum` setting that has always been hardcoded.
This caused quite an issue as it is not initialized the same way as
other site settings in the yml file. It has always relied on reading
directly from a `names.yml` file to load native language names, thus
bypassing the need for I18n to be initialized from the backend. A new
locale_enum type has been introduced for this setting, and any future
settings.
  
- `SiteSetting.content_localization_supported_locales` - this is a
`enum_list` setting,
  - enum_list is introduced, leveraging both `list` and `enum`
  
- theme translations

- site texts

- Wizard's default_locale choices 
- it was set up from the backend using `LocaleSiteSetting.value`. This
proved problematic, as a Japanese user would be getting the locales in
English because the values are initialized using English even without
memoization
- therefore we're now initializing the choices in the frontend using
`available_locales` as defined above
  
- content localization meta data
- post language in the composer, localization composer, post history
modal, post language tooltip, language switcher



/t/151409
2025-07-29 11:48:45 +08:00
..
bool.gjs FIX: reset bool site setting not updating checkbox (#30999) 2025-01-27 10:53:27 -03:00
category-list.gjs FIX: Make cancel and reset buttons work for file_size_restriction settings (#28347) 2024-08-15 19:38:47 +03:00
category.gjs DEV: Round 1 converting admin site setting components to gjs (#30526) 2025-01-03 11:34:28 +10:00
color.gjs DEV: Round 1 converting admin site setting components to gjs (#30526) 2025-01-03 11:34:28 +10:00
compact-list.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
description.gjs DEV: Update htmlSafe imports (#26776) 2024-04-27 12:01:58 +02:00
emoji-list.gjs DEV: Round 1 converting admin site setting components to gjs (#30526) 2025-01-03 11:34:28 +10:00
enum.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
file-size-restriction.gjs FIX: Make cancel and reset buttons work for file_size_restriction settings (#28347) 2024-08-15 19:38:47 +03:00
file-types-list.gjs FIX: typo in translated title for audio file types list (#33830) 2025-07-24 13:58:55 -04:00
font-list.gjs UX: Use FontSelector for displaying font-related settings. (#30636) 2025-01-09 09:57:38 +11:00
group-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
host-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
integer.gjs FIX: Make cancel and reset buttons work for file_size_restriction settings (#28347) 2024-08-15 19:38:47 +03:00
list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
locale-enum.gjs FEATURE: Localize language names (#33790) 2025-07-29 11:48:45 +08:00
locale-list.gjs FEATURE: Localize language names (#33790) 2025-07-29 11:48:45 +08:00
named-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
secret-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
simple-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
string.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
tag-group-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
tag-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
upload.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
uploaded-image-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
url-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
value-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00