class AddLocaleToScripts < ActiveRecord::Migration
	def change
		create_table :locales do |t|
			t.string :code, :limit => 20, :null => false
			t.boolean :rtl, :null => false, :default => false
			t.string :detect_language_code, :limit => 20
			t.string :english_name, :limit => 100, :null => false
			t.string :native_name, :limit => 100
			t.boolean :ui_available, :null => false, :default => false
		end
		reversible do |dir|
			dir.up do
				execute <<-EOF
					insert into locales (code, english_name, native_name, rtl, detect_language_code, ui_available) values
					("aa", "Afar", null,0,null,0),
					("ab", "Abkhazian", "аҧсуа бызшәа",0,null,0),
					("ae", "Avestan", null,0,null,0),
					("af", "Afrikaans", null,0,"af",0),
					("ak", "Akan", null,0,null,0),
					("am", "Amharic", "አማርኛ",0,null,0),
					("ar", "Arabic", "العربية",1,"ar",0),
					("as", "Assamese", null,0,null,0),
					("ast", "Asturian", null,0,null,0),
					("av", "Avar", null,0,null,0),
					("ay", "Aymara", null,0,null,0),
					("az", "Azerbaijani", "azərbaycan",0,"az",0),
					("ba", "Bashkir", null,0,null,0),
					("be", "Belarusian", "Беларуская",0,"be",0),
					("bg", "Bulgarian", "Български",0,"bg",0),
					("bh", "Bihari", null,0,"bh",0),
					("bi", "Bislama", null,0,null,0),
					("bm", "Bambara", "Bamanankan",0,null,0),
					("bn", "Bengali", null,0,null,0),
					("bo", "Tibetan", null,0,null,0),
					("br", "Breton", null,0,null,0),
					("bs", "Bosnian", "Bosanski",0,null,0),
					("ca", "Catalan", "Català",0,"ca",0),
					("ce", "Chechen", null,0,null,0),
					("ceb", "Cebuano", null,0,"ceb",0),
					("ch", "Chamorro", null,0,null,0),
					("chr", "Cherokee", null,0,"chr",0),
					("co", "Corsican", null,0,null,0),
					("cr", "Cree", null,0,null,0),
					("cs", "Czech", "Čeština",0,"cs",0),
					("cu", "Old Slavonic", null,0,null,0),
					("cv", "Chuvash", null,0,null,0),
					("cy", "Welsh", "Cymraeg",0,"cy",0),
					("da", "Danish", "Dansk",0,"da",0),
					("de", "German", "Deutsch",0,"de",1),
					("dv", "Maldivian", null,0,"dv",0),
					("dz", "Bhutani", null,0,null,0),
					("ee", "Ewe", "Ɛʋɛ",0,null,0),
					("el", "Greek", "Ελληνικά",0,"el",0),
					("en", "English", null,0,"en",1),
					("eo", "Esperanto", null,0,null,0),
					("es", "Spanish", "Español",0,"es",0),
					("et", "Estonian", "Eesti",0,"et",0),
					("eu", "Basque", "Euskera",0,"eu",0),
					("fa", "Persian", "فارسی",1,"fa",0),
					("ff", "Fulah", "Fulfulde",0,null,0),
					("fi", "Finnish", "Suomi",0,"fi",0),
					("fil", "Filipino", null,0,"fil",0),
					("fj", "Fiji", null,0,null,0),
					("fo", "Faeroese", null,0,null,0),
					("fr", "French", "Français",0,"fr",0),
					("fy", "Frisian", "Frysk",0,null,0),
					("ga", "Irish", "Gaeilge",0,"ga",0),
					("gd", "Scots Gaelic", null,0,"gd",0),
					("gl", "Galician", "Galego",0,"gl",0),
					("gn", "Guarani", null,0,null,0),
					("gsw-berne", "Swiss German", null,0,null,0),
					("gu", "Gujarati", null,0,"gu",0),
					("gv", "Manx", null,0,null,0),
					("ha", "Hausa", null,0,null,0),
					("he", "Hebrew", "עברית",1,"he",0),
					("hi", "Hindi", "हिन्दी",0,"hi",0),
					("hmn", "Hmong", null,0,"hmn",0),
					("ho", "Hiri Motu", null,0,null,0),
					("hr", "Croatian", "Hrvatski",0,"hr",0),
					("ht", "Haitian Creole", null,0,"ht",0),
					("hu", "Hungarian", "Magyar",0,"hu",0),
					("hy", "Armenian", "Հայերեն",0,"hy",0),
					("hz", "Herero", null,0,null,0),
					("ia", "Interlingua", null,0,null,0),
					("id", "Indonesian", "Bahasa Indonesia",0,"id",1),
					("ie", "Interlingue", null,0,null,0),
					("ig", "Igbo", null,0,null,0),
					("ik", "Inupiak", null,0,null,0),
					("is", "Icelandic", "Íslenska",0,"is",0),
					("it", "Italian", "Italiano",0,"it",0),
					("iu", "Inuktitut", null,0,"iu",0),
					("ja", "Japanese", "日本語",0,"ja",1),
					("jv", "Javanese", null,0,"jw",0),
					("ka", "Georgian", null,0,"ka",0),
					("kg", "Kongo", null,0,null,0),
					("ki", "Kikuyu", null,0,null,0),
					("kj", "Kwanyama", null,0,null,0),
					("kk", "Kazakh", "Қазақ",0,null,0),
					("kl", "Greenlandic", null,0,null,0),
					("km", "Cambodian", null,0,"km",0),
					("kn", "Kannada", "ಕನ್ನಡ",0,"kn",0),
					("ko", "Korean", "한국어",0,"ko",0),
					("kr", "Kanuri", null,0,null,0),
					("ks", "Kashmiri", null,0,null,0),
					("ku", "Kurdish", "Kurdî",0,null,0),
					("kv", "Komi", null,0,null,0),
					("kw", "Cornish", null,0,null,0),
					("ky", "Kyrgyz", "Кыргызча",0,null,0),
					("la", "Latin", "Latina",0,null,0),
					("lb", "Luxembourgish", null,0,null,0),
					("lg", "Luganda", null,0,"lg",0),
					("lif", "Limbu", null,0,"lif",0),
					("ln", "Lingala", null,0,null,0),
					("lo", "Laothian", null,0,"lo",0),
					("lt", "Lithuanian", "Lietuvių",0,"lt",0),
					("lv", "Latvian", "Latviešu",0,"lv",0),
					("mg", "Malagasy", null,0,null,0),
					("mh", "Marshallese", null,0,null,0),
					("mi", "Māori", null,0,null,0),
					("mk", "Macedonian", "Македонски",0,"mk",0),
					("ml", "Malayalam", "മലയാളം",0,"ml",0),
					("mn", "Mongolian", null,0,null,0),
					("mo", "Moldavian", null,0,null,0),
					("mr", "Marathi", null,0,"mr",0),
					("ms", "Malay", "Bahasa Melayu",0,"ms",0),
					("mt", "Maltese", "Malti",0,"mt",0),
					("my", "Burmese", null,0,null,0),
					("na", "Nauru", null,0,null,0),
					("nd", "North Ndebele", null,0,null,0),
					("ne", "Nepali", null,0,"ne",0),
					("ng", "Ndonga", null,0,null,0),
					("nl", "Dutch", "Nederlands",0,"nl",1),
					("nb", "Norwegian Bokmål", "Bokmål",0,"nb",0),
					("nn", "Norwegian Nynorsk", "Nynorsk",0,null,0),
					("nr", "South Ndebele", null,0,null,0),
					("nv", "Navajo", null,0,null,0),
					("ny", "Chichewa", null,0,null,0),
					("oc", "Occitan", null,0,null,0),
					("om", "Oromo", null,0,null,0),
					("or", "Oriya", null,0,"or",0),
					("os", "Ossetian", null,0,null,0),
					("pa", "Punjabi", null,0,"pa",0),
					("pi", "Pali", null,0,null,0),
					("pl", "Polish", "Polski",0,"pl",0),
					("ps", "Pashto", "پښتو",1,null,0),
					("pt", "Portuguese, International", null,0,"pt",0),
					("pt-pt", "Portuguese, Portugal", "Português",0,null,0),
					("pt-br", "Portuguese, Brazil", "Português",0,null,0),
					("qu", "Quechua", null,0,null,0),
					("rm", "Rhaeto-Romance", null,0,null,0),
					("rn", "Kirundi", null,0,null,0),
					("ro", "Romanian", "Română",0,"ro",0),
					("ru", "Russian", "Русский",0,"ru",1),
					("rw", "Kinyarwanda", null,0,"rw",0),
					("sa", "Sanskrit", null,0,null,0),
					("sc", "Sardinian", null,0,null,0),
					("sco", "Scots", null,0,null,0),
					("sd", "Sindhi", null,0,null,0),
					("se", "Northern Sami", null,0,null,0),
					("sg", "Sango", null,0,null,0),
					("sh", "Serbo-Croatian", null,0,null,0),
					("si", "Sinhala", "සිංහල",0,"si",0),
					("sk", "Slovak", "Slovenčina",0,"sk",0),
					("sl", "Slovenian", "Slovenščina",0,"sl",0),
					("sm", "Samoan", null,0,null,0),
					("sn", "Shona", null,0,null,0),
					("so", "Somali", null,0,null,0),
					("sq", "Albanian", "Shqip",0,"sq",0),
					("sr", "Serbian", "Српски",0,"sr",0),
					("ss", "Siswati", null,0,null,0),
					("st", "Sesotho", null,0,null,0),
					("su", "Sudanese", null,0,null,0),
					("sv", "Swedish", "Svenska",0,"sv",0),
					("sw", "Swahili", "Kiswahili",0,"sw",0),
					("syr", "Syriac", null,0,"syr",0),
					("ta", "Tamil", "தமிழ்",0,"ta",0),
					("te", "Telugu", "తెలుగు",0,"te",0),
					("tg", "Tajik", null,0,null,0),
					("th", "Thai", "ภาษาไทย",0,"th",0),
					("ti", "Tigrinya", null,0,null,0),
					("tk", "Turkmen", null,0,null,0),
					("tl", "Tagalog", null,0,null,0),
					("tn", "Setswana", null,0,null,0),
					("to", "Tonga", null,0,null,0),
					("tr", "Turkish", "Türkçe",0,"tr",0),
					("ts", "Tsonga", null,0,null,0),
					("tt", "Tatar", "Tatarça",0,null,0),
					("tw", "Twi", null,0,null,0),
					("ty", "Tahitian", null,0,null,0),
					("ug", "Uyghur", null,0,null,0),
					("uk", "Ukrainian", "Українська",0,"uk",0),
					("ur", "Urdu", "اردو",1,"ur",0),
					("uz", "Uzbek", "o'zbek",0,null,0),
					("ve", "Venda", null,0,null,0),
					("vi", "Vietnamese", "Tiếng Việt",0,"vi",0),
					("wo", "Wolof", null,0,null,0),
					("xh", "Xhosa", "isiXhosa",0,null,0),
					("yi", "Yiddish", null,0,"yi",0),
					("yo", "Yoruba", "Yorùbá",0,null,0),
					("za", "Zhuang", null,0,null,0),
					("zh-CN", "Chinese, Simplified", "简体中文",0,"zh",1),
					("zh-TW", "Chinese, Traditional", "繁體中文",0,"zh-TW",1),
					("zu", "Zulu", "isiZulu",0,null,0)
				EOF
			end
		end
		add_column :scripts, :locale_id, :integer, :index => true
	end
end
