UX: Remove confusing fallback locale warning (#18096)

This commit is contained in:
Gerhard Schlager 2022-08-26 01:22:04 +02:00 committed by GitHub
parent 9d9c48fcb8
commit ec93bca99e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 23 deletions

View File

@ -42,21 +42,11 @@ export default Controller.extend({
}
},
@discourseComputed("locale")
showFallbackLocaleWarning() {
return (
this.siteSettings.allow_user_locale &&
this.siteSettings.set_locale_from_accept_language_header &&
this.fallbackLocaleFullName
);
},
actions: {
edit(siteText) {
this.transitionToRoute("adminSiteText.edit", siteText.get("id"), {
queryParams: {
locale: this.locale,
localeFullName: this.availableLocales[this.locale],
},
});
},

View File

@ -1,39 +1,60 @@
<div class="search-area">
<p>{{i18n "admin.site_text.description"}}</p>
<TextField @value={{this.q}} @placeholderKey="admin.site_text.search" @class="no-blur site-text-search" @autofocus="true" @key-up={{action "search"}} />
<TextField
@value={{this.q}}
@placeholderKey="admin.site_text.search"
@class="no-blur site-text-search"
@autofocus="true"
@key-up={{action "search"}}
/>
<div class="reseed">
<DButton @action={{route-action "showReseedModal"}} @class="btn-default" @label="admin.reseed.action.label" @title="admin.reseed.action.title" @icon="sync" />
<DButton
@action={{route-action "showReseedModal"}}
@class="btn-default"
@label="admin.reseed.action.label"
@title="admin.reseed.action.title"
@icon="sync"
/>
</div>
<p class="filter-options">
<div class="locale">
<label>{{i18n "admin.site_text.locale"}}</label>
<ComboBox @valueProperty="value" @content={{this.availableLocales}} @value={{this.locale}} @onChange={{action "updateLocale"}} @class="locale-search" @options={{hash filterable=true}} />
<ComboBox
@valueProperty="value"
@content={{this.availableLocales}}
@value={{this.locale}}
@onChange={{action "updateLocale"}}
@class="locale-search"
@options={{hash filterable=true}}
/>
</div>
<label>
<Input @type="checkbox" @checked={{this.overridden}} {{on "click" (action "toggleOverridden")}} />
<Input
@type="checkbox"
@checked={{this.overridden}}
{{on "click" (action "toggleOverridden")}}
/>
{{i18n "admin.site_text.show_overriden"}}
</label>
</p>
</div>
<ConditionalLoadingSpinner @condition={{this.searching}}>
{{#if this.showFallbackLocaleWarning}}
<div class="alert alert-info">
{{d-icon "exclamation-circle"}}
{{i18n "admin.site_text.fallback_locale_warning" fallback=this.fallbackLocaleFullName}}
</div>
{{/if}}
{{#if this.siteTexts.extras.recommended}}
<p><b>{{i18n "admin.site_text.recommended"}}</b></p>
{{/if}}
{{#each this.siteTexts as |siteText|}}
<SiteTextSummary @siteText={{siteText}} @editAction={{action "edit"}} @term={{this.q}} @searchRegex={{this.siteTexts.extras.regex}} />
<SiteTextSummary
@siteText={{siteText}}
@editAction={{action "edit"}}
@term={{this.q}}
@searchRegex={{this.siteTexts.extras.regex}}
/>
{{/each}}
{{#if this.siteTexts.extras.has_more}}

View File

@ -5522,7 +5522,6 @@ en:
recommended: "We recommend customizing the following text to suit your needs:"
show_overriden: "Only show overridden"
locale: "Language:"
fallback_locale_warning: "You are editing a language based on %{fallback}. Users who choose %{fallback} as their interface language won't see your changes."
more_than_50_results: "There are more than 50 results. Please refine your search."
settings: # used by theme and site settings