MCPcopy Create free account
hub / github.com/DenOfEquity/ersatzForge / processNode

Function processNode

javascript/localization.js:85–108  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

83}
84
85function processNode(node) {
86 if (node.nodeType == 3) {
87 processTextNode(node);
88 return;
89 }
90
91 if (node.title) {
92 let tl = getTranslation(node.title);
93 if (tl !== undefined) {
94 node.title = tl;
95 }
96 }
97
98 if (node.placeholder) {
99 let tl = getTranslation(node.placeholder);
100 if (tl !== undefined) {
101 node.placeholder = tl;
102 }
103 }
104
105 textNodesUnder(node).forEach(function(node) {
106 processTextNode(node);
107 });
108}
109
110function localizeWholePage() {
111 processNode(gradioApp());

Callers 2

localizeWholePageFunction · 0.85
localization.jsFile · 0.85

Calls 3

processTextNodeFunction · 0.85
getTranslationFunction · 0.85
textNodesUnderFunction · 0.85

Tested by

no test coverage detected