diff --git a/schema.json b/schema.json index 36ee03b..d1d3fdf 100644 --- a/schema.json +++ b/schema.json @@ -302,8 +302,10 @@ "APPLE_STRINGS", "APPLE_XLIFF", "APPLE_XCSTRINGS", + "APPLE_SDK", "PROPERTIES_ICU", "PROPERTIES_JAVA", + "ANDROID_SDK", "ANDROID_XML", "COMPOSE_XML", "FLUTTER_ARB", diff --git a/src/options.ts b/src/options.ts index 5914229..a85cda6 100644 --- a/src/options.ts +++ b/src/options.ts @@ -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', diff --git a/src/schema.d.ts b/src/schema.d.ts index c8cb753..14d52e5 100644 --- a/src/schema.d.ts +++ b/src/schema.d.ts @@ -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" diff --git a/src/utils/mapExportFormat.ts b/src/utils/mapExportFormat.ts index 7a3eef4..00dec0a 100644 --- a/src/utils/mapExportFormat.ts +++ b/src/utils/mapExportFormat.ts @@ -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', diff --git a/src/utils/mapImportFormat.ts b/src/utils/mapImportFormat.ts index 2edf7b5..2df4fd6 100644 --- a/src/utils/mapImportFormat.ts +++ b/src/utils/mapImportFormat.ts @@ -1,3 +1,4 @@ +import { InvalidArgumentError } from 'commander'; import { components } from '../client/internal/schema.generated.js'; import { Schema } from '../schema.js'; @@ -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'; }