@sap-ux/i18n
A 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.
A tool that edits an application's texts has to open two different things: the i18n.properties file of a UI5 app, and the i18n folder a CAP project's CDS environment points at. This package opens both, through the four functions its README documents: getPropertiesI18nBundle and getCapI18nBundle return a bundle, createPropertiesI18nEntries and createCapI18nEntries add entries to one, and the CAP calls take the project root and the CDS i18n settings as arguments rather than working them out themselves. Nothing in it serves a text at request time, so it answers the file half of localization and not the runtime half that @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, cap and the UI5 resource bundle answer. Its own README sends a project that wants higher-level APIs to its sibling @sap-ux/project-access.
Facts
Where it sits
Who is behind it
In the atlas: maintains 7, contributes to 25@devineaSAPSAPMaintains this
In the atlas: maintains 137, wrote 14@SAPmaintainersAndis RedmansContributes to this
In the atlas: contributes to 13@815areCian MorrinContributes to this
In the atlas: contributes to 15@cianmSAPDonal Tobin (SAP)Contributes to this
In the atlas: contributes to 13@donal-tobin-sapfionan-SAPContributes to this
In the atlas: contributes to 14@fionan-SAPDominik HeimContributes to this
In the atlas: contributes to 25@heimwegeKlaus KellerContributes to this
In the atlas: contributes to 15@Klaus-KellerMaruf RasullyContributes to this
In the atlas: contributes to 12@marufrasullyVilim MikicContributes to this
In the atlas: contributes to 16@mikicvi-SAPmmilko01Contributes to this
In the atlas: contributes to 12@mmilko01Nafees AhmedContributes to this
In the atlas: contributes to 11@nahmed2211 contributors
What it declares
Every artifact
- Type
- Package
- Origin
- By SAP
- Runtime
- Node.js
As a package
- Where it runs
- does not say
- Distributed through
- npm
Connections
Serving labels, messages and content per user locale
Download
Install
npm add @sap-ux/i18nDerived from the package name. No recipe recorded; the README has the configuration.
README
quoted from SAP/open-ux-tools under Apache-2.0, read@sap-ux/i18n
Package containing low level APIs and utility functions for working with i18n of a project. For more convenient high level APIs on i18n, check @sap-ux/project-access
Installation
Npm
npm install --save @sap-ux/i18n
Yarn
yarn add @sap-ux/i18n
Pnpm
pnpm add @sap-ux/i18n
Usage
Read i18n bundle from a CAP project
import { getCapI18nBundle } from '@sap-ux/i18n';
import { join } from 'path';
/**
* Sample CDS environment
**/
const env = Object.freeze({
i18n: {
folders: ['_i18n', 'i18n', 'assets/i18n'],
default_language: 'en'
}
});
const PROJECT_ROOT = 'absolute/path/to/project';
const filePaths = [join(PROJECT_ROOT, 'srv', 'service.cds')];
const bundle = await getCapI18nBundle(PROJECT_ROOT, env, filePaths);
For detailed example usage check unit test of getCapI18nBundle
Read i18n properties file of a project
import { getPropertiesI18nBundle } from '@sap-ux/i18n';
import { join } from 'path';
import { getWebappPath } from '@sap-ux/project-access';
const PROJECT_ROOT = 'absolute/path/to/project';
const i18nFilePath = join(await getWebappPath(PROJECT_ROOT), 'i18n', 'i18n.properties');
const bundle = await getPropertiesI18nBundle(i18nFilePath);
For detailed example usage check unit test of getPropertiesI18nBundle
Write to i18n file of a CAP project
import { createCapI18nEntries } from '@sap-ux/i18n';
import { join } from 'path';
const newEntries = [
{
key: 'NewKey',
value: 'New Value'
}
];
/**
* Sample CDS environment
**/
const env = Object.freeze({
i18n: {
folders: ['_i18n', 'i18n', 'assets/i18n'],
default_language: 'en'
}
});
const PROJECT_ROOT = 'absolute/path/to/project';
const cdsFilePath = join(PROJECT_ROOT, 'src', 'service.cds')
const result = await createCapI18nEntries(PROJECT_ROOT, cdsFilePath, newEntries, env);
For detailed example usage check unit test of createCapI18nEntries
Write to i18n properties file of a project
import { createPropertiesI18nEntries } from '@sap-ux/i18n';
import { join } from 'path';
import { getWebappPath } from '@sap-ux/project-access';
const newEntries = [
{
key: 'NewKey',
value: 'New Value'
}
];
const PROJECT_ROOT = 'absolute/path/to/project';
const i18nFilePath = join(getWebappPath(PROJECT_ROOT), 'i18n', 'i18n.properties');
const result = await createPropertiesI18nEntries(i18nFilePath, newEntries, PROJECT_ROOT);
For detailed example usage check unit test of createPropertiesI18nEntries
For more available APIs, check in /src/index
Keywords
i18n CAP i18n UI5 i18n
History
Dependencies 2
Notes
Patch Changes
Dependency Updates
- Upgrade vscode-languageserver-textdocument 1.0.12 → 1.0.15, vscode-languageserver-types 3.18.0 → 3.18.4, @vscode-logging/logger 2.0.9 → 2.0.10 [35f731a]
Workspace Updates
- @sap-ux/text-document-utils 1.0.3 → 1.0.4
Fixes 2
Notes
Released: 2026-06-03T14:58:37Z
Patch Changes
- 21a3de7: FIX: TypeScript type errors in test files (ESM migration follow-up)
- Updated dependencies [21a3de7]
- @sap-ux/text-document-utils@1.0.1
Breaking 1, Fixes 1
Notes
Released: 2026-05-30T20:54:07Z
Major Changes
-
32609a7: # Migration to ECMAScript Modules (ESM)
Packages in the SAP Open UX Tools monorepo have been migrated from CommonJS (CJS) to ECMAScript Modules (ESM) with NodeNext module resolution.
'@sap-ux/backend-proxy-middleware-cf' is experimental and will remain at major version 0. '@sap-ux/generator-odata-downloader' is a top level yeoman generator and will remain as CJS until validation as ESM is done.
What Changed
- Module System: Most packages now use native ESM (
"type": "module"in package.json) - TypeScript Configuration: Updated to
module: "NodeNext"andmoduleResolution: "NodeNext" - Import Statements: All relative imports now include explicit
.jsextensions (per ESM spec) - Build Output: Generated JavaScript files are now ESM modules
- Node.js Requirement: Minimum Node.js version remains >=22.x
Jest Configuration (for Testing)
If your project tests code that imports these packages, update your Jest configuration:
export default { extensionsToTreatAsEsm: ['.ts'], transform: { '^.+\\.ts$': ['ts-jest', { useESM: true }] } };And run Jest with:
NODE_OPTIONS='--experimental-vm-modules' jest - Module System: Most packages now use native ESM (
Patch Changes
- Updated dependencies [32609a7]
- @sap-ux/text-document-utils@1.0.0
-
Features 1, Fixes 1
Notes
Released: 2026-05-15T08:12:20Z
Minor Changes
- 72695e5: chore: drop Node 20 support as it is no longer maintained
Patch Changes
- Updated dependencies [72695e5]
- @sap-ux/text-document-utils@0.4.0
Fixes 2
Notes
Released: 2026-05-14T11:45:51Z
Patch Changes
- 50a8ba5: chore: fresh release after workflow updates
- Updated dependencies [50a8ba5]
- @sap-ux/text-document-utils@0.3.5
Fixes 1
Notes
Released: 2026-04-30T14:23:24Z
Patch Changes
- Updated dependencies [c160401]
- @sap-ux/text-document-utils@0.3.4
- Updated dependencies [c160401]
Fixes 1
Notes
Released: 2026-03-26T12:07:04Z
Patch Changes
- a41533f: chore(i18n): upgrade vscode-languageserver-textdocument 1.0.11 → 1.0.12
Fixes 1
Notes
Released: 2026-02-23T22:35:31Z
Patch Changes
- fd8de2b: fix(deps): update dependency jsonc-parser to v3.3.1
Fixes 1
Notes
Released: 2026-02-23T19:07:48Z
Patch Changes
- cc1c422: fix(deps): update dependency npm-run-all2 to v8
Fixes 2
Notes
Released: 2025-12-15T10:50:50Z
Patch Changes
- 4ecfbe2: Chore - upgrade eslint devDependenies, convert to flat config and fix lint issues.
- Updated dependencies [4ecfbe2]
- @sap-ux/text-document-utils@0.3.3
Fixes 2
Notes
Released: 2025-11-05T06:53:42Z
Patch Changes
- cfe9c13: Add deep link to package and changelog to README.md
- Updated dependencies [cfe9c13]
- @sap-ux/text-document-utils@0.3.2
Fixes 1
Notes
Released: 2025-08-13T10:00:10Z
Patch Changes
- Updated dependencies [c7db726]
- @sap-ux/text-document-utils@0.3.1
- Updated dependencies [c7db726]
Fixes 1
Notes
Released: 2025-06-24T07:18:46Z
Patch Changes
- f9ea9e3: feat: Enhance ADP FLP configuration generator
Features 1, Fixes 1
Notes
Released: 2025-05-14T22:35:53Z
Minor Changes
- a28357d: chore - drop node18 support as it is out of maintenance
Patch Changes
- Updated dependencies [a28357d]
- @sap-ux/text-document-utils@0.3.0
Fixes 1
Notes
Released: 2025-03-04T08:55:15Z
Patch Changes
- cf05ceb: Update
vscode-languageserver-textdocumentdependency
- cf05ceb: Update
Fixes 1
Notes
Released: 2025-02-27T14:15:03Z
Patch Changes
- 4b8577f: fix: usage of static webapp path
Fixes 1
Notes
Released: 2025-02-05T17:08:20Z
Patch Changes
- 78bc772: Introduce ADP FLP config generator
Features 1
Notes
Released: 2024-08-30T06:05:30Z
Minor Changes
- df29368: Methods
createCapI18nEntries,getCapI18nFolder- handle absolute path to cds file instead of relative path
- df29368: Methods
Fixes 2
Notes
Released: 2024-08-07T11:06:05Z
Patch Changes
- ac22b7e: feat: new package for text document utility functions and types
- Updated dependencies [ac22b7e]
- @sap-ux/text-document-utils@0.2.0
Breaking 1, Features 1
Notes
Released: 2024-07-05T15:03:05Z
Minor Changes
- c2359077: [BREAKING CHANGE] Change TypeScript transpile target to ES2021 to align with NodeJS 18+
Fixes 1
Notes
Released: 2024-05-31T13:42:35Z
Patch Changes
- f80a4256: chore - upgrade jest 29.7.0 - change in src to check object is defined before accessing it.
Fixes 1
Notes
Released: 2024-04-15T19:27:29Z
Patch Changes
- 03167a06: add utility method to extract mustache key
Fixes 1
Notes
Released: 2024-03-18T10:40:39Z
Patch Changes
- cc95c0a8: Fix infinite loop when comment on last line of properties file
Fixes 1
Notes
Released: 2024-02-27T22:07:50Z
Patch Changes
- c15435b6: fix: remove engines pnpm from package.json
Fixes 1
Notes
Released: 2024-02-19T10:29:40Z
Patch Changes
- 76ce5c2f: fix: expose getI18nPropertiesPaths and export types for browser in @sap-ux/i18n
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
- @concircle/i18n-ai-translator@concircle/i18n-ai-translatorA 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.independent, ui5CLI translating UI5 i18n.properties files with OpenAIfrom UI5
- 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
- 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
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-ux-i18n- JSON
- /artifacts/sap-ux-i18n.json
- MCP
- Connecting an agent