diff options
author | Aarni Koskela <akx@iki.fi> | 2023-05-13 16:22:39 +0000 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2023-05-13 16:22:39 +0000 |
commit | cd6990c243e926672ff84e7db1ca34ae60015486 (patch) | |
tree | af79c3a7bdb2917d0fb483949c7533ce76260bba /javascript | |
parent | 1f57b948b78df872c5a8a1c6e6c7e3c35e06f969 (diff) | |
download | stable-diffusion-webui-gfx803-cd6990c243e926672ff84e7db1ca34ae60015486.tar.gz stable-diffusion-webui-gfx803-cd6990c243e926672ff84e7db1ca34ae60015486.tar.bz2 stable-diffusion-webui-gfx803-cd6990c243e926672ff84e7db1ca34ae60015486.zip |
Make dump translations work again
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/localization.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/javascript/localization.js b/javascript/localization.js index d0bdfc16..86e5ca67 100644 --- a/javascript/localization.js +++ b/javascript/localization.js @@ -109,18 +109,23 @@ function processNode(node){ }
function dumpTranslations(){
+ if(!hasLocalization()) {
+ // If we don't have any localization,
+ // we will not have traversed the app to find
+ // original_lines, so do that now.
+ processNode(gradioApp());
+ }
var dumped = {}
if (localization.rtl) {
- dumped.rtl = true
+ dumped.rtl = true;
}
- Object.keys(original_lines).forEach(function(text){
- if(dumped[text] !== undefined) return
-
- dumped[text] = localization[text] || text
- })
+ for (const text in original_lines) {
+ if(dumped[text] !== undefined) continue;
+ dumped[text] = localization[text] || text;
+ }
- return dumped
+ return dumped;
}
function download_localization() {
|