Skip to content

Commit

Permalink
fix for localized name remove on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
sijumoncy committed Jan 5, 2024
1 parent 926534d commit 239222c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions renderer/src/core/burrito/createTranslationSB.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ call,
update,
) => {
logger.debug('createTranslationSB.js', 'In createTranslationSB');
const localizedNames = {};
let localizedNames = {};
return new Promise((resolve) => {
let json = {};
if (call === 'edit') {
Expand Down Expand Up @@ -54,9 +54,19 @@ update,
} else {
json.copyright.licenses[0].ingredient = 'license.md';
}

if (call === 'edit') {
localizedNames = JSON.parse(JSON.stringify(json.localizedNames));
Object.keys(json.type.flavorType.currentScope).forEach((scope) => {
if (!localizedNames[scope]) {
localizedNames[scope] = burrito.localizedNames[scope];
}
});
}

selectedScope.forEach((scope) => {
json.type.flavorType.currentScope[scope] = [];
localizedNames[scope] = json.localizedNames[scope];
localizedNames[scope] = burrito.localizedNames[scope];
});
json.localizedNames = localizedNames;
logger.debug('createTranslationSB.js', 'Created the Translation SB');
Expand Down

0 comments on commit 239222c

Please sign in to comment.