Skip to content
Snippets Groups Projects
Unverified Commit eca94e12 authored by Sloan Sparger's avatar Sloan Sparger Committed by GitHub
Browse files

Fix `c` method of `ttag` not showing strings as tagged in debug mode #42965

parent 4be9fcf4
No related branches found
No related tags found
No related merge requests found
......@@ -36,9 +36,12 @@ const obfuscateString = (original, string) => {
export function enableTranslatedStringReplacement() {
const c3po = require("ttag");
const _t = c3po.t;
const _jt = c3po.jt;
const _ngettext = c3po.ngettext;
const _c = c3po.c;
c3po.t = (...args) => {
return obfuscateString(args[0][0], _t(...args));
};
......@@ -49,6 +52,13 @@ export function enableTranslatedStringReplacement() {
const elements = _jt(...args);
return <span style={{ backgroundColor: "currentcolor" }}>{elements}</span>;
};
c3po.c = (...args) => {
return Object.assign(_c(...args), {
t: c3po.t,
jt: c3po.jt,
ngettext: c3po.ngettext,
});
};
}
if (HAS_LOCAL_STORAGE && window.localStorage["metabase-i18n-debug"]) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment