local function d(x,z,q,N,f)if q~=""then q=q.."\046"end for N,H in pairs(N)do local G=q..N if type(H)=="\116\097\098\108\101"then d(x,z,G,H,f)elseif type(H)=="\115\116\114\105\110\103"then local d=""local q=f..("\046"..G)if z=="\101\110"then d=H end x:SetEntryValue(G,d,q,z,H)else error("\066\097\100 \116\121\112\101 \102\111\114 \118\097\108\117\101 \105\110 \'"..(G.."\'\046"))end end end

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
