discourse/app/assets/javascripts/admin/addon/components
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
..
admin-config-area-cards DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-config-areas DEV: Deprecate "discourse/helpers/get-url" (#33870) 2025-07-27 12:27:31 +02:00
form-template UX: Update some delete confirmation dialogs (#33018) 2025-06-02 09:14:58 -04:00
modal Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
report-filters DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
schema-setting FIX: fix label and description not working in type objects for site settings (#32868) 2025-05-23 11:39:19 -03:00
site-settings FEATURE: Localize language names (#33790) 2025-07-29 11:48:45 +08:00
svg FEATURE: redesigned admin color palette index layout (#33628) 2025-07-22 11:52:39 -04:00
admin-area-settings.gjs FEATURE: Bulk save site settings (#32013) 2025-04-01 09:39:19 +08:00
admin-backups-actions.gjs DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
admin-backups-logs.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-badges-award.gjs DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-badges-index.gjs DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-badges-list.gjs DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-badges-show.gjs FIX: Badge grouping for system badges should be editable (#33504) 2025-07-08 10:56:47 +08:00
admin-badges.gjs DEV: allows to pass @currentWhen to NavItem (#32825) 2025-05-21 09:31:47 +02:00
admin-config-area-card-section.gjs UX: card section toggle (#31644) 2025-03-06 10:31:29 +11:00
admin-config-area-card.gjs DEV: Move AdminConfigAreaCard back to the admin bundle (#33429) 2025-07-02 14:03:33 +03:00
admin-config-area-empty-list.gjs FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
admin-editable-field.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-embedding-host-form.gjs UX: admins embedding page follows admin ux guideline (#30122) 2025-01-06 13:01:08 +11:00
admin-filter-controls.gjs FEATURE: Add reusable AdminFilterControls component, apply to plugins and reports (#33706) 2025-07-24 16:55:33 -04:00
admin-filtered-site-settings.gjs DEV: Move SiteSettingFilter to admin namespace (#32458) 2025-04-25 14:13:49 +08:00
admin-flag-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
admin-flags-form.gjs DEV: Simplify "Admin Flags Page" system test to reduce runtime duration (#32431) 2025-04-24 15:47:22 +08:00
admin-font-chooser.gjs UX: split admin logo and fonts to separate pages (#32700) 2025-05-14 14:02:34 +08:00
admin-fonts-form.gjs DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-form-row.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
admin-logo-form.gjs DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-nav.gjs DEV: Sort imports 2023-10-10 21:46:54 +01:00
admin-notice.gjs DEV: add btn-default classes to buttons using default styling (#31039) 2025-01-28 15:40:34 -05:00
admin-penalty-history.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-penalty-post-action.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
admin-penalty-reason.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
admin-penalty-similar-users.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
admin-permalink-form.gjs FIX: Make permalink search work even when there're 100+ permalinks (#31354) 2025-02-16 00:19:16 +03:00
admin-plugin-config-area.gjs DEV: Remove plugin sidebar rendering fallback (#31012) 2025-01-28 09:42:24 +08:00
admin-plugin-config-page.gjs DEV: Remove plugin sidebar rendering fallback (#31012) 2025-01-28 09:42:24 +08:00
admin-plugins-list-item.gjs UX: show all preinstalled plugins and label them as such (#33681) 2025-07-17 15:11:52 -04:00
admin-plugins-list.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
admin-report-chart.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-report-counters.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-inline-table.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-radar.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-report-stacked-chart.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-report-stacked-line-chart.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
admin-report-storage-stats.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
admin-report-table-cell.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
admin-report-table-header.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
admin-report-table-row.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report-table.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
admin-report.gjs DEV: Move admin only constants into admin bundle (#32141) 2025-04-03 14:28:36 +08:00
admin-reports.gjs FEATURE: Add reusable AdminFilterControls component, apply to plugins and reports (#33706) 2025-07-24 16:55:33 -04:00
admin-search-filters.gjs FEATURE: Initial version of experimental admin search (#31299) 2025-02-21 11:59:24 +10:00
admin-search.gjs FIX: Wait for data before showing admin search results (#32796) 2025-05-19 14:14:29 +08:00
admin-section-landing-item.gjs DEV: Change dIcon to icon in components (#31083) 2025-01-31 10:55:31 +10:00
admin-section-landing-wrapper.gjs DEV: Add a skeleton for section landing page & items (#28477) 2024-10-02 12:19:38 +10:00
admin-site-settings-changes-banner.gjs FEATURE: Theme-owned color palettes (#32795) 2025-06-04 07:47:58 +03:00
admin-site-settings-filter-controls.gjs Revert "UX: Hide inner site settings sidebar if admin sidebar enabled (#31047)" (#31267) 2025-02-11 12:47:40 +10:00
admin-theme-editor.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
admin-user-exports-table.gjs DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
admin-user-field-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
admin-user-fields-form.gjs PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823) 2025-05-22 12:07:22 +01:00
admin-watched-word.gjs A11Y: add aria-hidden="true" wrapper around zero width space character in buttons (#31544) 2025-02-27 12:51:10 -05:00
api-key-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
bulk-user-delete-confirmation.gjs DEV: revert admin users list change (#32723) 2025-05-15 09:48:01 +02:00
changes-banner.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
chart.gjs FIX: Rerender Chart component if config changes (#29955) 2024-11-28 13:37:59 +10:00
color-input.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
color-palette-editor.gjs FEATURE: system themes (#32681) 2025-06-13 10:36:31 +08:00
color-palette-list-item.gjs FEATURE: redesigned admin color palette index layout (#33628) 2025-07-22 11:52:39 -04:00
dashboard-new-feature-item.gjs DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
dashboard-new-features.gjs FEATURE: Allow showing only experiments on "What's new?" (#31347) 2025-02-14 13:30:37 +10:00
dashboard-period-selector.gjs DEV: add btn-default classes to buttons using default styling (#31039) 2025-01-28 15:40:34 -05:00
dashboard-problems.gjs DEV: Move discourse-common/ helpers to discourse/ (#30728) 2025-01-13 09:36:11 +00:00
email-styles-editor.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
embeddable-host.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
emoji-uploader.gjs DEV: Remove final {{action uses and enable lint rule (#32348) 2025-04-25 21:25:06 +01:00
emoji-value-list.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
file-size-input.gjs DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
flag-user.gjs DEV: Deprecate boundDate and formatAge helpers (#32672) 2025-05-10 20:08:08 +02:00
highlighted-code.gjs DEV: Convert highlighted-code to glimmer/gjs (#28914) 2024-09-17 13:49:35 +02:00
images-uploader.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
inline-edit-checkbox.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
install-theme-item.gjs DEV: Change dIcon to icon in components (#31083) 2025-01-31 10:55:31 +10:00
ip-lookup.gjs DEV: revert admin users list change (#32723) 2025-05-15 09:48:01 +02:00
moderation-history-item.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
permalink-form.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
plugin-commit-hash.gjs DEV: Convert various components to gjs (#26782) 2024-04-30 16:44:49 +02:00
screened-ip-address-form.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
secret-value-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
setting-validation-message.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
silence-details.gjs Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
simple-list.gjs DEV: [gjs-codemod] apply codemod 2025-04-02 13:44:15 +01:00
site-customization-change-details.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
site-customization-change-field.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
site-setting.gjs FEATURE: Localize language names (#33790) 2025-07-29 11:48:45 +08:00
site-text-summary.gjs DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00
staff-actions.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
tags-uploader.gjs DEV: Move discourse-common/ helpers to discourse/ (#30728) 2025-01-13 09:36:11 +00:00
theme-setting-editor.js FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
theme-setting-relatives-selector.js FIX: Make theme relative selectors save (#33344) 2025-06-25 14:06:13 +03:00
theme-settings-editor.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
theme-site-setting-editor.gjs FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
theme-site-settings.gjs FEATURE: Themeable site settings (#32233) 2025-07-16 11:00:21 +10:00
theme-translation.js FIX: Hide secret admin fields by default (#33255) 2025-06-24 13:36:59 -05:00
theme-upload-add.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
themes-grid-card.gjs UX: reload the page when the default theme is changed (#33217) 2025-06-17 08:58:27 +08:00
themes-grid-placeholder.gjs UX: Add more info to theme cards (#32334) 2025-05-05 09:06:05 +08:00
themes-grid.gjs DEV: Move AdminConfigAreaCard back to the admin bundle (#33429) 2025-07-02 14:03:33 +03:00
themes-list-item.gjs PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823) 2025-05-22 12:07:22 +01:00
uppy-backup-uploader.gjs DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
value-list.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
version-checks.gjs PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823) 2025-05-22 12:07:22 +01:00
watched-word-form.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
watched-word-uploader.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
webhook-event-chooser.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
webhook-event.gjs DEV: [gjs-codemod] convert admin files to gjs 2025-03-25 16:59:21 +00:00
webhook-events.gjs DEV: refactor load-more component to glimmer and use intersection observer (#32285) 2025-04-28 10:22:35 +08:00
webhook-item.gjs DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
webhook-status.gjs UX: Apply admin table to webhooks (#30317) 2024-12-17 08:52:29 -07:00