diff --git a/package.json b/package.json index 92248b43..78670bdf 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.12.5", + "version": "4.12.6", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/i18n.js b/src/i18n.js index 3fdc8d0f..27477e56 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -192,7 +192,14 @@ export class TranslationManager extends Module { } getKeys() { - return deep_copy(Array.from(this.captured.values())); + const out = []; + for(const entry of this.captured.values()) { + const thing = deep_copy(entry); + thing.translation = this._.phrases.get(thing.key) || thing.phrase; + out.push(thing); + } + + return out; } requestKeys() { diff --git a/src/modules/translation_ui/components/i18n-entry.vue b/src/modules/translation_ui/components/i18n-entry.vue index 263f8ed2..ad60ff13 100644 --- a/src/modules/translation_ui/components/i18n-entry.vue +++ b/src/modules/translation_ui/components/i18n-entry.vue @@ -45,7 +45,7 @@ export default { data() { return { - value: this.entry.phrase, + value: this.entry.translation, valid: true, error: null } diff --git a/src/modules/translation_ui/components/translation-ui.vue b/src/modules/translation_ui/components/translation-ui.vue index df04a8ec..6a6610a6 100644 --- a/src/modules/translation_ui/components/translation-ui.vue +++ b/src/modules/translation_ui/components/translation-ui.vue @@ -64,7 +64,7 @@ v-for="phrase in filtered" :key="phrase.key" :entry="phrase" - @update="update(phrase.key, $event)" + @update="update(phrase, $event)" /> @@ -96,6 +96,9 @@ export default { if ( entry.phrase.toLowerCase().includes(this.query) ) return true; + if ( entry.translation.toLowerCase().includes(this.query) ) + return true; + return false; }) } @@ -140,8 +143,9 @@ export default { }); }, - update(key, phrase) { - this.updatePhrase(key, phrase); + update(entry, phrase) { + entry.translation = phrase; + this.updatePhrase(entry.key, phrase); }, updateDrag() { diff --git a/src/modules/translation_ui/index.js b/src/modules/translation_ui/index.js index eb8a9b95..435e009c 100644 --- a/src/modules/translation_ui/index.js +++ b/src/modules/translation_ui/index.js @@ -92,7 +92,7 @@ export default class TranslationUI extends Module { getData() { return { - phrases: this.i18n.getKeys(), + phrases: [], query: '', faded: false,