Skip to content

Conversation

@bparrish17
Copy link

@bparrish17 bparrish17 commented Dec 16, 2025

Overview

Updated all /v2/{textItems | components}/export formats (ios, android, icu) to use a shared BaseExportFormatter abstract class that's the bulk logic for this PR. This was mostly pulled over from the original ios-strings implementation and made a bit more format-agnostic for the rest of the use cases.

Added format classes and their respective output configs and what not:

  • IOS .stringsdict

  • Android .xml

  • ICU .json

  • Updated base formatter class's generateQueryParams function to be less awkward

  • Fixed my old weird HTTP wrapper thing

Context

DIT-11971: [CLI] ICU Format
DIT-11972: [CLI] IOS Strings Dict Format
DIT-11960: [CLI] Android Format

Test Plan

Setup:

I like this config.yml file, it puts everything in one directory and lets you check by format. Just replace the projects and variants configured here with a couple of your local projects/variants that you use regularly. Make sure they have some variables and variant usage in both text items and components that you can test.

projects:
  - id: dittopay-v2-qa-file-bp-copy
  - id: cli-testing-project
variants:
  - id: base
  - id: spanish
  - id: japanese
components:
  folders:
    - id: root
outputs:
  - format: json
    outDir: "./ditto/formats/json"

  - format: json
    outDir: "./ditto/formats/json-i18next"
    framework: i18next

  - format: json
    outDir: "./ditto/formats/json-vue-i18n"
    framework: vue-i18n

  - format: icu
    outDir: "./ditto/formats/icu"

  - format: android
    outDir: "./ditto/formats/android-xml"

  - format: ios-strings
    outDir: "./ditto/formats/ios-strings"

  - format: ios-stringsdict
    outDir: "./ditto/formats/ios-stringsdict"

  • Android .xml files are outputted as expected
  • Android .xml files have the correct text items and components content (can check against default json)
  • IOS .strings files are outputted as expected
  • IOS .strings files have the correct text items and components content (can check against default json)
  • IOS .stringsdict files are outputted as expected
  • IOS .stringsdict files have the correct text items and components content (can check against default json)
  • ICU .json files are outputted as expected
  • ICU .json files have the correct text items and components content (can check against default json)

@bparrish17 bparrish17 requested a review from joustrich December 16, 2025 15:18
@bparrish17 bparrish17 changed the title [DIT-11792] IOS Strings Dict, Android, ICU format additions [DIT-11792][DIT-11791][DIT-11960] IOS Strings Dict, Android, ICU format additions Dec 16, 2025
Comment on lines 55 to 56
const textItemsMap = await this.fetchTextItemsMap();
const componentsMap = await this.fetchComponentsMap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about fetching in parallel to speed this up?

Suggested change
const textItemsMap = await this.fetchTextItemsMap();
const componentsMap = await this.fetchComponentsMap();
const [textItemsMap, componentsMap] = await Promise.all([
this.fetchTextItemsMap(),
this.fetchComponentsMap(),
]);

}),
format: this.exportFormat,
};
const textItemsFileContent = await fetchText<TTextItemsResponse>(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parallelize this one as well by pushing to a promises array and awaiting them all at once?

}),
format: this.exportFormat,
};
const componentsFileContent = await fetchComponents<TComponentsResponse>(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as text items -- Can we parallelize this one as well by pushing to a promises array and awaiting them all at once?

Copy link

@joustrich joustrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple suggestions to parallelize the data fetching, but otherwise looks good!

@bparrish17 bparrish17 merged commit 7cfe2f2 into string-file-formats Dec 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants