Skip to content

Commit 3cf6753

Browse files
feat: empty nodes in localizable files (#521)
1 parent dcd2ce4 commit 3cf6753

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.changeset/curly-spies-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
empty nodes in localizable files

packages/cli/src/cli/loaders/xcode-xcstrings.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@ export default function createXcodeXcstringsLoader(defaultLocale: string): ILoad
3232
}
3333
}
3434
} else if (isSourceLanguage) {
35-
const hasOtherLocalizations = rootTranslationEntity?.localizations &&
36-
Object.keys(rootTranslationEntity.localizations).length > 0;
37-
if (hasOtherLocalizations) {
38-
resultData[translationKey] = translationKey;
39-
}
35+
resultData[translationKey] = translationKey;
4036
}
4137
}
4238

39+
console.log(resultData);
4340
return resultData;
4441
},
4542
async push(locale, payload, originalInput) {
@@ -60,7 +57,7 @@ export default function createXcodeXcstringsLoader(defaultLocale: string): ILoad
6057

6158
if (typeof value === "string") {
6259
langDataToMerge.strings[key] = {
63-
extractionState: "manual",
60+
extractionState: originalInput?.strings?.[key]?.extractionState,
6461
localizations: {
6562
[locale]: {
6663
stringUnit: {

0 commit comments

Comments
 (0)