Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,10 @@
"APPLE_STRINGS",
"APPLE_XLIFF",
"APPLE_XCSTRINGS",
"APPLE_SDK",
"PROPERTIES_ICU",
"PROPERTIES_JAVA",
"ANDROID_SDK",
"ANDROID_XML",
"COMPOSE_XML",
"FLUTTER_ARB",
Expand Down
2 changes: 2 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ export const FORMAT_OPT = new Option(
'APPLE_STRINGS',
'APPLE_XLIFF',
'APPLE_XCSTRINGS',
'APPLE_SDK',
'PROPERTIES_ICU',
'PROPERTIES_JAVA',
'ANDROID_SDK',
'ANDROID_XML',
'COMPOSE_XML',
'FLUTTER_ARB',
Expand Down
2 changes: 2 additions & 0 deletions src/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export type Format =
| "APPLE_STRINGS"
| "APPLE_XLIFF"
| "APPLE_XCSTRINGS"
| "APPLE_SDK"
| "PROPERTIES_ICU"
| "PROPERTIES_JAVA"
| "ANDROID_SDK"
| "ANDROID_XML"
| "COMPOSE_XML"
| "FLUTTER_ARB"
Expand Down
4 changes: 4 additions & 0 deletions src/utils/mapExportFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ type FormatResult = {

export const mapExportFormat = (format: Schema['format']): FormatResult => {
switch (format) {
case 'ANDROID_SDK':
return { format: 'ANDROID_SDK', messageFormat: 'JAVA_STRING_FORMAT' };
case 'ANDROID_XML':
return { format: 'ANDROID_XML', messageFormat: 'JAVA_STRING_FORMAT' };
case 'APPLE_SDK':
return { format: 'APPLE_SDK', messageFormat: 'APPLE_SPRINTF' };
case 'APPLE_STRINGS':
return {
format: 'APPLE_STRINGS_STRINGSDICT',
Expand Down
9 changes: 9 additions & 0 deletions src/utils/mapImportFormat.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { InvalidArgumentError } from 'commander';
import { components } from '../client/internal/schema.generated.js';
import { Schema } from '../schema.js';

Expand All @@ -19,6 +20,14 @@ export const mapImportFormat = (
}
case 'JSON_TOLGEE':
return 'JSON_ICU';
case 'ANDROID_SDK':
throw new InvalidArgumentError(
'Importing files in ANDROID_SDK format is not supported.'
);
case 'APPLE_SDK':
throw new InvalidArgumentError(
'Importing files in APPLE_SDK format is not supported.'
);
default:
return format ?? 'JSON_ICU';
}
Expand Down
Loading