How to get translated game name in script?

I can get game name using this. But is it already translated?
https://devforum.roblox.com/t/how-to-get-a-game-name-from-a-script/1259719/3?u=etnowis

How may I get the translated game name according to the player’s locale?

1 Like

You would need a localization table with predified translation for the following dictionary of keys.
LocalizationTable Library | LocalizationService Library
The Following code would look something like this when done correctly:

local marketPlaceService = game:GetService("MarketplaceService")
local localization = game:GetService("LocalizationService")
local players = game:GetService("Players")

local player = players.LocalPlayer

local result, code = pcall(localization.GetCountryRegionForPlayerAsync, localization, player)
if not result then warn("GetCountryRegionForPlayerAsync failed: ".. code) end
print(code)

local placeID = 73290985443559

local info = marketPlaceService:GetProductInfo(placeID)
local placeName = info.Name --returns فورت نايت العرب

print("original: "..placeName)

--local translator = localization:GetTranslatorForLocaleAsync("es")
local translator = localization:GetTranslatorForPlayerAsync(player)

local translated_text = translator:Translate(game, placeName)
print("translated: "..translated_text) -- returns Arabe Fortnite

Other way to translate would be using external translation APIs through HttpService or etc.

2 Likes

Thanks for the answer. It seems to be a generic translation method for any string.

To clarify, I am trying to look for the entry or key to the game Name from Localization page because it is already translated
image

But it is not one of the entry