# This file is automatically generated. Please don't edit it manually. # To submit a bug report on the content, see # https://devforum.roblox.com/c/bug-reports/documentation-issues/72 name: LocalizationService type: class memory_category: Instances summary: | Handles automated translation. description: | LocalizationService is the service responsible for handling automated translation. It is used as a storage for `Class.LocalizationTable` objects used by automatic text replacement. LocalizationService will only use its child LocalizationTables for automatic text replacement unless `Class.GuiBase2d.RootLocalizationTable` is specified on a GUI object or its ancestors. code_samples: [] inherits: - Instance descendants: [] tags: - NotCreatable - Service - NotReplicated deprecation_message: '' properties: - name: LocalizationService.RobloxLocaleId summary: | The locale ID used for localizing core and internal features. description: | This property shows the locale ID used for the localization of core and internal features such as `Class.CoreGui`. Returns a string with the two letter code (for example, `en-us`) for the locale. code_samples: [] type: string tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Localization serialization: can_load: false can_save: false capabilities: - Basic - name: LocalizationService.SystemLocaleId summary: | The locale ID that the local player has set for their operating system. description: | 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 `Class.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 Roblox does not yet internally support that player's locale. code_samples: [] type: string tags: - ReadOnly - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Localization serialization: can_load: false can_save: false capabilities: - Basic methods: - name: LocalizationService:GetCorescriptLocalizations summary: | Returns a list of `Class.LocalizationTable` objects used for localizing core scripts. description: | Returns a list of `Class.LocalizationTable` objects used for localizing core scripts. code_samples: [] parameters: [] returns: - type: Instances summary: '' tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: - Basic - name: LocalizationService:GetCountryRegionForPlayerAsync summary: | Returns country/region code string according to player's client IP geolocation. description: | Returns a country/region code string according to player's client IP geolocation. The supported country/region codes are as follows:
Code Country/Region
USUnited States
GBUnited Kingdom
CACanada
AFAfghanistan
AXAland Islands
ALAlbania
DZAlgeria
ASAmerican Samoa
ADAndorra
AOAngola
AIAnguilla
AQAntarctica
AGAntigua and Barbuda
ARArgentina
AMArmenia
AWAruba
AUAustralia
ATAustria
AZAzerbaijan
BSBahamas
BHBahrain
BDBangladesh
BBBarbados
BYBelarus
BEBelgium
BZBelize
BJBenin
BMBermuda
BTBhutan
BOBolivia
BQBonaire, Saint Eustatius and Saba
BABosnia and Herzegovina
BWBotswana
BVBouvet Island
BRBrazil
IOBritish Indian Ocean Territory
BNBrunei Darussalam
BGBulgaria
BFBurkina Faso
BIBurundi
KHCambodia
CMCameroon
CVCape Verde
KYCayman Islands
CFCentral African Republic
TDChad
CLChile
CNChina
CXChristmas Island
CCCocos Islands
COColombia
KMComoros
CGCongo
CDCongo (DRC)
CKCook Islands
CRCosta Rica
CIIvory Coast
HRCroatia
CWCuraçao
CYCyprus
CZCzech Republic
DKDenmark
DJDjibouti
DMDominica
DODominican Republic
ECEcuador
EGEgypt
SVEl Salvador
GQEquatorial Guinea
EREritrea
EEEstonia
ETEthiopia
FKFalkland Islands (Malvinas)
FOFaroe Islands
FJFiji
FIFinland
FRFrance
GFFrench Guiana
PFFrench Polynesia
TFFrench Southern Territories
GAGabon
GMGambia
GEGeorgia
DEGermany
Code Country/Region
GHGhana
GIGibraltar
GRGreece
GLGreenland
GDGrenada
GPGuadeloupe
GUGuam
GTGuatemala
GGGuernsey
GNGuinea
GWGuinea-Bissau
GYGuyana
HTHaiti
HMHeard Island and the McDonald Islands
VAHoly See
HNHonduras
HKHong Kong
HUHungary
ISIceland
INIndia
IDIndonesia
IQIraq
IEIreland
IMIsle of Man
ILIsrael
ITItaly
JMJamaica
JPJapan
JEJersey
JOJordan
KZKazakhstan
KEKenya
KIKiribati
KRKorea
KWKuwait
KGKyrgyzstan
LALaos
LVLatvia
LBLebanon
LSLesotho
LRLiberia
LYLibya
LILiechtenstein
LTLithuania
LULuxembourg
MOMacao
MKMacedonia
MGMadagascar
MWMalawi
MYMalaysia
MVMaldives
MLMali
MTMalta
MHMarshall Islands
MQMartinique
MRMauritania
MUMauritius
YTMayotte
MXMexico
FMMicronesia
MDMoldova
MCMonaco
MNMongolia
MEMontenegro
MSMontserrat
MAMorocco
MZMozambique
MMMyanmar
NANamibia
NRNauru
NPNepal
NLNetherlands
ANNetherlands Antilles
NCNew Caledonia
NZNew Zealand
NINicaragua
NENiger
NGNigeria
NUNiue
NFNorfolk Island
MPNorthern Mariana Islands
NONorway
OMOman
Code Country/Region
PKPakistan
PWPalau
PSPalestine
PAPanama
PGPapua New Guinea
PYParaguay
PEPeru
PHPhilippines
PNPitcairn Islands
PLPoland
PTPortugal
PRPuerto Rico
QAQatar
REReunion
RORomania
RURussian Federation
RWRwanda
BLSaint Barthelemy
SHSaint Helena, Ascension and Tristan da Cunha
KNSaint Kitts and Nevis
LCSaint Lucia
MFSaint Martin
PMSaint Pierre and Miquelon
VCSaint Vincent and the Grenadines
WSSamoa
SMSan Marino
STSao Tome and Principe
SASaudi Arabia
SNSenegal
RSSerbia
SCSeychelles
SLSierra Leone
SGSingapore
SXSint Maarten
SKSlovakia
SISlovenia
SBSolomon Islands
SOSomalia
ZASouth Africa
GSSouth Georgia and the South Sandwich Islands
SSSouth Sudan
ESSpain
LKSri Lanka
SRSuriname
SJSvalbard and Jan Mayen
SZSwaziland
SESweden
CHSwitzerland
TWTaiwan
TJTajikistan
TZTanzania
THThailand
TLTimor-Leste
TGTogo
TKTokelau
TOTonga
TTTrinidad and Tobago
TNTunisia
TRTürkiye (Turkey)
TMTurkmenistan
TCTurks and Caicos Islands
TVTuvalu
UGUganda
UAUkraine
AEUnited Arab Emirates
UMUnited States Minor Outlying Islands
UYUruguay
UZUzbekistan
VUVanuatu
VEVenezuela
VNVietnam
VGVirgin Islands (British)
VIVirgin Islands (US)
WFWallis and Futuna
EHWestern Sahara
YEYemen
ZMZambia
ZWZimbabwe
CUCuba
IRIran
SYSyria
KPNorth Korea
See also: - `Class.PolicyService:GetPolicyInfoForPlayerAsync()`, returns policy information about a player which is based on geolocation, age group and platform code_samples: - getting-country-region-code-for-a-player parameters: - name: player type: Instance default: summary: | The player that you are getting country/region information for. returns: - type: string summary: | A string indicating the country/region code of a player. tags: - Yields deprecation_message: '' security: None thread_safety: Unsafe capabilities: - Basic - name: LocalizationService:GetTableEntries summary: | Gets all entries used for automated localization. description: | Returns an `Array`, where each element of the returned `Array` is itself an `Array` of entries in the same format as described in `Class.LocalizationTable:GetEntries()`. The order of the elements in the returned `Array` is the same order that the `Class.LocalizationTable|LocalizationTables` will be searched through to attempt automated localization for the provided `Class.Instance`. The entry elements within a particular `Class.LocalizationTable` are returned in an unspecified order. This function returns entries regardless of whether the object is a `Class.GuiBase2d` with `Class.GuiBase2d.AutoLocalize` enabled. An object that is a `Class.GuiBase2d` will not actually be automatically localized unless `Class.GuiBase2d.AutoLocalize` is enabled. The ordering of the tables is as follows: - First, it looks for the earliest `Class.GuiBase2d` ancestor of the object (including the provided object) that has a `Class.GuiBase2d.RootLocalizationTable`. Tables then append in the same order as described in `Class.GuiBase2d.RootLocalizationTable` by going up through the `Class.LocalizationTable` ancestors of that `Class.GuiBase2d.RootLocalizationTable`. If no such `Class.GuiBase2d.RootLocalizationTable` is found, no tables append in this step. If `instance` is `nil`, no tables append in this step. - Next, tables from the `Class.LocalizationTable` hierarchy under `Class.LocalizationService` append. For each child `Class.LocalizationTable` of `Class.LocalizationService`, it appends tables going up from the lowest descendant `Class.LocalizationTable` of the tables parented to the service, all the way up to the children of the service. If there are no children of `Class.LocalizationService` that are `Class.LocalizationTable|LocalizationTables`, then no tables append in this step. - Finally, the cloud `Class.LocalizationTable` appends to the array. If there is no cloud `Class.LocalizationTable`, or the cloud `Class.LocalizationTable` has not yet loaded, then no table appends in this step. This function does not yield. It will not wait until the cloud `Class.LocalizationTable` has loaded. code_samples: [] parameters: - name: instance type: Instance default: nil summary: '' returns: - type: Array summary: | An array of arrays, where each array is in the same format as described in `Class.LocalizationTable:GetEntries()`. tags: [] deprecation_message: '' security: None thread_safety: Unsafe capabilities: - Basic - name: LocalizationService:GetTranslatorForLocaleAsync summary: | Yields until the cloud `Class.LocalizationTable` for the argument locale has been loaded - if available. Returns a `Class.Translator` instance to be used for translations for the provided locale. description: | This function takes a locale code as an argument and yields until the cloud `Class.LocalizationTable` for that locale has been loaded, if available. It then returns a `Class.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 `Class.LocalizationTable` hierarchy under `Class.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: - `Class.LocalizationService:GetTranslatorForPlayer()` gets the translator corresponding to the locale of the provided player. This function is deprecated and should not be used in new work. - `Class.LocalizationService:GetTranslatorForPlayerAsync()` yields until the cloud `Class.LocalizationTable` for the locale of the provided player has loaded and then gets the translator corresponding to the locale of the provided player. code_samples: - getting-and-using-a-translator-for-a-locale parameters: - name: locale type: string default: summary: | A Roblox supported language or locale code. returns: - type: Instance summary: | The `Class.Translator` instance for the specified locale. tags: - Yields deprecation_message: '' security: None thread_safety: Unsafe capabilities: - Basic - name: LocalizationService:GetTranslatorForPlayer summary: | Returns a `Class.Translator` to be used for translations using the locale data loaded. description: | This function takes a player as an argument and returns a `Class.Translator` instance 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 `Class.LocalizationTable` hierarchy under `Class.LocalizationService` as well as the cloud `Class.LocalizationTable`, if it is available and already loaded. This will be the same set of entries returned by `Class.LocalizationService:GetTableEntries(nil)`. This function does not yield. It will not wait until the cloud `Class.LocalizationTable` has loaded. See also: - `Class.LocalizationService:GetTranslatorForPlayerAsync()` has the same functionality as this function, except that it yields until the cloud `Class.LocalizationTable` has been loaded. - `Class.LocalizationService:GetTranslatorForLocaleAsync()`, returns a Translator to be used for translations using the provided locale. code_samples: - getting-and-using-a-translator-for-a-player parameters: - name: player type: Instance default: summary: | The `Class.Player` that you are getting the `Class.Translator` for. returns: - type: Instance summary: | The `Class.Translator` instance for the specified locale. tags: [] deprecation_message: | This function has been deprecated by `Class.LocalizationService:GetTranslatorForPlayerAsync()`, which functions similarly except that it yields until the cloud table has loaded. Please use it in new work instead. security: None thread_safety: Unsafe capabilities: - Basic - name: LocalizationService:GetTranslatorForPlayerAsync summary: | Yields until the cloud `Class.LocalizationTable` for the player's locale has been loaded - if available. Returns a `Class.Translator` instance to be used for translations for the provided locale. description: | This function takes a player as an argument and yields until the cloud `Class.LocalizationTable` for that player's locale has been loaded, if available. It then returns a `Class.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 `Class.LocalizationTable` hierarchy under `Class.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: - `Class.LocalizationService:GetTranslatorForPlayer()`, same functionality as this function except that it does not yield and does not wait until the cloud `Class.LocalizationTable` for the player's locale has been loaded. This function is deprecated and should not be used in new work. - `Class.LocalizationService:GetTranslatorForLocaleAsync()`, returns a Translator to be used for translations using the provided locale. code_samples: - getting-and-using-a-translator-for-a-player parameters: - name: player type: Instance default: summary: | The `Class.Player` that you are getting the `Class.Translator` for. returns: - type: Instance summary: | The `Class.Translator` instance for the specified locale. tags: - Yields deprecation_message: '' security: None thread_safety: Unsafe capabilities: - Basic events: [] callbacks: []