💻
alt:V Athena Docs v3.0.0
  • Info
    • Introduction
    • Patreon & Support
    • Athena Discord
    • FAQ
  • Installation
    • Common Issues
    • Windows
    • Linux (Ubuntu 20.04+)
    • Debugging
    • Updating
  • Info
    • Admin
    • Configuration
    • Console
    • Database
    • Hotkeys
    • Identifier
  • Plugins
    • Load Plugins
    • Create Plugins
    • Mods
    • Clothing
  • Controllers
    • What is a Controller?
    • Blip Controller
    • Interaction Controller
    • Marker Controller
    • Object Controller
    • Ped Controller
    • Text Label Controller
    • World Notification Controller
  • Systems
    • Interiors
    • Inventory & Items
    • Inventory Rules
    • Jobs
    • Time
    • Weather
  • Menus
    • Menu Types
    • Action Menus
    • Input Menu
    • Wheel Menu
  • Player
    • Admin-Commands
    • Animations
    • Attach Objects
    • Credits
    • Currency
    • Commands
    • Error Screen
    • Message
    • Meta
    • Notifications
    • Particle
    • Progress Bar
    • Save
    • Shard
    • Sound
    • Spinners
    • Task Timeline
  • Custom WebViews
    • Introduction
    • Your First Page
    • CSS Framework
  • Misc
    • Custom Sounds
    • Custom Streamers
    • Custom Icons
    • Adding Locale / Translations
    • Adding Vehicle Rules
    • Adding Whitelist
    • Adding Wheel Menus
    • Adding Parking Garages
Powered by GitBook
On this page
  • Importing into Locales
  • Using a Locale
Edit on GitHub
  1. Misc

Adding Locale / Translations

Learn how to add your own language to the locale system.

Start by creating a copy of en.ts from the src/core/shared/locale/languages folder and name it any ISO-639-1 two letter code. It needs to be a TypeScript file.

Example for English is: en Example for Deutsch is: de Example for Español is: es Example for русский is: ru

Inside the file you have just created you will have English examples. Translate them.

Variable placeholders are written with: % Variables will be replaced at runtime.

Locales must be written and present at the time of bootup.

setLanguage function must be used on client-side in order to change the language to your respective ISO-639-1 two letter code.

Importing into Locales

Inside of locale.ts in the src/core/shared/locale folder you'll find a bit of code for locales.

const locales: LocaleFormat = {
    en
    // Additional languages can be added here...
};

You need to import your locale. Here is how I would import a Deutsch locale.

import de from './languages/de'; // Importing the English Locale

const locales: LocaleFormat = {
    en,
    de
    // Additional languages can be added here...
};

Using a Locale

Once a locale is created you can change en in the same file of src/core/shared/locale to whatever your two-letter language identifier is. This will automatically convert most of the game mode to whatever language was written in your locale file.

PreviousCustom IconsNextAdding Vehicle Rules

Last updated 3 years ago