Framework
Locale

Framework Locale

Language files are automatically loaded from the locales folder, the default language is en

Change The Language

Add the following convar to your server.cfg to change the preferred language

setr bridge:locale en

Loading Languages

Add the following to your fxmanifest to load all locales

fxmanifest.lua
files {
    'bridge/**/**/client.lua',
    'bridge/**/*.lua',
    'locales/*.json'
}

Create Locale

locales/en.json
{
  "myname": "My Name Is {name}",
}

Getting Specific Locale String

Framework.Locale('myname', {  name = 'Sloppy' })

Returns

My Name Is Sloppy

Locale

Get Specific Language String

Framework.Locale(key, params)
  • key: string
  • params: table
Framework.Locale('mykey', {  myvalue = 'My Value' })

returns: string

Locales

Get Language Table

Framework.Locales()

returns: table