local XLoot = select(2, ...)

local function CompileLocales(locales)
	local L = locales[GetLocale()] and locales[GetLocale()] or locales.enUS
	if L ~= locales.enUS then
		setmetatable(L, { __index = locales.enUS })
		for k, v in pairs(L) do	
			if type(v) == 'table' then
				setmetatable(v, { __index = locales.enUS[k] })
			end
		end
	end
	return L
end

-- locales expects table: { enUS = {...}, ... }
function XLoot:Localize(name, locales)
	self["L_"..name] = CompileLocales(locales)
end

local locales = {
	enUS = {
		skin_svelte = "XLoot: Svelte",
		skin_legacy = "XLoot: Legacy",
		skin_smooth = "XLoot: Smooth",
	},
	-- Possibly localized
	ptBR = {},
	frFR = {},
	deDE = {},
	koKR = {},
	esMX = {},
	ruRU = {},
	zhCN = {},
	esES = {},
	zhTW = {},
}

-- Automatically inserted translations
-- See: http://wow.curseforge.com/addons/xloot-1-0/localization/ to create or fix translations





locales.ruRU["Options/confirm_reset_profile"] = "Это сбросит все параметры этого профиля. Вы уверены?" -- Needs review
locales.ruRU["Options/profile"] = "Профиль" -- Needs review
locales.ruRU["Options/when_always"] = "Всегда" -- Needs review
locales.ruRU["Options/when_auto"] = "Авто" -- Needs review
locales.ruRU["Options/when_never"] = "Никогда" -- Needs review
locales.ruRU["Options/when_solo"] = "Соло" -- Needs review

locales.zhCN["Options/confirm_reset_profile"] = "这将重置此配置文件的全部选项。确定？"
locales.zhCN["Options/profile"] = "配置文件"
locales.zhCN["Options/when_always"] = "总是"
locales.zhCN["Options/when_auto"] = "自动"
locales.zhCN["Options/when_never"] = "从不"
locales.zhCN["Options/when_solo"] = "单人"


locales.zhTW["Options/confirm_reset_profile"] = "將會重置此設定檔的所有設定。你確定要重置嗎？"
locales.zhTW["Options/profile"] = "設定檔"
locales.zhTW["Options/when_always"] = "總是"
locales.zhTW["Options/when_auto"] = "自動"
locales.zhTW["Options/when_never"] = "從不"
locales.zhTW["Options/when_solo"] = "單人"



XLoot.L = CompileLocales(locales)
