<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
	<External>null</External>
	<External>nil</External>
	<Item class="Model" referent="RBX5b3f3aacc7b74a248c4090b6c0895536">
		<Properties>
			<CoordinateFrame name="ModelInPrimary">
				<X>0</X>
				<Y>0</Y>
				<Z>0</Z>
				<R00>1</R00>
				<R01>0</R01>
				<R02>0</R02>
				<R10>0</R10>
				<R11>1</R11>
				<R12>0</R12>
				<R20>0</R20>
				<R21>0</R21>
				<R22>1</R22>
			</CoordinateFrame>
			<string name="Name">LocalizationPlugin</string>
			<Ref name="PrimaryPart">null</Ref>
			<BinaryString name="Tags"></BinaryString>
		</Properties>
		<Item class="Script" referent="RBX80b65251d0d4473f99856c535f049554">
			<Properties>
				<bool name="Disabled">false</bool>
				<Content name="LinkedSource"><null></null></Content>
				<string name="Name">PluginScript</string>
				<string name="ScriptGuid">{23c184c9-73de-4b2d-9bd7-55d0a70adf12}</string>
				<ProtectedString name="Source"><![CDATA[if not settings():GetFFlag("StudioEnableBuiltInGameLocalizationPlugin3") then
	return
end

local runService = game:GetService("RunService")
local localizationService = game:GetService("LocalizationService")
local enabled = runService:RobloxOnlyIsEdit()

local toolbar = plugin:CreateToolbar("Localization Tools")

function getTextScraperAsset()
	return localizationService.IsTextScraperRunning 
		and "rbxasset://textures/localizationUIScrapingOn.png" 
		or "rbxasset://textures/localizationUIScrapingOff.png"
end

local captureButton = nil
captureButton = toolbar:CreateButton(
	"Text Capture",
	"Enable untranslated text capture",
	getTextScraperAsset()
)

local exportButton = toolbar:CreateButton(
	"Export",
	"Export LocalizationTables under LocalizationService to CSV files",
	"rbxasset://textures/localizationExport.png"
)

local importButton = toolbar:CreateButton(
	"Import",
	"Import CSV files to LocalizationTables under LocalizationService",
	"rbxasset://textures/localizationImport.png"
)

local forceLocales = { {"en-us", "English"}, {"es-es", "Spanish"} }
local forceLocaleButtons = {}

local testToolbar = plugin:CreateToolbar("Test Language")
for _, locale in pairs(forceLocales) do
	local localeId = locale[1]
	local commonName = locale[2]
	local butt = testToolbar:CreateButton(
		commonName,
		"LocalizationService.RobloxLocaleId will return \""..localeId.."\" and in-game text will displayed in "..commonName,
		"rbxasset://textures/localizationTarget"..commonName..".png"
	)
	if localizationService.RobloxForcePlayModeRobloxLocaleId == localeId then
		butt:SetActive(true)
	end
	butt.Enabled = enabled
	butt.Click:connect(function()
		if localizationService.RobloxForcePlayModeRobloxLocaleId ~= localeId then
			localizationService.RobloxForcePlayModeRobloxLocaleId = localeId
			print("Forcing play locale to \""..localizationService.RobloxForcePlayModeRobloxLocaleId.."\"")
			butt:SetActive(true)
		else
			localizationService.RobloxForcePlayModeRobloxLocaleId = ""
			print("Reverted play locale to default \""..localizationService.RobloxLocaleId.."\"")
			for _, b in pairs(forceLocaleButtons) do
				b:SetActive(false)
			end
		end
	end)

	forceLocaleButtons[localeId] = butt
end

captureButton.Enabled = enabled
captureButton.Click:connect(function()
	if not localizationService.IsTextScraperRunning then
		localizationService:StartTextScraper()
	else
		localizationService:StopTextScraper()
	end
	captureButton.Icon = getTextScraperAsset()
end)

exportButton.Enabled = enabled
exportButton.Click:connect(function()
	localizationService:PromptExportToCSVs()
end)

importButton.Enabled = enabled
importButton.Click:connect(function()
	localizationService:PromptImportFromCSVs()
end)
]]></ProtectedString>
				<BinaryString name="Tags"></BinaryString>
			</Properties>
		</Item>
	</Item>
</roblox>
