# Language Support (/docs/orbit-studios-resources/orbit-dynamichud-v2/language-support)



# Language Support [#language-support]

`orbit-dynamichud-v2` uses the `ox_lib` locale system. The same locale files supply text for the HUD, onboarding, control panel, settings sharing, interface modules, notifications, and configurable commands.

## Included Locales [#included-locales]

| Language | Locale | File              |
| -------- | ------ | ----------------- |
| English  | `en`   | `locales/en.json` |
| German   | `de`   | `locales/de.json` |
| Spanish  | `es`   | `locales/es.json` |
| French   | `fr`   | `locales/fr.json` |
| Swedish  | `sv`   | `locales/sv.json` |
| Turkish  | `tr`   | `locales/tr.json` |

## Select A Locale [#select-a-locale]

Set the replicated `ox:locale` convar before starting the resource.

```properties title="server.cfg"
setr ox:locale en

ensure ox_lib
ensure orbit-lib
ensure orbit-dynamichud-v2
```

For Swedish, use `setr ox:locale sv`. Restart `orbit-dynamichud-v2` after changing the convar or a locale file.

## Customize Existing Text [#customize-existing-text]

Edit values in the active JSON file while keeping its keys and nesting intact. Frontend `defaultTranslations` is the source of truth for UI keys; `locales/en.json` is the reference structure for backend-only runtime text and commands.

```json title="locales/en.json"
{
  "commands": {
    "controlpanel": "controlpanel",
    "customize": "customize",
    "desc": {
      "controlpanel": "Open the HUD control panel",
      "customize": "Open HUD customization"
    }
  }
}
```

Command names are locale values, not hard-coded strings. Changing a command value changes the command players enter. Keep command descriptions and parameter labels translated as well.

<Callout type="warn" title="Keep the synchronized structure">
  Frontend defaults are the source of truth for UI keys. Backend-only runtime and command keys remain part of the English locale contract. Do not remove a key merely because it is not visible on the current page; validate the complete source tree first.
</Callout>

## Validate locale parity [#validate-locale-parity]

Frontend source builds include an automated audit that compares frontend defaults, the Lua-to-NUI bridge, all backend locale files, command nesting, and runtime usage:

```bash
npm run check:locales
```

Run it after adding, renaming, or removing a translation. The command reports unused frontend keys, missing Lua bridge entries, locale drift, and mismatched command structures. A successful result confirms that every bundled language has the same required keys.

## Add A Language [#add-a-language]

1. Copy `locales/en.json` to a new locale file such as `locales/pt.json`.
2. Translate values only. Preserve every key, object, placeholder, and value type.
3. Keep interpolation placeholders such as `%s`, `{name}`, or `{value}` unchanged when present.
4. Validate the file as JSON.
5. Set `setr ox:locale pt` and restart the resource.

If a translated key is missing, `ox_lib` may fall back or expose the unresolved key depending on where it is used. Keeping all locale files structurally aligned avoids mixed-language UI.

## API Text [#api-text]

Notification titles default to the localized `notification_info`, `notification_warning`, `notification_err`, or `notification_success` label when no title is supplied. Progress bars can use `labelTranslation` and `descriptionTranslation`; otherwise their `label` and `description` values are displayed literally.

See [Interface APIs](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface) for those payloads and exact ox\_lib replacement guides, and [Commands](/docs/orbit-studios-resources/orbit-dynamichud-v2/commands) for every configurable command.
