discourse/app/assets/javascripts/admin/addon/components/theme-translation.js
Chris Alberti 61033eed4c
FIX: Hide secret admin fields by default (#33255)
Fixed the refs to the `setting` argument and refactored more of the component over to glimmer style, added test against regression
2025-06-24 13:36:59 -05:00

26 lines
631 B
JavaScript

import { ajax } from "discourse/lib/ajax";
import getURL from "discourse/lib/get-url";
import SiteSettingComponent from "./site-setting";
export default class ThemeTranslation extends SiteSettingComponent {
type = "string";
get setting() {
return this.args.translation;
}
get settingName() {
return this.args.translation.key;
}
_save() {
const translations = {
[this.args.translation.key]: this.buffered.get("value"),
};
return ajax(getURL(`/admin/themes/${this.args.model.id}`), {
type: "PUT",
data: { theme: { translations, locale: this.args.model.locale } },
});
}
}