This commit is contained in:
2020-06-24 21:47:49 +00:00
parent 272b620f61
commit 9a04fc35e0

View File

@@ -27,16 +27,21 @@ export default {
});
} else {
//gather up the keys that are cached and fetch the latest and then replace them
console.log("STUB:translation:updateCache");
let needIt = [];
window.$gz._.forOwn(window.$gz.store.state.translationText, function(
cacheval,
cachekey
) {
needIt.push(cachekey);
});
//fetch these keys
let transData = await window.$gz.api.upsert("translation/subset", needIt);
transData.data.forEach(function commitFetchedTranslationItemToStore(
item
) {
window.$gz.store.commit("setTranslationText", item);
});
}
//if editedTranslation is empty that means just fetch the existing ones freshly again
//refetch all the keys and update
//if edited translation is not empty that means update cache from the editedTranslation if it's the same one as is currently in use
//check if current translation is the same one passed in
//if it is, update all the currently cached local keys with the copy passed
//TODO: call this from translation editor if same (add fetch for in use translation for editor initform) and from local settings on change of translation
},
get(key) {
//no translation for Wiki