---
title: "ui5"
description: "The preset for SAPUI5 and OpenUI5. It reads .properties bundles, {i18n>key} bindings and getResourceBundle().getText calls."
canonical_url: "https://x18n.dev/presets/ui5"
---
# ui5

> The preset for SAPUI5 and OpenUI5. It reads .properties bundles, \{i18n>key} bindings and getResourceBundle().getText calls.

The `ui5` preset supports [UI5](https://ui5.sap.com) apps, SAPUI5 and OpenUI5.

## Detection

The preset applies when the project depends on `@ui5/cli`.

```ts [x18n.config.ts]
import { defineConfig } from '@x18n/core'

export default defineConfig({
  presets: ['ui5'],
})
```

## Locale files

If your config has no `resources`, the preset uses `webapp/i18n/i18n_{locale}.properties` and `webapp/i18n/i18n.properties`. The `properties` format reads and writes these files. Keys stay flat.

`i18n.properties` has no locale in its name, so it holds the source locale. With the default `sourceLocale: 'en'`, these files give the locales `en` and `de`:

```properties [webapp/i18n/i18n.properties]
appTitle=App
hello=Hello {0}
```

```properties [webapp/i18n/i18n_de.properties]
appTitle=Anwendung
```

## Supported syntax

In XML views, JSON files, JS and TS, the preset reads `{i18n>key}` bindings. In JS and TS, it also reads `getResourceBundle().getText('key')`:

<!-- eslint-skip -->

```xml [webapp/view/Main.view.xml]
<Page title="{i18n>appTitle}" />
```

```js [webapp/controller/Main.controller.js]
this.getResourceBundle().getText('hello')
```

## Placeholders

Braces: `{0}`, `{name}`.

## Extraction templates

| Kinds                      | Files      | Template                                    |
| -------------------------- | ---------- | ------------------------------------------- |
| any                        | `**/*.xml` | `{i18n>{key}}`                              |
| `js-string`, `js-template` | any        | `this.getResourceBundle().getText('{key}')` |


## Sitemap

See the full [sitemap](https://x18n.dev/sitemap.md) for all pages.
