function GameTranslator.TranslateGameText(N,w,n)if CoreScriptTranslateGameText then local N=getTranslator()if N then return N:RobloxOnlyTranslate(w,n)else return n end else return n end end local function w()for w,n in pairs(registryInfoMap)do w.Text=GameTranslator:TranslateGameText(n.context,n.text)end end if CoreScriptTranslateGameText then LocalizationService.AutoTranslateWillRun:Connect(w)end function GameTranslator.TranslateAndRegister(X,w,n,N)if CoreScriptTranslateGameText then w.Text=X:TranslateGameText(n,N)registerGui(w,n,N)end return N end return GameTranslator


function GameTranslator:TranslateGameText(context, text)
	if CoreScriptTranslateGameText then
		local translator = getTranslator()
		if translator then
			return translator:RobloxOnlyTranslate(context, text)
		else
			return text
		end
	else
		return text
	end
end

local function retranslateAll()
	for element, info in pairs(registryInfoMap) do
		element.Text = GameTranslator:TranslateGameText(info.context, info.text)
	end
end

if CoreScriptTranslateGameText then
	LocalizationService.AutoTranslateWillRun:Connect(retranslateAll)
end

function GameTranslator:TranslateAndRegister(element, context, text)
	if CoreScriptTranslateGameText then
		element.Text = self:TranslateGameText(context, text)
		registerGui(element, context, text)
	end

	return text
end

return GameTranslator
