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:
Jarek Radosz
2023-07-20 20:45:40 +02:00
committed by GitHub
parent 238d71bcad
commit 9bbd5efbec
21 changed files with 174 additions and 162 deletions

View File

@ -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));
}