@concircle/i18n-ai-translator
A CLI that translates a UI5 app's i18n.properties with OpenAI and writes the language files back, masking placeholders, applying a glossary and caching what has been translated.
A UI5 app ships its texts as i18n.properties, and every further language is another file somebody fills in by hand or sends out to be translated. This reads the base bundle and writes i18n_de.properties and its siblings back into the project, in missing mode for the keys with no text yet or overwrite for all of them. It masks the placeholders before sending the text to the model and validates that they are still present afterwards, and a glossary of shared and per-language terms sets a term's target word, Order to Auftrag in its own example. A local cache keyed on the provider, the model, the two languages and the source value holds what has been translated, so it is the text rather than the property key that decides whether a request repeats. It installs as a devDependency and runs as i18n-ai-translator from an npm script, or as a Translator class and a translateProject helper from Node; OpenAI is the only provider the configuration takes, and the key comes from OPENAI_API_KEY or the config file.
Facts
Where it sits
Who is behind it
In the atlas: maintains 1@concircleHerbert KaintzHerbert KaintzMaintains this
In the atlas: maintains 1, contributes to 1@hkaintzmaintainers
What it declares
Every artifact
- Type
- CLI
- Origin
- Independently maintained
- Runtime
- Node.js
As a CLI
- Distributed through
- npm
Connections
Serving labels, messages and content per user locale
Download
Install
npm add @concircle/i18n-ai-translatorDerived from the package name. No recipe recorded; the README has the configuration.
README
quoted from concircle/i18n-ai-translator under MIT, read@concircle/i18n-ai-translator
|
Translates UI5 i18n.properties files with OpenAI, preserves placeholders, supports glossary terms, and writes language-specific .properties files.
|
Features
- Preserves placeholders like
{0},{name},%s,${variable}, and%1$s - Supports
missingandoverwritetranslation modes - Applies shared and language-specific glossary terms
- Writes UI5-style language files such as
i18n_de.properties - Supports optional Unicode escaping with per-language overrides
- Uses a local cache to avoid repeated translation requests
Installation
npm install --save-dev @concircle/i18n-ai-translator
CLI
Example package.json script:
{
"scripts": {
"i18n:translate": "i18n-ai-translator --input ./webapp/i18n/i18n.properties --languages de,fr --mode missing"
}
}
Show CLI help:
npx i18n-ai-translator --help
Enable Unicode escaping:
{
"scripts": {
"i18n:translate": "i18n-ai-translator --input ./webapp/i18n/i18n.properties --languages de,fr --mode missing --encode-unicode"
}
}
Configuration
Example i18n-ai.config.json:
{
"sourceLanguage": "en",
"targetLanguages": ["de", "uk"],
"translationMode": "missing",
"encodeUnicode": false,
"languageOptions": {
"de": { "encodeUnicode": true },
"uk": { "encodeUnicode": false }
},
"provider": "openai",
"providerOptions": {
"apiKey": "sk-...",
"model": "gpt-4.1-mini",
"temperature": 0,
"maxOutputTokens": 4000
},
"files": {
"input": "./webapp/i18n/i18n.properties"
},
"cache": {
"enabled": true,
"ttlMs": 604800000
},
"batchSize": 20,
"verbose": false
}
Supported top-level config fields:
interface TranslatorConfig {
sourceLanguage?: string;
targetLanguages: string[];
translationMode?: 'missing' | 'overwrite';
encodeUnicode?: boolean;
languageOptions?: Record<string, { encodeUnicode?: boolean }>;
provider?: 'openai';
providerOptions?: {
apiKey?: string;
model?: string;
baseURL?: string;
organization?: string;
temperature?: number;
maxOutputTokens?: number;
};
files?: {
input?: string;
outputDir?: string;
languageFilePattern?: string;
};
glossary?: GlossaryConfig | string;
cache?: {
enabled?: boolean;
ttlMs?: number;
dir?: string;
};
rules?: string[];
batchSize?: number;
verbose?: boolean;
}
Glossary
Example glossary file:
{
"shared": [
{
"source": "Order",
"target": "Auftrag",
"context": "SAP sales document"
}
],
"languages": {
"de": [
{
"source": "Plant",
"target": "Werk"
}
],
"uk": [
{
"source": "AI",
"target": "ШI"
}
]
}
}
Programmatic Usage
Translate a file directly:
import { Translator } from '@concircle/i18n-ai-translator';
const translator = new Translator({
sourceLanguage: 'en',
targetLanguages: ['de'],
translationMode: 'missing',
provider: 'openai',
providerOptions: {
apiKey: process.env.OPENAI_API_KEY
},
files: {
input: './webapp/i18n/i18n.properties'
}
});
const result = await translator.translateFile();
console.log(result);
Load config from file:
import { Translator } from '@concircle/i18n-ai-translator';
const translator = await Translator.fromConfig({
configPath: './i18n-ai.config.json'
});
const result = await translator.translateProject();
console.log(result);
Use the top-level helper:
import { translateProject } from '@concircle/i18n-ai-translator';
const result = await translateProject({
inputPath: './webapp/i18n/i18n.properties',
languages: ['de'],
dryRun: true
});
console.log(result);
Translation Modes
missing: only translates keys that are missing or empty in the target fileoverwrite: retranslates all keys from the source file
Placeholder Handling
The translator masks placeholders before sending text to the model and validates that they are still present afterwards.
Supported placeholder styles:
{0},{1}{name},{email}%s,%d%1$s,%2$d${variable}
Output Files
By default, UI5-style language files are generated next to the source file:
i18n.propertiesi18n_de.propertiesi18n_fr.properties
You can override the output directory or file naming pattern in files.outputDir and files.languageFilePattern.
Cache
Caching is enabled by default. Cache keys include:
- provider
- model
- source language
- target language
- source value
- glossary terms
- translation rules
Default cache location:
~/.i18n-ai-translator-cache/
Environment Variables
Supported environment variables:
export OPENAI_API_KEY=sk-...
export OPENAI_MODEL=gpt-4.1-mini
Examples
See examples/ for small runnable examples:
Development
npm run build
npm run lint
npm test
License
MIT © 2026 Herbert Kaintz - Concircle
Contributing
See CONTRIBUTING.md.
Security
See SECURITY.md.
History
Features 10, Docs 4
Notes
Added
- Initial beta release of @concircle/i18n-ai-translator
- OpenAI-powered translation for UI5 i18n.properties files
- Placeholder preservation ({0}, {name}, %s, ${var}, etc.)
- Glossary/Vocabulary support for domain-specific terms (e.g., SAP context)
- Optional caching system with TTL and glossary hash invalidation
- Batch-parallelized translation requests (up to 10 parallel)
- Extensible AI Provider architecture for future support (Claude, Gemini, etc.)
- Dual-output: CJS (.cjs) and ESM (.mjs) with TypeScript declarations
- Comprehensive test suite with placeholder preservation tests
- Full npm publishing support with quality gates
Documentation
- README.md with installation and quick start guide
- API documentation and configuration reference
- Contributing guidelines for community contributions
- Security policy for responsible disclosure
Others providing
Compare all 15 on the Localization page →- abap_btocs_deeplabap_btocs_deeplA plugin for the B-Tocs ABAP SDK that lets an SAP ABAP server translate with DeepL through an SM59 RFC destination, using a DeepL API key, with a demo program for the first call.independent, abapDeepL translation plugin for the B-Tocs ABAP SDKfrom ABAP
- abap_btocs_libtrlabap_btocs_libtrlA plugin for the B-Tocs ABAP SDK that lets an SAP ABAP server translate with LibreTranslate through an SM59 RFC destination, against an instance hosted on-premise, on a hyperscaler, on SAP BTP or as SaaS.independent, abapLibreTranslate plugin for the B-Tocs ABAP SDKfrom ABAP
- SAP Translation HubSAP Translation HubSAP's translation service for software texts and documents, drawing on repositories of verified and company translations and on machine translation by SAP's neural MT or large language models.sap official, btpTranslation service for software texts and documentsfrom BTP/BAIP
- com.sap.cds:cds-services-bomcom.sap.cds:cds-services-bomThe Maven bill of materials for CAP Java, pinning every com.sap.cds module in a release, from the API and core runtime to the Spring Boot starters and the CQN engine, to the same version.sap official, capMaven bill of materials pinning CAP Java module versionsfrom CAP
- ABAP_DeepL_clientABAP_DeepL_clientAn ABAP client for the DeepL translation service, so text can be sent for translation from inside the system rather than through a tool outside it.independent, abapABAP client for the DeepL translation servicefrom ABAP
- LISALISAAn MCP server that lets an AI client read and write the translations of ABAP repository objects through three tools, backed by an ABAP HTTP service on SAP's XCO i18n APIs.independent, abapMCP server for reading and writing ABAP object translationsfrom ABAP
- ABAP_TRANSLATION_HUBABAP_TRANSLATION_HUBA report that pushes an ABAP object list to SAP Translation Hub and pulls the finished translations back, meant to run as a job after the evaluation job has finished.independent, abapReport pushing ABAP objects to SAP Translation Hub and backfrom ABAP
- abap-form-translatorabap-form-translatorA runtime translation layer for Smartform and Adobe form labels, matching structure fields against a table maintained in a RAP Fiori app, so a label changes without SE63 or a transport.independent, abapRuntime translation layer for SAP form labels, kept in a tablefrom ABAP
- ui5-i18n-excel-converterui5-i18n-excel-converterA command-line tool that exports a UI5 app's i18n properties files to an Excel sheet of keys and languages for translators and imports the translated sheet back into the files.independent, ui5CLI converting UI5 i18n properties files to Excel and backfrom UI5
- ZOTR_UTILITYZOTR_UTILITYA small ABAP framework that reads language-dependent texts from SAP's online text repository through inheritance and named constants rather than a direct API call with a string alias.independent, abapABAP framework reading texts from SAP's online text repositoryfrom ABAP
- ZABAP_TRANSLATIONSZABAP_TRANSLATIONSAn ABAP tool that exports the texts of a package or program to an Excel file and imports them back in bulk once translated, covering eight object types from programs and classes to domain values.independent, abapExcel export and import of ABAP package or program textsfrom ABAP
- @sap/cds@sap/cdsThe CAP Node.js runtime, which compiles the CDS model, serves the services declared in it, answers generic requests before any handler runs, and loads every cds-plugin.sap official, capCAP Node.js runtimefrom CAP
- @sap-ux/i18n@sap-ux/i18nA library that reads and writes the i18n bundles of a UI5 or CAP project from Node code, the i18n.properties file of a UI5 app and the i18n folder of a CAP project alike.sap official, ui5Reader and writer for i18n bundles of UI5 or CAP projectsfrom UI5
- XLF TranslatorXLF TranslatorTakes an uploaded XLIFF file and makes every entry that carries a translation element editable in the page, aimed mainly at the ABAP Cloud content the Maintain Translation app generates.independent, abapEditor for the translations in an uploaded XLIFF filefrom ABAP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:concircle-i18n-ai-translator- JSON
- /artifacts/concircle-i18n-ai-translator.json
- MCP
- Connecting an agent