mirror of
https://github.com/discourse/discourse.git
synced 2024-12-22 20:03:54 +08:00
a16faa27cd
When searching for site texts for admin using the english version of the text, previously we would show the english version in the results _even if_ there was another locale translated version available when a locale was selected from the dropdown. This commit adds a "Only show results in selected locale" checkbox option which will instead make it so the results shown are in the target locale, making it easier for translators to tell when there is actually translations vs. missing tranlsations.
29 lines
842 B
JavaScript
29 lines
842 B
JavaScript
import Route from "@ember/routing/route";
|
|
import { service } from "@ember/service";
|
|
import { disableImplicitInjections } from "discourse/lib/implicit-injections";
|
|
|
|
@disableImplicitInjections
|
|
export default class AdminSiteTextIndexRoute extends Route {
|
|
@service siteSettings;
|
|
@service store;
|
|
|
|
queryParams = {
|
|
q: { replace: true },
|
|
overridden: { replace: true },
|
|
outdated: { replace: true },
|
|
untranslated: { replace: true },
|
|
locale: { replace: true },
|
|
};
|
|
|
|
model(params) {
|
|
return this.store.find("site-text", {
|
|
q: params.q,
|
|
overridden: params.overridden ?? false,
|
|
outdated: params.outdated ?? false,
|
|
untranslated: params.untranslated ?? false,
|
|
locale: params.locale ?? this.siteSettings.default_locale,
|
|
only_selected_locale: params.onlySelectedLocale ?? false,
|
|
});
|
|
}
|
|
}
|