From 0bad11843b178c821fb394a7c17e6d851b87ee41 Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 24 Aug 2026 13:10:39 +0200 Subject: [PATCH 1/2] Remove legacy --srcFormat/--targetFormat options --format is now the only (required) file-format flag, used for both source and target. Format conversion via differing src/target formats is no longer supported through the CLI. Co-Authored-By: Claude Sonnet 5 --- docs/AGENTIC_MIGRATION.md | 15 +++--- src/core/core-definitions.ts | 10 +--- src/core/translate-cli.ts | 69 +++++----------------------- src/index.ts | 20 +------- test/e2e-win/invalid-options.test.ts | 20 ++------ test/e2e/agent-flow.test.ts | 3 -- test/e2e/e2e-common.ts | 3 +- test/e2e/invalid-files.test.ts | 58 +++++++++++------------ test/e2e/translate-add.test.ts | 6 --- 9 files changed, 54 insertions(+), 150 deletions(-) diff --git a/docs/AGENTIC_MIGRATION.md b/docs/AGENTIC_MIGRATION.md index 64c7d38d..cd6448bb 100644 --- a/docs/AGENTIC_MIGRATION.md +++ b/docs/AGENTIC_MIGRATION.md @@ -5,8 +5,7 @@ This document summarizes the important changes when migrating from the pre-agent ## What changed (high-level) - New translation service: `--service=agent`. -- New preferred flag for same-format workflows: `--format=`. -- Legacy format flags still work for conversions: `--srcFormat` / `--targetFormat` (intentionally not promoted in READMEs). +- `--format=` is the only format flag; the legacy `--srcFormat` / `--targetFormat` flags have been removed. - `json` is a supported format and is treated the same as `nested-json` (implementation-wise). ## New agent workflow (`--service=agent`) @@ -21,17 +20,15 @@ The first run exits with a non-zero code by design, so CI/CD can detect that tra Notes: - Empty translations are supported by piping an empty line (line count still must match). -## Format flags: `--format` vs legacy `--srcFormat/--targetFormat` +## Format flag: `--format` -- Use `--format=` when source + target use the **same** file format. -- Use legacy `--srcFormat= --targetFormat=` when doing **format conversion** (e.g. XML → iOS strings). -- `--format` accepts **exactly one** format (no separators, no conversions). +- `--format=` is required and is used for both source and target files. +- `--format` accepts **exactly one** format (no separators, no conversions between different formats). ## Practical migration checklist -- Replace same-format calls: +- Replace legacy calls: - From: `--srcFormat= --targetFormat=` - - To: `--format=` -- For format conversions, keep using legacy flags. + - To: `--format=` (only supported when source and target use the same format) - If you relied on `--prompt`, remove it from scripts and automation (flag removed). - Consider switching scripts to `--service=agent` if you want the agentic two-step workflow. diff --git a/src/core/core-definitions.ts b/src/core/core-definitions.ts index 3032ed7c..800f545f 100644 --- a/src/core/core-definitions.ts +++ b/src/core/core-definitions.ts @@ -31,16 +31,8 @@ export interface CoreResults { export interface CliArgs extends Record { srcFile: string; srcLng: string; - /** - * Preferred format option. - * - "" uses the same format for source and target. - */ - format?: string; - /** Legacy option (overrides `format` for the source). */ - srcFormat?: string; + format: string; targetFile: string; targetLng: string; - /** Legacy option (overrides `format` for the target). */ - targetFormat?: string; service: string; } diff --git a/src/core/translate-cli.ts b/src/core/translate-cli.ts index f869b2f4..6990b853 100644 --- a/src/core/translate-cli.ts +++ b/src/core/translate-cli.ts @@ -13,16 +13,16 @@ import { getTServiceList, TServiceType } from "../services/service-definitions"; async function resolveOldTarget( args: CliArgs, - targetFileFormat: TFileType + fileFormat: TFileType ): Promise { const targetPath = path.resolve(args.targetFile); const targetDir = path.dirname(targetPath); checkDir(targetDir, { errorHint: "Target path" }); if (existsSync(targetPath)) { - return await readTFileCore(targetFileFormat, { + return await readTFileCore(fileFormat, { path: args.targetFile, lng: args.targetLng, - format: targetFileFormat, + format: fileFormat, }); } else { return null; @@ -35,7 +35,6 @@ export function formatCliOptions(options: string[]): string { export async function translateCli(cliArgs: CliArgs) { checkForEmptyStringOptions(cliArgs); - resolveFormatOptions(cliArgs); const fileFormats = getTFileFormatList(); const services = getTServiceList(); if (!services.includes(cliArgs.service as TServiceType)) { @@ -45,28 +44,20 @@ export async function translateCli(cliArgs: CliArgs) { }". Available services: ${formatCliOptions(services)}` ); } - if (!fileFormats.includes(cliArgs.srcFormat as TFileType)) { + if (!fileFormats.includes(cliArgs.format as TFileType)) { logFatal( - `Unknown source format "${ - cliArgs.srcFormat + `Unknown format "${ + cliArgs.format }". Available formats: ${formatCliOptions(fileFormats)}` ); } - const srcFileFormat: TFileType = cliArgs.srcFormat as TFileType; - if (!fileFormats.includes(cliArgs.targetFormat as TFileType)) { - logFatal( - `Unknown target format "${ - cliArgs.targetFormat - }". Available formats: ${formatCliOptions(fileFormats)}` - ); - } - const targetFileFormat = cliArgs.targetFormat as TFileType; + const fileFormat: TFileType = cliArgs.format as TFileType; checkNotDir(cliArgs.srcFile, { errorHint: "srcFile" }); - const src = await readTFileCore(srcFileFormat, { + const src = await readTFileCore(fileFormat, { path: cliArgs.srcFile, lng: cliArgs.srcLng, - format: srcFileFormat, + format: fileFormat, }); if (!src.size) { logFatal( @@ -76,10 +67,7 @@ export async function translateCli(cliArgs: CliArgs) { ); } - const oldTarget: TSet | null = await resolveOldTarget( - cliArgs, - targetFileFormat - ); + const oldTarget: TSet | null = await resolveOldTarget(cliArgs, fileFormat); const coreArgs: CoreArgs = { src, @@ -99,7 +87,7 @@ export async function translateCli(cliArgs: CliArgs) { tSet: result.newTarget, lng: cliArgs.targetLng, changeSet: result.changeSet, - format: targetFileFormat, + format: fileFormat, }); } if (!flushTarget) { @@ -107,41 +95,6 @@ export async function translateCli(cliArgs: CliArgs) { } } -function resolveFormatOptions(cliArgs: CliArgs): void { - const legacyUsed = - cliArgs.srcFormat !== undefined || cliArgs.targetFormat !== undefined; - - // Legacy mode: explicit source/target formats. - // This is the only supported way to do format conversion. - if (legacyUsed) { - if (!cliArgs.srcFormat) { - logFatal( - "required option '--srcFormat ' not specified" - ); - } - if (!cliArgs.targetFormat) { - logFatal( - "required option '--targetFormat ' not specified" - ); - } - return; - } - - // New mode: one format for both source and target. - if (!cliArgs.format) { - logFatal("required option '--format ' not specified"); - } - - const raw = cliArgs.format; - const spec = raw.trim(); - // Empty-string is handled by checkForEmptyStringOptions(), but be defensive. - if (!spec.length) { - logFatal("required option '--format ' not specified"); - } - cliArgs.srcFormat = spec; - cliArgs.targetFormat = spec; -} - // function parseBooleanOption(rawOption: string, optionKey: string): boolean { // const option = rawOption.trim().toLowerCase(); // if (option === "true") { diff --git a/src/index.ts b/src/index.ts index 5159cb2c..2f6fb234 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,23 +34,9 @@ export function run(process: NodeJS.Process, cliBinDir: string): void { "--targetLng ", "The target language" ) - .option( + .requiredOption( "--format ", - `Preferred format option (one format for both src and target). ${formatOneOfOptions( - getTFileFormatList() - )}` - ) - .option( - "--srcFormat ", - `Legacy. Overrides --format for the source. ${formatOneOfOptions( - getTFileFormatList() - )}` - ) - .option( - "--targetFormat ", - `Legacy. Overrides --format for the target. ${formatOneOfOptions( - getTFileFormatList() - )}` + formatOneOfOptions(getTFileFormatList()) ) .requiredOption( "--service ", @@ -68,10 +54,8 @@ export function run(process: NodeJS.Process, cliBinDir: string): void { srcFile: commander.opts().srcFile, srcLng: commander.opts().srcLng, format: commander.opts().format, - srcFormat: commander.opts().srcFormat, targetFile: commander.opts().targetFile, targetLng: commander.opts().targetLng, - targetFormat: commander.opts().targetFormat, service: commander.opts().service, }; translateCli(args) diff --git a/test/e2e-win/invalid-options.test.ts b/test/e2e-win/invalid-options.test.ts index 68119ccb..5d9c6d4a 100644 --- a/test/e2e-win/invalid-options.test.ts +++ b/test/e2e-win/invalid-options.test.ts @@ -86,35 +86,23 @@ test("unknown service", async () => { ); }); -test("unknown source file format", async () => { +test("unknown format", async () => { const args: E2EArgs = { ...defaultE2EArgs, - srcFormat: "some-invalid-source" as unknown as never, + format: "some-invalid-format" as unknown as never, }; const output = await runTranslateExpectFailure(buildE2EArgs(args)); expect(output).toContain( - `error: Unknown source format "some-invalid-source". Available formats: "` - ); -}); - -test("unknown target file format", async () => { - const args: E2EArgs = { - ...defaultE2EArgs, - targetFormat: "some-invalid-target" as unknown as never, - }; - const output = await runTranslateExpectFailure(buildE2EArgs(args)); - expect(output).toContain( - `error: Unknown target format "some-invalid-target". Available formats: "` + `error: Unknown format "some-invalid-format". Available formats: "` ); }); const requiredOptions: (keyof typeof defaultE2EArgs)[] = [ "srcFile", "srcLng", - "srcFormat", + "format", "targetFile", "targetLng", - "targetFormat", "service", ]; diff --git a/test/e2e/agent-flow.test.ts b/test/e2e/agent-flow.test.ts index 85e53870..62ab6b89 100644 --- a/test/e2e/agent-flow.test.ts +++ b/test/e2e/agent-flow.test.ts @@ -21,9 +21,6 @@ import { buildE2EArgs, defaultE2EArgs, E2EArgs } from "./e2e-common"; ...defaultE2EArgs, srcFile, srcLng: "English", - // Use new single-format flag. (Disable legacy src/target format args) - srcFormat: undefined, - targetFormat: undefined, format: "json", targetFile: "", refTargetFile: "default-ref-target", diff --git a/test/e2e/e2e-common.ts b/test/e2e/e2e-common.ts index 91a92b7c..f3c2f540 100644 --- a/test/e2e/e2e-common.ts +++ b/test/e2e/e2e-common.ts @@ -15,11 +15,10 @@ const randomTargetMarker = "random_target"; export const defaultE2EArgs: E2EArgs = { srcFile: "test-assets/nested-json/count-en.json", srcLng: "en", - srcFormat: "json", + format: "json", targetFile: getRandomTargetName("default_target"), refTargetFile: "default-ref-target", targetLng: "de", - targetFormat: "flat-json", service: "sync-without-translate", }; diff --git a/test/e2e/invalid-files.test.ts b/test/e2e/invalid-files.test.ts index 10fe79d4..44e8ae0a 100644 --- a/test/e2e/invalid-files.test.ts +++ b/test/e2e/invalid-files.test.ts @@ -16,103 +16,103 @@ test("src not a JSON", async () => { describe.each([ { srcFile: "test-assets/invalid/wrong-separator.csv", - srcFormat: "csv", + format: "csv", errorMessage: "Expected at least 2 columns in CSV header with separator ','", auxMessage: null, }, { srcFile: "test-assets/android-xml/advanced.xml", - srcFormat: "csv", + format: "csv", errorMessage: "Expected at least 2 columns in CSV header with separator ','", auxMessage: null, }, { srcFile: "test-assets/invalid/bogus-lang.csv", - srcFormat: "csv", + format: "csv", errorMessage: "Did not find language 'en' in CSV header 'keys,bogus-lang'", auxMessage: null, }, { srcFile: "test-assets/nested-json/count-en.json", - srcFormat: "xml", + format: "xml", errorMessage: "XML parsing error", auxMessage: "Error: Non-whitespace before first tag", }, { srcFile: "test-assets/android-xml/advanced.xml", - srcFormat: "yaml", + format: "yaml", errorMessage: "Implicit map keys need to be on a single line", auxMessage: "Implicit map keys need to be followed by map values", }, { srcFile: "test-assets/android-xml/advanced.xml", - srcFormat: "po", + format: "po", errorMessage: "GetText parsing error", auxMessage: "SyntaxError: Error parsing PO data", }, { srcFile: "test-assets/invalid/duplicate-keys.xml", - srcFormat: "xml", + format: "xml", errorMessage: "duplicate key 'dup' -> Currently, the usage of duplicate translation-keys is discouraged.", auxMessage: null, }, { srcFile: "test-assets/invalid/duplicate-keys.csv", - srcFormat: "csv", + format: "csv", errorMessage: "duplicate key 'dup_csv' -> Currently, the usage of duplicate translation-keys is discouraged.", auxMessage: null, }, { srcFile: "test-assets/invalid/duplicate-keys.strings", - srcFormat: "ios-strings", + format: "ios-strings", errorMessage: "duplicate key 'dup_ios' -> Currently, the usage of duplicate translation-keys is discouraged", auxMessage: `Warning: Parsing 'test-assets/invalid/duplicate-keys.strings': Line 'other content' seems to be unexpected`, }, { srcFile: "test-assets/invalid/duplicate-keys.yml", - srcFormat: "yaml", + format: "yaml", errorMessage: 'Map keys must be unique; "question" is repeated at line 1, column 1', auxMessage: "question: 'What do I do when I have forgotten my login?", }, { srcFile: "test-assets/nested-json/count-en.json", - srcFormat: "flat-json", + format: "flat-json", errorMessage: "Property 'inner' is not a string or null", auxMessage: null, }, { srcFile: "test-assets/invalid/whitespace", - srcFormat: "yaml", + format: "yaml", errorMessage: "root node not found", auxMessage: null, }, { srcFile: "test-assets/invalid/not-a-json", - srcFormat: "ios-strings", + format: "ios-strings", errorMessage: "Did not find any Strings in the expected format", auxMessage: "Line '#' seems to be unexpected", }, { srcFile: "test-assets/invalid/whitespace", - srcFormat: "ios-strings", + format: "ios-strings", errorMessage: "Did not find any Strings in the expected format", auxMessage: null, }, { srcFile: "test-assets/invalid/empty", - srcFormat: "ios-strings", + format: "ios-strings", errorMessage: "Did not find any Strings in the expected format", auxMessage: null, }, { srcFile: "test-assets/invalid/empty", - srcFormat: "csv", + format: "csv", errorMessage: "Expected at least 2 CSV lines (header + content)", auxMessage: null, }, @@ -120,7 +120,7 @@ describe.each([ "src parsing error", (args: { srcFile: string; - srcFormat: string; + format: string; errorMessage: string; auxMessage: string | null; }) => { @@ -128,12 +128,12 @@ describe.each([ const e2eArgs: E2EArgs = { ...defaultE2EArgs, srcFile: args.srcFile, - srcFormat: args.srcFormat, + format: args.format, }; const output = await runTranslateExpectFailure(buildE2EArgs(e2eArgs)); const expectedOutput = `error: Failed to parse ${getDebugPath( args.srcFile - )} with expected format '${args.srcFormat}': ${args.errorMessage}`; + )} with expected format '${args.format}': ${args.errorMessage}`; if (args.auxMessage) { expect(output).toContain(expectedOutput); expect(output).toContain(args.auxMessage); @@ -145,20 +145,20 @@ describe.each([ ); describe.each([ - { srcFile: "test-assets/invalid/empty.json", srcFormat: "flat-json" }, - { srcFile: "test-assets/invalid/empty.json", srcFormat: "nested-json" }, - { srcFile: "test-assets/invalid/empty.xml", srcFormat: "xml" }, - { srcFile: "test-assets/invalid/empty", srcFormat: "xml" }, - { srcFile: "test-assets/invalid/whitespace", srcFormat: "xml" }, - { srcFile: "test-assets/invalid/empty", srcFormat: "yaml" }, - { srcFile: "test-assets/invalid/empty", srcFormat: "po" }, - { srcFile: "test-assets/invalid/whitespace", srcFormat: "po" }, -])("empty src", (args: { srcFile: string; srcFormat: string }) => { + { srcFile: "test-assets/invalid/empty.json", format: "flat-json" }, + { srcFile: "test-assets/invalid/empty.json", format: "nested-json" }, + { srcFile: "test-assets/invalid/empty.xml", format: "xml" }, + { srcFile: "test-assets/invalid/empty", format: "xml" }, + { srcFile: "test-assets/invalid/whitespace", format: "xml" }, + { srcFile: "test-assets/invalid/empty", format: "yaml" }, + { srcFile: "test-assets/invalid/empty", format: "po" }, + { srcFile: "test-assets/invalid/whitespace", format: "po" }, +])("empty src", (args: { srcFile: string; format: string }) => { test("empty src", async () => { const e2eArgs: E2EArgs = { ...defaultE2EArgs, srcFile: args.srcFile, - srcFormat: args.srcFormat, + format: args.format, }; const output = await runTranslateExpectFailure(buildE2EArgs(e2eArgs)); expect(output).toBe( diff --git a/test/e2e/translate-add.test.ts b/test/e2e/translate-add.test.ts index a2c998f9..c5cb6a07 100644 --- a/test/e2e/translate-add.test.ts +++ b/test/e2e/translate-add.test.ts @@ -16,10 +16,6 @@ const testArray: { args: { ...defaultE2EArgs, srcFile: "test-assets/misc-json/empty-props.json", - // Use the new single-format flag for this test. - // (defaultE2EArgs uses legacy src/target formats for conversion tests) - srcFormat: undefined, - targetFormat: undefined, format: "flat-json", targetFile: "test-assets/nested-json/count-de.clean.json", refTargetFile: "test-assets/misc-json/empty-props+count-de.json", @@ -31,8 +27,6 @@ const testArray: { args: { ...defaultE2EArgs, srcFile: "test-assets/android-xml/count-en.indent2.flat.xml", - srcFormat: undefined, - targetFormat: undefined, format: "xml", targetFile: "test-assets/android-xml/count-de.missing-entry.xml", refTargetFile: "test-assets/android-xml/count-de.xml", From 72bddf7ffff0f497d9060c5b4c4babf9e8ea56d7 Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 24 Aug 2026 13:16:28 +0200 Subject: [PATCH 2/2] Remove sample-script format-conversion examples and tests These relied on the now-removed --srcFormat/--targetFormat flags. Fully conversion-based examples (csv_to_other_formats, android_to_ios) are deleted along with their tests and fixtures; scripts that only had a bonus conversion line (xml_generic, yaml_ecommerce, po_generic) keep their main same-format examples and drop just that line. Co-Authored-By: Claude Sonnet 5 --- .../app/src/main/res/values-de/strings.xml | 17 ------- .../app/src/main/res/values-es/strings.xml | 18 -------- .../res/values-es/strings.xml_modified.xml | 20 -------- .../app/src/main/res/values/strings.xml | 17 ------- sample-scripts/android_to_ios.sh | 25 ---------- sample-scripts/csv/.babelish | 38 --------------- sample-scripts/csv/de.json | 4 -- sample-scripts/csv/de.po | 11 ----- sample-scripts/csv/de.yaml | 2 - sample-scripts/csv/en.json | 5 -- sample-scripts/csv/en.strings | 9 ---- sample-scripts/csv/en.xml | 5 -- sample-scripts/csv/es.arb | 5 -- sample-scripts/csv/google-docs.csv | 3 -- sample-scripts/csv/single-lang-en.csv | 4 -- sample-scripts/csv/single-lang-es.csv | 4 -- sample-scripts/csv/translations.csv | 4 -- sample-scripts/csv_to_other_formats.sh | 18 -------- .../Base.lproj/Localizable.strings | 21 --------- .../Localizable/de.lproj/Localizable.strings | 21 --------- .../Localizable/es.lproj/Localizable.strings | 21 --------- sample-scripts/po-generic/nested-fruits.po | 11 ----- sample-scripts/po-generic/nested-fruits.yml | 6 --- sample-scripts/po_generic.sh | 3 -- .../xml-generic/nested-fruits.strings | 5 -- sample-scripts/xml-generic/nested-fruits.xml | 6 --- sample-scripts/xml_generic.sh | 3 -- sample-scripts/yaml/nested-fruits.json | 11 ----- sample-scripts/yaml/nested-fruits.yml | 6 --- sample-scripts/yaml_ecommerce.sh | 3 -- test/e2e/scripts-android-ios.test.ts | 46 ------------------- test/e2e/scripts-csv.test.ts | 42 ----------------- test/e2e/scripts-po.test.ts | 18 +------- test/e2e/scripts-xml-generic.test.ts | 17 +------ test/e2e/scripts-yaml.test.ts | 17 +------ 35 files changed, 3 insertions(+), 463 deletions(-) delete mode 100644 sample-scripts/android/app/src/main/res/values-de/strings.xml delete mode 100644 sample-scripts/android/app/src/main/res/values-es/strings.xml delete mode 100644 sample-scripts/android/app/src/main/res/values-es/strings.xml_modified.xml delete mode 100644 sample-scripts/android/app/src/main/res/values/strings.xml delete mode 100755 sample-scripts/android_to_ios.sh delete mode 100644 sample-scripts/csv/.babelish delete mode 100644 sample-scripts/csv/de.json delete mode 100644 sample-scripts/csv/de.po delete mode 100644 sample-scripts/csv/de.yaml delete mode 100644 sample-scripts/csv/en.json delete mode 100644 sample-scripts/csv/en.strings delete mode 100644 sample-scripts/csv/en.xml delete mode 100644 sample-scripts/csv/es.arb delete mode 100644 sample-scripts/csv/google-docs.csv delete mode 100644 sample-scripts/csv/single-lang-en.csv delete mode 100644 sample-scripts/csv/single-lang-es.csv delete mode 100644 sample-scripts/csv/translations.csv delete mode 100755 sample-scripts/csv_to_other_formats.sh delete mode 100644 sample-scripts/ios/Localizable/Base.lproj/Localizable.strings delete mode 100644 sample-scripts/ios/Localizable/de.lproj/Localizable.strings delete mode 100644 sample-scripts/ios/Localizable/es.lproj/Localizable.strings delete mode 100644 sample-scripts/po-generic/nested-fruits.po delete mode 100644 sample-scripts/po-generic/nested-fruits.yml delete mode 100644 sample-scripts/xml-generic/nested-fruits.strings delete mode 100644 sample-scripts/xml-generic/nested-fruits.xml delete mode 100644 sample-scripts/yaml/nested-fruits.json delete mode 100644 sample-scripts/yaml/nested-fruits.yml delete mode 100644 test/e2e/scripts-android-ios.test.ts delete mode 100644 test/e2e/scripts-csv.test.ts diff --git a/sample-scripts/android/app/src/main/res/values-de/strings.xml b/sample-scripts/android/app/src/main/res/values-de/strings.xml deleted file mode 100644 index 19d2aea3..00000000 --- a/sample-scripts/android/app/src/main/res/values-de/strings.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Apfel - Birne - Banane - - - Zwei - - - Venus - - Erde - Mars - - diff --git a/sample-scripts/android/app/src/main/res/values-es/strings.xml b/sample-scripts/android/app/src/main/res/values-es/strings.xml deleted file mode 100644 index d8e7c3e4..00000000 --- a/sample-scripts/android/app/src/main/res/values-es/strings.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - manzana - - Pera - Plátano - - - Dos - - - Venus - - Tierra - Marte - - diff --git a/sample-scripts/android/app/src/main/res/values-es/strings.xml_modified.xml b/sample-scripts/android/app/src/main/res/values-es/strings.xml_modified.xml deleted file mode 100644 index 2fd1df68..00000000 --- a/sample-scripts/android/app/src/main/res/values-es/strings.xml_modified.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - manzana - manzana - - Pera - Plátano - - - Dos - - - Venus - - Tierra - Marte - More stale stuff - - diff --git a/sample-scripts/android/app/src/main/res/values/strings.xml b/sample-scripts/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 0076218c..00000000 --- a/sample-scripts/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Apple - Pear - Banana - - - Two - - - Venus - - Earth - Mars - - diff --git a/sample-scripts/android_to_ios.sh b/sample-scripts/android_to_ios.sh deleted file mode 100755 index cd427368..00000000 --- a/sample-scripts/android_to_ios.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -e - -# Run "npm install --global attranslate" before you try this example. - -# This example works in two steps: -# Step 1: Translate an english XML into a spanish XML and a german XML. -# Step 2: Convert those Android-XMLs into iOS-Strings, without changing the language. - -# Paths to app-specific XML-files: -ANDROID_EN="android/app/src/main/res/values/strings.xml" -ANDROID_DE="android/app/src/main/res/values-de/strings.xml" -ANDROID_ES="android/app/src/main/res/values-es/strings.xml" - -attranslate --srcFile=$ANDROID_EN --srcLng=English --format=xml --targetFile=$ANDROID_DE --targetLng=German --service=agent -attranslate --srcFile=$ANDROID_EN --srcLng=English --format=xml --targetFile=$ANDROID_ES --targetLng=Spanish --service=agent - -# Paths to app-specific iOS-Strings: -iOS_EN="ios/Localizable/Base.lproj/Localizable.strings" -iOS_DE="ios/Localizable/de.lproj/Localizable.strings" -iOS_ES="ios/Localizable/es.lproj/Localizable.strings" - -attranslate --srcFile=$ANDROID_EN --srcLng=English --srcFormat=xml --targetFile=$iOS_EN --targetLng=English --targetFormat=ios-strings --service=sync-without-translate -attranslate --srcFile=$ANDROID_DE --srcLng=German --srcFormat=xml --targetFile=$iOS_DE --targetLng=German --targetFormat=ios-strings --service=sync-without-translate -attranslate --srcFile=$ANDROID_ES --srcLng=Spanish --srcFormat=xml --targetFile=$iOS_ES --targetLng=Spanish --targetFormat=ios-strings --service=sync-without-translate diff --git a/sample-scripts/csv/.babelish b/sample-scripts/csv/.babelish deleted file mode 100644 index cb143353..00000000 --- a/sample-scripts/csv/.babelish +++ /dev/null @@ -1,38 +0,0 @@ -# "attranslate" aims to be backwards-compatible with "babelish" - -###################################### Base2CSV ###################################### - -## required, location of strings files (FILENAMES) -filenames: ["../android/app/src/main/res/values/strings.xml", "../android/app/src/main/res/values-de/strings.xml", "../android/app/src/main/res/values-es/strings.xml"] - -## optional -headers: ["keys", "en", "de", "es"] # override headers of columns, default is name of input files and 'Variables' for reference -# csv_filename: "testconfig.csv" # location of output file -# dryrun: true # prints out content of hash without writing file - -###################################### CSV2Base ###################################### - -## required -filename: test/data/test_data.csv # CSV file (CSV_FILENAME) to convert from or name of file in Google Drive -langs: # Languages to convert. i.e. English:en - English: "en" - -## optional -# fetch: true # set to true to get file(filename) from google drive -# excluded_states: ["Images", "Xib"] # Exclude rows with given state -# comments_column: 4 # Position of column for comments if any -# state_column: 3 # Position of column for state if any -# keys_column: 0 # Position of column for keys -# default_lang: "English" # Header name of column containing fallback value if value is empty -# output_dir: "resources/" # Path of output files -# output_basenames: # Basename of output files -# - Localizable -# - info -# ignore_lang_path: true # does not care about lang component path. i.e: en.lproj/ -# sheet: 0 # Index of worksheet to download. First index is 0. -# macros_filename: Babelish.h # File to output the defines of localized strings -# stripping: false # Strips values inside the spreadsheet - -###################################### General ###################################### - -# csv_separator: ';' # CSV column separator character, uses ',' by default diff --git a/sample-scripts/csv/de.json b/sample-scripts/csv/de.json deleted file mode 100644 index 6ec52370..00000000 --- a/sample-scripts/csv/de.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "cat_1": "Apfel", - "cat_2": "Birne" -} diff --git a/sample-scripts/csv/de.po b/sample-scripts/csv/de.po deleted file mode 100644 index d961e669..00000000 --- a/sample-scripts/csv/de.po +++ /dev/null @@ -1,11 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain\n" - -msgid "category_apple" -msgstr "Apfel" - -msgid "category_sub_pear" -msgstr "Birne" - -msgid "category_sub_sub_banana" -msgstr "Banane" diff --git a/sample-scripts/csv/de.yaml b/sample-scripts/csv/de.yaml deleted file mode 100644 index 0f7ce626..00000000 --- a/sample-scripts/csv/de.yaml +++ /dev/null @@ -1,2 +0,0 @@ -cat_1: Apfel -cat_2: Birne diff --git a/sample-scripts/csv/en.json b/sample-scripts/csv/en.json deleted file mode 100644 index 609b29ed..00000000 --- a/sample-scripts/csv/en.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "category_apple": "Apple", - "category_sub_pear": "Pear", - "category_sub_sub_banana": "Banana" -} diff --git a/sample-scripts/csv/en.strings b/sample-scripts/csv/en.strings deleted file mode 100644 index fc3fc143..00000000 --- a/sample-scripts/csv/en.strings +++ /dev/null @@ -1,9 +0,0 @@ - - -"category_apple" = "Apple"; - - -"category_sub_pear" = "Pear"; - - -"category_sub_sub_banana" = "Banana"; diff --git a/sample-scripts/csv/en.xml b/sample-scripts/csv/en.xml deleted file mode 100644 index 7d6a4c83..00000000 --- a/sample-scripts/csv/en.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - Apple - Pear - diff --git a/sample-scripts/csv/es.arb b/sample-scripts/csv/es.arb deleted file mode 100644 index e147132e..00000000 --- a/sample-scripts/csv/es.arb +++ /dev/null @@ -1,5 +0,0 @@ -{ - "category_apple": "manzana", - "category_sub_pear": "Pera", - "category_sub_sub_banana": "Plátano" -} diff --git a/sample-scripts/csv/google-docs.csv b/sample-scripts/csv/google-docs.csv deleted file mode 100644 index c3937dfd..00000000 --- a/sample-scripts/csv/google-docs.csv +++ /dev/null @@ -1,3 +0,0 @@ -variables,en,de -cat_1,Apple,Apfel -cat_2,Pear,Birne diff --git a/sample-scripts/csv/single-lang-en.csv b/sample-scripts/csv/single-lang-en.csv deleted file mode 100644 index ca238d5d..00000000 --- a/sample-scripts/csv/single-lang-en.csv +++ /dev/null @@ -1,4 +0,0 @@ -keys,en -category_apple,Apple -category_sub_pear,Pear -category_sub_sub_banana,Banana diff --git a/sample-scripts/csv/single-lang-es.csv b/sample-scripts/csv/single-lang-es.csv deleted file mode 100644 index 68454b5c..00000000 --- a/sample-scripts/csv/single-lang-es.csv +++ /dev/null @@ -1,4 +0,0 @@ -keys,es -category_apple,manzana -category_sub_pear,Pera -category_sub_sub_banana,Plátano diff --git a/sample-scripts/csv/translations.csv b/sample-scripts/csv/translations.csv deleted file mode 100644 index 08f429af..00000000 --- a/sample-scripts/csv/translations.csv +++ /dev/null @@ -1,4 +0,0 @@ -keys,en,de,es -category_apple,Apple,Apfel,manzana -category_sub_pear,Pear,Birne,Pera -category_sub_sub_banana,Banana,Banane,Plátano diff --git a/sample-scripts/csv_to_other_formats.sh b/sample-scripts/csv_to_other_formats.sh deleted file mode 100755 index a7d58a08..00000000 --- a/sample-scripts/csv_to_other_formats.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -set -e - -# Run "npm install --global attranslate" before you try this example. - -# This example extracts contents from CSV files and converts it into various formats. - -attranslate --srcFormat=csv --srcFile=csv/google-docs.csv --srcLng=en --targetFormat=xml --targetFile=csv/en.xml --targetLng=en --service=sync-without-translate -attranslate --srcFormat=csv --srcFile=csv/google-docs.csv --srcLng=de --targetFormat=yaml --targetFile=csv/de.yaml --targetLng=de --service=sync-without-translate -attranslate --srcFormat=csv --srcFile=csv/google-docs.csv --srcLng=de --targetFormat=json --targetFile=csv/de.json --targetLng=de --service=sync-without-translate - -attranslate --srcFormat=csv --srcFile=csv/translations.csv --srcLng=en --targetFormat=flat-json --targetFile=csv/en.json --targetLng=en --service=sync-without-translate -attranslate --srcFormat=csv --srcFile=csv/translations.csv --srcLng=en --targetFormat=ios-strings --targetFile=csv/en.strings --targetLng=en --service=sync-without-translate -attranslate --srcFormat=csv --srcFile=csv/translations.csv --srcLng=de --targetFormat=po --targetFile=csv/de.po --targetLng=de --service=sync-without-translate -attranslate --srcFormat=csv --srcFile=csv/translations.csv --srcLng=es --targetFormat=arb --targetFile=csv/es.arb --targetLng=es --service=sync-without-translate - -attranslate --srcFile=csv/translations.csv --srcLng=es --format=csv --targetFile=csv/single-lang-es.csv --targetLng=es --service=sync-without-translate -attranslate --srcFormat=ios-strings --srcFile=csv/en.strings --srcLng=en --targetFormat=csv --targetFile=csv/single-lang-en.csv --targetLng=en --service=sync-without-translate diff --git a/sample-scripts/ios/Localizable/Base.lproj/Localizable.strings b/sample-scripts/ios/Localizable/Base.lproj/Localizable.strings deleted file mode 100644 index 2db607ea..00000000 --- a/sample-scripts/ios/Localizable/Base.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ - - -"category_apple" = "Apple"; - - -"category_sub_pear" = "Pear"; - - -"category_sub_sub_banana" = "Banana"; - - -"plurals.some plurals.item_0" = "Two"; - - -"string-array.planets.item_0" = "Venus"; - - -"string-array.planets.item_1" = "Earth"; - - -"string-array.planets.item_2" = "Mars"; diff --git a/sample-scripts/ios/Localizable/de.lproj/Localizable.strings b/sample-scripts/ios/Localizable/de.lproj/Localizable.strings deleted file mode 100644 index 3f0adb9b..00000000 --- a/sample-scripts/ios/Localizable/de.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ - - -"category_apple" = "Apfel"; - - -"category_sub_pear" = "Birne"; - - -"category_sub_sub_banana" = "Banane"; - - -"plurals.some plurals.item_0" = "Zwei"; - - -"string-array.planets.item_0" = "Venus"; - - -"string-array.planets.item_1" = "Erde"; - - -"string-array.planets.item_2" = "Mars"; diff --git a/sample-scripts/ios/Localizable/es.lproj/Localizable.strings b/sample-scripts/ios/Localizable/es.lproj/Localizable.strings deleted file mode 100644 index 7648ecb8..00000000 --- a/sample-scripts/ios/Localizable/es.lproj/Localizable.strings +++ /dev/null @@ -1,21 +0,0 @@ - - -"category_apple" = "manzana"; - - -"category_sub_pear" = "Pera"; - - -"category_sub_sub_banana" = "Plátano"; - - -"plurals.some plurals.item_0" = "Dos"; - - -"string-array.planets.item_0" = "Venus"; - - -"string-array.planets.item_1" = "Tierra"; - - -"string-array.planets.item_2" = "Marte"; diff --git a/sample-scripts/po-generic/nested-fruits.po b/sample-scripts/po-generic/nested-fruits.po deleted file mode 100644 index 91b8d1fd..00000000 --- a/sample-scripts/po-generic/nested-fruits.po +++ /dev/null @@ -1,11 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain\n" - -msgid "apple" -msgstr "Apple" - -msgid "nesting.pear" -msgstr "Pear" - -msgid "moreNesting.innerNesting.banana" -msgstr "Banana" diff --git a/sample-scripts/po-generic/nested-fruits.yml b/sample-scripts/po-generic/nested-fruits.yml deleted file mode 100644 index ae0b0204..00000000 --- a/sample-scripts/po-generic/nested-fruits.yml +++ /dev/null @@ -1,6 +0,0 @@ -apple: Apple -nesting: - pear: Pear -moreNesting: - innerNesting: - banana: Banana diff --git a/sample-scripts/po_generic.sh b/sample-scripts/po_generic.sh index a8571f3e..05832658 100755 --- a/sample-scripts/po_generic.sh +++ b/sample-scripts/po_generic.sh @@ -7,6 +7,3 @@ BASE_DIR=po-generic # Run "npm install --global attranslate" before you try this example. attranslate --srcFile=$BASE_DIR/en.po --srcLng=English --format=po --targetFile=$BASE_DIR/es.po --targetLng=Spanish --service=agent attranslate --srcFile=$BASE_DIR/en.po --srcLng=English --format=po --targetFile=$BASE_DIR/de.po --targetLng=German --service=agent - -# Convert a YAML to PO (just for the sake of test-coverage) -attranslate --srcFile="$BASE_DIR/nested-fruits.yml" --srcFormat=yaml --srcLng=x --targetFile=$BASE_DIR/nested-fruits.po --targetFormat=po --targetLng=x --service=sync-without-translate diff --git a/sample-scripts/xml-generic/nested-fruits.strings b/sample-scripts/xml-generic/nested-fruits.strings deleted file mode 100644 index 8a0e187c..00000000 --- a/sample-scripts/xml-generic/nested-fruits.strings +++ /dev/null @@ -1,5 +0,0 @@ -"apple" = "Apple"; - -"nesting.pear" = "Pear"; - -"moreNesting.innerNesting.banana" ="Banana"; diff --git a/sample-scripts/xml-generic/nested-fruits.xml b/sample-scripts/xml-generic/nested-fruits.xml deleted file mode 100644 index f69d8cf4..00000000 --- a/sample-scripts/xml-generic/nested-fruits.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - Apple - Pear - Banana - diff --git a/sample-scripts/xml_generic.sh b/sample-scripts/xml_generic.sh index f0d53963..8f31f624 100755 --- a/sample-scripts/xml_generic.sh +++ b/sample-scripts/xml_generic.sh @@ -7,6 +7,3 @@ BASE_DIR=xml-generic # Run "npm install --global attranslate" before you try this example. attranslate --srcFile=$BASE_DIR/en.xml --srcLng=English --format=xml --targetFile=$BASE_DIR/ar.xml --targetLng=Arabic --service=agent attranslate --srcFile=$BASE_DIR/en.xml --srcLng=English --format=xml --targetFile=$BASE_DIR/de.xml --targetLng=German --service=agent - -# Convert an iOS string file into an XML (just for the sake of test-coverage) -attranslate --srcFormat=ios-strings --srcFile=$BASE_DIR/nested-fruits.strings --srcLng=en --targetFormat=xml --targetFile=$BASE_DIR/nested-fruits.xml --targetLng=en --service=sync-without-translate diff --git a/sample-scripts/yaml/nested-fruits.json b/sample-scripts/yaml/nested-fruits.json deleted file mode 100644 index a6b9d18b..00000000 --- a/sample-scripts/yaml/nested-fruits.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "apple": "Apple", - "nesting": { - "pear": "Pear" - }, - "moreNesting": { - "innerNesting":{ - "banana": "Banana" - } - } -} diff --git a/sample-scripts/yaml/nested-fruits.yml b/sample-scripts/yaml/nested-fruits.yml deleted file mode 100644 index ae0b0204..00000000 --- a/sample-scripts/yaml/nested-fruits.yml +++ /dev/null @@ -1,6 +0,0 @@ -apple: Apple -nesting: - pear: Pear -moreNesting: - innerNesting: - banana: Banana diff --git a/sample-scripts/yaml_ecommerce.sh b/sample-scripts/yaml_ecommerce.sh index 7fea78c3..10e00765 100755 --- a/sample-scripts/yaml_ecommerce.sh +++ b/sample-scripts/yaml_ecommerce.sh @@ -12,6 +12,3 @@ node search_replace.js "yaml/es_ecommerce.yml" "en:" "es:" # postprocessing node search_replace.js "yaml/de_ecommerce.yml" "de:" "en:" # preprocessing attranslate --srcFile=yaml/en_ecommerce.yml --srcLng=English --format=yaml --targetFile=yaml/de_ecommerce.yml --targetLng=German --service=agent node search_replace.js "yaml/de_ecommerce.yml" "en:" "de:" # postprocessing - -# Convert a JSON to YML (just for the sake of test-coverage) -attranslate --srcFile="yaml/nested-fruits.json" --srcFormat=json --srcLng=x --targetFile=yaml/nested-fruits.yml --targetFormat=yaml --targetLng=x --service=sync-without-translate diff --git a/test/e2e/scripts-android-ios.test.ts b/test/e2e/scripts-android-ios.test.ts deleted file mode 100644 index 2da57b2e..00000000 --- a/test/e2e/scripts-android-ios.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { runSampleScript, sampleDir } from "./scripts-e2e-util"; -import { joinLines, runCommand } from "../test-util/test-util"; -import { join } from "path"; -import { getDebugPath } from "../../src/util/util"; - -const assetDirs = ["android", "ios"]; - -const xmlRecreateTarget = "android/app/src/main/res/values-de/strings.xml"; -const xmlModifyTarget = "android/app/src/main/res/values-es/strings.xml"; - -const targetPaths: string[] = [ - xmlRecreateTarget, - xmlModifyTarget, - "ios/Localizable/Base.lproj/Localizable.strings", - "ios/Localizable/de.lproj/Localizable.strings", - "ios/Localizable/es.lproj/Localizable.strings", -]; - -async function runAndroidiOS(): Promise { - return await runSampleScript(`./android_to_ios.sh`, assetDirs); -} - -test("Android to iOS clean", async () => { - const output = await runAndroidiOS(); - expect(output).toBe( - joinLines( - targetPaths.map((path) => { - return `Target is up-to-date: '${path}'`; - }) - ) - ); -}); - -test("Delete stale XML entries", async () => { - await runCommand( - `cp ${join(sampleDir, xmlModifyTarget + "_modified.xml")} ${join( - sampleDir, - xmlModifyTarget - )}` - ); - const output = await runAndroidiOS(); - expect(output).toContain( - `Write target ${getDebugPath(join(sampleDir, xmlModifyTarget))}` - ); - expect(output).toContain(`Delete 2 stale translations`); -}); diff --git a/test/e2e/scripts-csv.test.ts b/test/e2e/scripts-csv.test.ts deleted file mode 100644 index 10cdd59f..00000000 --- a/test/e2e/scripts-csv.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { runSampleScript, sampleDir } from "./scripts-e2e-util"; -import { joinLines } from "../test-util/test-util"; -import { unlinkSync } from "fs"; -import { join } from "path"; -import { getDebugPath } from "../../src/util/util"; - -const testScript = "./csv_to_other_formats.sh"; -const assetDir = "csv"; -const targetPaths: string[] = [ - join(assetDir, "en.xml"), - join(assetDir, "de.yaml"), - join(assetDir, "de.json"), - join(assetDir, "en.json"), - join(assetDir, "en.strings"), - join(assetDir, "de.po"), - join(assetDir, "es.arb"), - join(assetDir, "single-lang-es.csv"), - join(assetDir, "single-lang-en.csv"), -]; - -test("csv clean", async () => { - const output = await runSampleScript(testScript, [assetDir]); - expect(output).toBe( - joinLines( - targetPaths.map((path) => { - return `Target is up-to-date: '${path}'`; - }) - ) - ); -}); - -test("csv re-create", async () => { - targetPaths.forEach((path) => { - unlinkSync(join(sampleDir, path)); - }); - const output = await runSampleScript(testScript, [assetDir]); - targetPaths.forEach((path) => { - expect(output).toContain( - `Write target ${getDebugPath(join(sampleDir, path))}` - ); - }); -}); diff --git a/test/e2e/scripts-po.test.ts b/test/e2e/scripts-po.test.ts index 9db81be7..588a5b36 100644 --- a/test/e2e/scripts-po.test.ts +++ b/test/e2e/scripts-po.test.ts @@ -4,19 +4,12 @@ import { sampleDir, } from "./scripts-e2e-util"; import { joinLines } from "../test-util/test-util"; -import { unlinkSync } from "fs"; import { join } from "path"; -import { getDebugPath } from "../../src/util/util"; const assetDir = "po-generic"; const testScript = "./po_generic.sh"; const mainTarget = join(assetDir, "es.po"); -const nonCachedTarget = join(assetDir, "nested-fruits.po"); -const targetPaths: string[] = [ - mainTarget, - join(assetDir, "de.po"), - nonCachedTarget, -]; +const targetPaths: string[] = [mainTarget, join(assetDir, "de.po")]; test("po clean", async () => { const output = await runSampleScript(testScript, [assetDir]); @@ -29,15 +22,6 @@ test("po clean", async () => { ); }); -test("po re-create non-cached target", async () => { - const removeTarget = nonCachedTarget; - unlinkSync(join(sampleDir, removeTarget)); - const output = await runSampleScript(testScript, [assetDir]); - expect(output).toContain( - `Write target ${getDebugPath(join(sampleDir, removeTarget))}` - ); -}); - test("po delete stale translations", async () => { injectPrefixLines({ path: join(sampleDir, mainTarget), diff --git a/test/e2e/scripts-xml-generic.test.ts b/test/e2e/scripts-xml-generic.test.ts index 14caf70a..f920946a 100644 --- a/test/e2e/scripts-xml-generic.test.ts +++ b/test/e2e/scripts-xml-generic.test.ts @@ -1,18 +1,11 @@ import { replaceLines, runSampleScript, sampleDir } from "./scripts-e2e-util"; import { joinLines } from "../test-util/test-util"; -import { unlinkSync } from "fs"; import { join } from "path"; -import { getDebugPath } from "../../src/util/util"; const assetDir = "xml-generic"; const testScript = "./xml_generic.sh"; const mainTarget = join(assetDir, "de.xml"); -const nonCachedTarget = join(assetDir, "nested-fruits.xml"); -const targetPaths: string[] = [ - join(assetDir, "ar.xml"), - mainTarget, - nonCachedTarget, -]; +const targetPaths: string[] = [join(assetDir, "ar.xml"), mainTarget]; test("xml clean", async () => { const output = await runSampleScript(testScript, [assetDir]); @@ -25,14 +18,6 @@ test("xml clean", async () => { ); }); -test("xml re-create non-cached target", async () => { - unlinkSync(join(sampleDir, nonCachedTarget)); - const output = await runSampleScript(testScript, [assetDir]); - expect(output).toContain( - `Write target ${getDebugPath(join(sampleDir, nonCachedTarget))}` - ); -}); - test("xml delete stale translations", async () => { replaceLines({ path: join(sampleDir, mainTarget), diff --git a/test/e2e/scripts-yaml.test.ts b/test/e2e/scripts-yaml.test.ts index fa3113eb..f9faf032 100644 --- a/test/e2e/scripts-yaml.test.ts +++ b/test/e2e/scripts-yaml.test.ts @@ -4,19 +4,13 @@ import { sampleDir, } from "./scripts-e2e-util"; import { joinLines } from "../test-util/test-util"; -import { unlinkSync } from "fs"; import { join } from "path"; import { getDebugPath } from "../../src/util/util"; const assetDir = "yaml"; const ymlScript = "./yaml_ecommerce.sh"; const mainTarget = join(assetDir, "es_ecommerce.yml"); -const nonCachedTarget = join(assetDir, "nested-fruits.yml"); -const targetPaths: string[] = [ - mainTarget, - join(assetDir, "de_ecommerce.yml"), - nonCachedTarget, -]; +const targetPaths: string[] = [mainTarget, join(assetDir, "de_ecommerce.yml")]; test("yml clean", async () => { const output = await runSampleScript(ymlScript, [assetDir]); @@ -29,15 +23,6 @@ test("yml clean", async () => { ); }); -test("yml re-create target", async () => { - const targetPath = nonCachedTarget; - unlinkSync(join(sampleDir, targetPath)); - const output = await runSampleScript(ymlScript, [assetDir]); - expect(output).toContain( - `Write target ${getDebugPath(join(sampleDir, targetPath))}` - ); -}); - test("yml delete stale translations", async () => { const path = join(sampleDir, mainTarget); injectPrefixLines({