DirkScripts Logo

Login With FiveM

Login

πŸ“š Library
β€Ί
Modules
β€Ί

locale

Locale

ℹ️ Shared Module

locale

Global function. Looks up a translation key and returns the translated string.

lua
local text = locale('fishing.reward_message', playerName, amount)
ParameterTypeRequiredDescription
strstringyesLocale key (dot-separated)
...string | numbernoFormat arguments for string interpolation

If the key doesn't exist it is automatically added as its own translation and saved.

lib.locale

Loads locale files and builds the translation dictionary. Loads locales/en.json first, then merges the target language on top.

lua
lib.locale('de') -- load German translations
lib.locale()     -- uses lib.getLocaleKey() default
ParameterTypeRequiredDescription
keystringnoLanguage key (default: lib.getLocaleKey())

lib.getLocales

Returns the full raw locale dictionary.

lua
local dict = lib.getLocales()

lib.getLocale

Gets a locale string from another resource and adds it to the local dictionary.

lua
local text = lib.getLocale('dirk_fishing', 'cast_prompt')
ParameterTypeRequiredDescription
resourcestringyesSource resource name
keystringyesLocale key

lib.getLocaleKey

Returns the current language key.

Returns the language code currently selected in the Localization section of dirk_lib's in-game configurator (defaults to en).

lua
local lang = lib.getLocaleKey() -- e.g. 'en'

lib.setLocale

Sets the locale to a different language. Client only.

lua
lib.setLocale('fr')

Copyright Β© 2026 DirkScripts.

Not affiliated with or endorsed by Rockstar North, Take-Two Interactive, or any other rights holders. FiveM is a copyright and registered trademark of Take-Two Interactive Software, Inc.
Our checkout system is provided by Tebex Limited, who manage payment processing, product delivery, and billing support. Prices shown in currencies other than GBP are approximate conversions updated daily. All purchases are processed in GBP, so the final amount charged may vary depending on your bank or payment provider’s exchange rate.