discourse/app/assets/javascripts/discourse-common/addon/helpers/i18n.js
Robin Ward eab560fe2a
DEV: import I18n instead of global usage (#9768)
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
2020-05-13 16:23:41 -04:00

8 lines
257 B
JavaScript

import I18n from "I18n";
import { registerUnbound } from "discourse-common/lib/helpers";
registerUnbound("i18n", (key, params) => I18n.t(key, params));
registerUnbound("i18n-yes-no", (value, params) =>
I18n.t(value ? "yes_value" : "no_value", params)
);