mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 12:05:50 +08:00
DEV: Convert helpers into plain functions (#22385)
Since 0fa92529ed, helpers can now be implemented as plain JS functions. This makes them much easier to write/read, and also makes them usable in `<template>` gjs files.
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import I18n from "I18n";
|
||||
import { htmlHelper } from "discourse-common/lib/helpers";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
|
||||
export default htmlHelper((key, params) => I18n.t(key, params.hash));
|
||||
export default function boundI18n(key, options) {
|
||||
return htmlSafe(I18n.t(key, options));
|
||||
}
|
||||
|
Reference in New Issue
Block a user