Skip to content

GLocale

googer_ edited this page Nov 13, 2024 · 2 revisions

About GLocale

Default language library is a library in gmod that for some ungodly reason is only accessible on client and has a terrible API. GLocale was made to be perfect for localisation as it offers support for loading multiple language translations at the same time, combined literal and translation strings in localised string, and loading translations from .properties file from anywhere.

Capability locale

Info

  • ID: alt text locale
  • Accessed with: thorium.glocale

Functions

alt text GLocale.Add(placeholder: string, fulltext: string, lang: string|nil)
Add a translation string manually

alt text GLocale.LoadFromFile(filepath: string, gamepath: string, lang: string|nil)
Load translation strings from properties file

alt text GLocale.Localize(text: string, lang: string|nil) -> localized: string
Localize string. In string text, parts starting with "#" will be replaced with appropriate translation strings

Clone this wiki locally