MCPcopy
hub / github.com/Velocidex/velociraptor / T

Function T

gui/velociraptor/src/components/i8n/i8n.jsx:42–63  ·  view source on GitHub ↗
(item, ...args)

Source from the content-addressed store, hash-verified

40};
41
42function T(item, ...args) {
43 let lang = (window.globals && window.globals.lang) || "en";
44 let d = dict(item);
45
46 if(_.isUndefined(d)) {
47 if (debug && lang !== "en") {
48 let x = window.globals.dict || {};
49 x[item] = item;
50 window.globals["dict"] = x;
51 console.log(lang, ": No translation for ", item);
52 }
53
54 // If there is no specific translation in the target language
55 // we use the English one, and failing that the name of the
56 // item directly.
57 d = English[item] || item;
58 }
59 if (typeof d === 'function') {
60 return d.call(null, ...args);
61 }
62 return d;
63};
64
65export default T;

Callers 15

renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
ShowGlobalMessagesClass · 0.85
renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85

Calls 1

dictFunction · 0.85

Tested by

no test coverage detected