2019-11-06 02:43:49 +08:00
|
|
|
import Helper from "@ember/component/helper";
|
2024-11-20 04:45:18 +08:00
|
|
|
import { i18n } from "discourse-i18n";
|
2019-11-06 02:43:49 +08:00
|
|
|
|
2017-10-18 01:31:45 +08:00
|
|
|
function postActionTitle([id, nameKey]) {
|
2024-11-20 04:45:18 +08:00
|
|
|
let title = i18n(`admin.flags.short_names.${nameKey}`, {
|
2017-10-18 01:31:45 +08:00
|
|
|
defaultValue: null,
|
|
|
|
});
|
|
|
|
|
|
|
|
// TODO: We can remove this once other translations have been updated
|
|
|
|
if (!title) {
|
2024-11-20 04:45:18 +08:00
|
|
|
return i18n(`admin.flags.summary.action_type_${id}`, { count: 1 });
|
2017-10-18 01:31:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return title;
|
|
|
|
}
|
|
|
|
|
2019-11-06 02:43:49 +08:00
|
|
|
export default Helper.helper(postActionTitle);
|