File formats
Built-in formats, how plurals and placeholders round-trip, and how unknown formats are learned.
A format turns file bytes into entries (key, value, comment, plural forms) and entries back into a file. Built-in formats are code; learned formats are declarative templates the AI writes. Both run through the same interface, so everything else (dedupe, translation, review, pull) works the same for every file.
Built-in formats
| Format | Id | Extensions | Locales per file |
|---|---|---|---|
| Xcode String Catalog | xcstrings | .xcstrings | all |
| Flutter ARB | arb | .arb | one |
| JSON (key/value, i18next) | json | .json | one |
| YAML (Rails i18n) | yaml | .yml .yaml | one |
| Apple .strings | ios-strings | .strings | one |
| Apple .stringsdict | ios-stringsdict | .stringsdict | one |
| Android strings.xml | android-xml | .xml | one |
| Gettext PO/POT | gettext-po | .po .pot | one |
| XLIFF 1.2 / 2.0 | xliff | .xlf .xliff | all |
| Java .properties | properties | .properties | one |
| .NET RESX | resx | .resx | one |
| CSV / TSV (multi-locale) | csv | .csv .tsv | all |
| Plain text (whole file) | text | .txt .md .markdown | one |
Detection and locales
push_file scores every format against the file name and content and picks the most confident. Pass format to force one, or call detect_format to see the candidates without storing anything. The locale of a single-locale file comes from its path (locales/es.json, es.lproj, values-pt-rBR, messages_de.properties) or from locale. Paths are stored as patterns such as locales/{locale}.json, so one file record covers every locale.
What survives a round trip
- Plurals are read into CLDR categories (zero, one, two, few, many, other) and written back in the format's own structure.
- Comments become the string's context, which the translator sees, and are written back where the format has them.
- Placeholders (printf, braces, ICU arguments, template literals, HTML tags) are checked on every translation. A translation that changes them is rejected with
placeholder_mismatchor held for review. - ICU messages (next-intl, FormatJS:
{count, plural, one {# image} other {# images}},select,selectordinal,<link>…</link>) are checked by structure: only the branch text is translated; argument names and types, select keys,=0branches,#and tags stay; and plural branches follow the target language (Japanese has onlyother, Russian and Polish needone few many other). The model andlist_missing_translationsare told each locale's categories (icu_plural_categories). - Layout: serializers start from the file as last imported, so ordering, headers and format-specific attributes are kept where the format allows.
Broken files
A file a format recognizes but cannot fully read (a trailing comma in JSON, an unclosed tag in strings.xml, an unterminated string in .strings) is rejected whole with 422 unreadable_file, the problems listed by line in errors. Nothing is imported, no key is removed and the file you pushed before stays in use, so fix the file and push it again. The release gate fails the same commit with unreadable_source.
Adapted files: store listings, keywords, marketing copy
Some content should not be a translation of the source. App Store keywords differ by market because people search for different words, and a listing's description leads with what each audience cares about. A file's localization says which kind it is:
- translate (the default): strings are shared across the workspace by source text and translated again when the source changes.
- adapt: every locale is written for its market. Each key keeps a string of its own, a source change never replaces a locale's text, and the locale is marked behind the source instead. AI only fills locales that have nothing yet, writing for the market rather than word for word, and store limits are enforced on every write.
fastlane metadata (fastlane/metadata/<locale>/*.txt) is adapted by default. Choose for any file with set_file_localization, push_file's localization, or an entry in .glossa.json. Then an agent works on every locale at once: get_file_strings shows each string in every locale with its length, limit and whether it is behind; set_source_text edits the source from a chat; propagate_source_change keeps each locale as it is or lets Claude make the smallest edit that carries the change over; submit_translations writes new texts. glossa pull writes an edited source file back to the repo too.
{ "project": "ios", "files": [ "locales/en.json", { "source": "fastlane/metadata/en-US", "localization": "adapt" }, { "source": "web/content/en/pricing.md", "localization": "adapt" } ]}Formats it has never seen
When no format is confident about a file, it is not rejected. Instead:
- The file is stored with status
needs_formatand alearn_formatjob starts. You can also start one yourself with a hint about the structure. - The AI reads a sample and writes a declarative template: where keys, values, comments and plurals are. The template is validated against your file; one that reads nothing is rejected.
- A
learn_formattask asks a reviewer tokeep,retireorretry_with_hint. - Kept templates are stored in your workspace and read every similar file from then on, with no model call.
npx @meterapp/glossa detect_format --json '{"filename":"strings.ts","content":"…"}'npx @meterapp/glossa learn_format --json '{"project":"web","path":"i18n/strings.ts","content":"…","hint":"TS object; keys are property names"}'npx @meterapp/glossa list_formats