local function H(o,f,Z,m,L)if Z~=""then Z=Z.."\046"end for m,V in pairs(m)do local j=Z..m if type(V)=="\116\097\098\108\101"then H(o,f,j,V,L)elseif type(V)=="\115\116\114\105\110\103"then local H=""local Z=L..("\046"..j)if f=="\101\110"then H=V end o:SetEntryValue(j,H,Z,f,V)else error("\066\097\100 \116\121\112\101 \102\111\114 \118\097\108\117\101 \105\110 \'"..(j.."\'\046"))end end end
--[[
	Recursively iterates through the object to construct strings and add it to the localization table

	@param localizationTable LocalizationTable
	@param localeId string -- The localizationid to add
	@param baseKey string -- the key to add
	@param object any -- The value to iterate over
]]
local function recurseAdd(localizationTable, localeId, baseKey, object, tableName)
	if baseKey ~= "" then
		baseKey = baseKey .. "."
	end

	for index, value in pairs(object) do
		local key = baseKey .. index
		if type(value) == "table" then
			recurseAdd(localizationTable, localeId, key, value, tableName)
		elseif type(value) == "string" then
			local source = ""

			-- Guarantee the context is unique. This is important because Roblox will not
			-- allow something with the same source without a differing context value.
			local context = tableName .. "." .. key

			if localeId == "en" then
				source = value
			end

			localizationTable:SetEntryValue(key, source, context, localeId, value)
		else
			error("Bad type for value in '" .. key .. "'.")
		end
	end
end
