Skip to content

Service · inherits Instance

LocalizationService

Official docs ↗

Handles automated translation.

About LocalizationService

LocalizationService is the service responsible for handling automated translation.

It is used as a storage for LocalizationTable objects used by automatic text replacement.

LocalizationService will only use its child LocalizationTables for automatic text replacement unless GuiBase2d.RootLocalizationTable is specified on a GUI object or its ancestors.

Properties 2

  • RobloxLocaleId: stringReadOnlyNotReplicatedThe locale ID used for localizing core and internal features.

    This property shows the locale ID used for the localization of core and internal features such as CoreGui. Returns a string with the two letter code (for example, en-us) for the locale.

  • SystemLocaleId: stringReadOnlyNotReplicatedThe locale ID that the local player has set for their operating system.

    This property shows the locale ID that the local player has set for their operating system.

    This will return a string with the two letter code (for example, "en-us") for the locale.

    See also Player.LocaleId, the locale ID that a user has set for their Roblox account which is used for localizing in-experience content. This will be a different value when that player's account locale isn't supported for localizing Roblox UI content.

Methods 5

  • GetCorescriptLocalizations() → InstancesReturns a list of LocalizationTable objects used for localizing core scripts.
  • GetCountryRegionForPlayerAsync(player: Instance) → stringYieldsReturns country/region code string according to player's client IP geolocation.

    Returns a country/region code string according to player's client IP geolocation. The supported country/region codes are as follows:

    See also:

  • GetTableEntries(instance: Instance = nil) → ArrayGets all entries used for automated localization.

    Returns an Array, where each element of the returned Array is itself an Array of entries in the same format as described in LocalizationTable.GetEntries. The order of the elements in the returned Array is the same order that the LocalizationTables will be searched through to attempt automated localization for the provided Instance. The entry elements within a particular LocalizationTable are returned in an unspecified order.

    This function returns entries regardless of whether the object is a GuiBase2d with GuiBase2d.AutoLocalize enabled. An object that is a GuiBase2d will not actually be automatically localized unless GuiBase2d.AutoLocalize is enabled.

    The ordering of the tables is as follows:

    This function does not yield. It will not wait until the cloud LocalizationTable has loaded.

  • GetTranslatorForLocaleAsync(locale: string) → InstanceYieldsYields until the cloud LocalizationTable for the argument locale has been loaded - if available. Returns a Translator instance to be used for translations for the provided locale.

    This function takes a locale code as an argument and yields until the cloud LocalizationTable for that locale has been loaded, if available. It then returns a Translator object which can be used to perform translations for that locale if any are available. The entries used for localization are the entries provided by the LocalizationTable hierarchy under LocalizationService as well as the cloud table (if available). This will be the same set of entries returned by Class.LocalizationService:GetTableEntries(nil).

    This function can error and thus should be wrapped in a pcall().

    See also:

  • GetTranslatorForPlayerAsync(player: Instance) → InstanceYieldsYields until the cloud LocalizationTable for the player's locale has been loaded - if available. Returns a Translator instance to be used for translations for the provided locale.

    This function takes a player as an argument and yields until the cloud LocalizationTable for that player's locale has been loaded, if available. It then returns a Translator object which can be used to perform translations for that locale if any are available. The entries used for localization are the entries provided by the LocalizationTable hierarchy under LocalizationService as well as the cloud table (if available). This will be the same set of entries returned by Class.LocalizationService:GetTableEntries(nil).

    This function can error and thus should be wrapped in a pcall().

    See also:

LocalizationService also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.