wasd
DiscordTebex
  • Welcome
  • Getting Started
    • What is Escrow
  • Other Things
    • Editing localization files
  • Resources
    • Mix-Weed
      • Installation
      • How To Do
        • Items
        • Config
      • Modules
        • Weed Type
        • Recipe Type
          • Recipe onUsed
    • ATM Robbery [Free]
      • Items
    • 24/7 Shop
    • Multiplayer Delivery Job
    • 🗞️Multiplayer Newspaper Job
    • Multiplayer Garbage Job
    • Multiplayer Tow Job
      • Exports / Events
    • Daily Rewards Script
Powered by GitBook
On this page
  1. Other Things

Editing localization files

How do locale files work?


Editing Localization Files

ox_lib provides a built-in localization system using JSON files stored in the locales folder. The lib.locale() function is responsible for loading the appropriate localization file based on the server’s configuration.

Default Localization File

By default, locales/ox:locale|en>.json as the primary localization file. However, this can be changed based on the server configuration.

Setting the Localization Language

The server owner can specify a different localization file by setting the ox:locale value in server.cfg. The value assigned to ox:locale determines which file should be loaded.

For example:

set ox:locale "pt"

This configuration instructs ox_lib to load locales/pt.json instead of the default locales/en.json.

Adding a New Localization File

To support a new language, the server owner must:

  1. Create a new JSON file in the script locales folder, following the locales/en.json format.

  2. Ensure the correct ox:locale value is set in server.cfg.

  3. Populate the new JSON file with localized strings matching the existing structure.

Example: If the server's ox:locale is set to fr, then a corresponding locales/fr.json file should be created.

PreviousWhat is EscrowNextMix-Weed

Last updated 2 months ago