--[=[
	Loads a folder into a localization table.

	@param tableName string -- Used for source
	@param folder Folder -- A Roblox folder with StringValues containing JSON, named with the localization in mind
]=]

function JsonToLocalizationTable.loadFolder(tableName, folder)
	assert(type(tableName) == "string", "Bad tableName")

	local localizationTable = JsonToLocalizationTable.getOrCreateLocalizationTable()

	for _, item in pairs(folder:GetDescendants()) do
		if item:IsA("StringValue") then
			local localeId = JsonToLocalizationTable.localeFromName(item.Name)
			JsonToLocalizationTable.addJsonToTable(localizationTable, localeId, item.Value, tableName)
		elseif item:IsA("ModuleScript") then
			local localeId = JsonToLocalizationTable.localeFromName(item.Name)
			recurseAdd(localizationTable, localeId, "", require(item), tableName)
		end
	end
	return localizationTable
end
