discourse/app/assets/javascripts/admin/addon/components/theme-translation.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
623 B
JavaScript
Raw Normal View History

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