Refactors `TrustLevel` and moves translations from server to client Additional changes: * "staff" and "admin" wasn't translatable in site settings * it replaces a concatenated string with a translation * uses translation for trust levels in users_by_trust_level report * adds a DB migration to rename keys of translation overrides affected by this commit
23 lines
401 B
JavaScript
23 lines
401 B
JavaScript
import { computed } from "@ember/object";
|
|
import I18n from "I18n";
|
|
|
|
export default class TrustLevel {
|
|
constructor(id, key) {
|
|
this.id = id;
|
|
this._key = key;
|
|
}
|
|
|
|
@computed
|
|
get name() {
|
|
return I18n.t(`trust_levels.names.${this._key}`);
|
|
}
|
|
|
|
@computed
|
|
get detailedName() {
|
|
return I18n.t("trust_levels.detailed_name", {
|
|
level: this.id,
|
|
name: this.name,
|
|
});
|
|
}
|
|
}
|