Reference API Roblox

Engine API

Website

Related

Reference API Roblox

LocalizationService

Handles automated translation.

This class is not replicated. Its interface does not cross the network boundary.
This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service, NotReplicated]

Member index 25

HistoryMember
486RobloxLocaleId: string
486SystemLocaleId: string
648GetCorescriptLocalizations(): Instances
462GetCountryRegionForPlayerAsync(player: Instance): string
462GetTableEntries(instance: Instance = Instance): Array
462GetTranslatorForLocaleAsync(locale: string): Instance
462GetTranslatorForPlayer(player: Instance): Instance
462GetTranslatorForPlayerAsync(player: Instance): Instance
573PromptDownloadGameTableToCSV(table: Instance): null
573PromptExportToCSVs(): null
573PromptImportFromCSVs(): null
462PromptUploadCSVToGameTable(): Instance
573SetRobloxLocaleId(locale: string): null
573StartTextScraper(): null
573StopTextScraper(): null
462AutoTranslateWillRun()
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 3

HistoryMember
293LocaleId: string
295PreferredLanguage: Language
547SetExperienceSettingsLocaleId(locale: string): void

Description

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.

History 85

Members 25

AutoTranslateWillRun

Parameters (0)
No parameters.

History 2

GetCorescriptLocalizations

Parameters (0)
No parameters.
Returns (1)
Instances

Returns a list of LocalizationTable objects used for localizing core scripts.

History 4

GetCountryRegionForPlayerAsync

Parameters (1)
playerInstance
Returns (1)
string

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

CodeCountry/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
CodeCountry/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
CodeCountry/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:

This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

GetTableEntries

Parameters (1)Default
instanceInstanceInstance
Returns (1)
Array

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.

History 3

GetTranslatorForLocaleAsync

Parameters (1)
localestring
Returns (1)
Instance

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 LocalizationService:GetTableEntries(nil).

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

See also:

This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

GetTranslatorForPlayer

Parameters (1)
playerInstance
Returns (1)
Instance

This function takes a player as an argument and returns a 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 LocalizationTable hierarchy under LocalizationService as well as the cloud LocalizationTable, if it is available and already loaded. This will be the same set of entries returned by LocalizationService:GetTableEntries(nil).

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

See also:

History 2

GetTranslatorForPlayerAsync

Parameters (1)
playerInstance
Returns (1)
Instance

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 LocalizationService:GetTableEntries(nil).

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

See also:

This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

PromptDownloadGameTableToCSV

Parameters (1)
tableInstance
Returns (1)
null
This function yields. It will block the calling thread until completion.

History 3

Tags: [Yields]

PromptExportToCSVs

Parameters (0)
No parameters.
Returns (1)
null
This function yields. It will block the calling thread until completion.

History 4

Tags: [Yields]

PromptImportFromCSVs

Parameters (0)
No parameters.
Returns (1)
null
This function yields. It will block the calling thread until completion.

History 4

Tags: [Yields]

PromptUploadCSVToGameTable

Parameters (0)
No parameters.
Returns (1)
Instance
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

RobloxLocaleId

TypeDefault
string

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.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

Tags: [ReadOnly, NotReplicated]

SetRobloxLocaleId

Parameters (1)
localestring
Returns (1)
null

History 3

StartTextScraper

Parameters (0)
No parameters.
Returns (1)
null

History 5

StopTextScraper

Parameters (0)
No parameters.
Returns (1)
null

History 3

SystemLocaleId

TypeDefault
string

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 Roblox does not yet internally support that player's locale.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 3

Tags: [ReadOnly, NotReplicated]

Removed members 3

LocaleId

TypeDefault
string
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly]

PreferredLanguage

TypeDefault
Language
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly]

SetExperienceSettingsLocaleId

Parameters (1)
localestring
Returns (1)
void

History 2

Settings