Skip to content

Commit 29cf6a7

Browse files
authored
fix(cli): xcstrings version (#982)
1 parent 21ba063 commit 29cf6a7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.changeset/thick-lions-drum.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+
fix xcstrings version

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ describe("loaders/xcode-xcstrings", () => {
8787
},
8888
},
8989
},
90+
version: "1.0",
9091
};
9192

9293
describe("pull", () => {
@@ -159,6 +160,7 @@ describe("loaders/xcode-xcstrings", () => {
159160
};
160161
const result = await loader.push("fr", payload);
161162
expect(result).not.toBeNull();
163+
expect(result!.version).toBe("1.0");
162164
expect(result!.strings["app.title"].localizations.fr).toEqual({
163165
stringUnit: {
164166
state: "translated",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ export default function createXcodeXcstringsLoader(
120120
}
121121

122122
export function _removeLocale(input: Record<string, any>, locale: string) {
123-
const { sourceLanguage, strings } = input;
123+
const { strings } = input;
124124
const newStrings = _.cloneDeep(strings);
125125
for (const [key, value] of Object.entries(newStrings)) {
126126
if ((value as any).localizations?.[locale]) {
127127
delete (value as any).localizations[locale];
128128
}
129129
}
130-
return { sourceLanguage, strings: newStrings };
130+
return { ...input, strings: newStrings };
131131
}

0 commit comments

Comments
 (0)