--[[
	Recursively iterates through the object to construct strings and add it to the localization table
	@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)
	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)
		elseif type(value) == "string" then
			local source = ""
			local context = ""

			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
