More missing files from I18N merge.
authorTom Hughes <tom@compton.nu>
Sun, 31 May 2009 17:41:25 +0000 (17:41 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 31 May 2009 17:41:25 +0000 (17:41 +0000)
app/models/language.rb [new file with mode: 0644]
config/initializers/available_locales.rb [new file with mode: 0644]
config/languages.yml [new file with mode: 0644]
db/migrate/034_create_languages.rb
test/fixtures/languages.yml [new file with mode: 0644]
test/unit/language_test.rb [new file with mode: 0644]

diff --git a/app/models/language.rb b/app/models/language.rb
new file mode 100644 (file)
index 0000000..a33c760
--- /dev/null
@@ -0,0 +1,11 @@
+class Language < ActiveRecord::Base
+  set_primary_key :code
+
+  has_many :diary_entries, :foreign_key => 'language'
+
+  def name
+    name = english_name
+    name += " (#{native_name})" unless native_name.nil?
+    name
+  end  
+end
diff --git a/config/initializers/available_locales.rb b/config/initializers/available_locales.rb
new file mode 100644 (file)
index 0000000..026be26
--- /dev/null
@@ -0,0 +1,18 @@
+# Get loaded locales conveniently
+# See http://rails-i18n.org/wiki/pages/i18n-available_locales
+module I18n
+  class << self
+    def available_locales
+      backend.available_locales
+    end
+  end
+  module Backend
+    class Simple
+      def available_locales
+        init_translations unless initialized?
+        translations.keys
+      end
+    end
+  end
+end
+
diff --git a/config/languages.yml b/config/languages.yml
new file mode 100644 (file)
index 0000000..df0a832
--- /dev/null
@@ -0,0 +1,735 @@
+aa:
+  english: Afar
+  native: Afaraf
+
+ab:
+  english: Abkhazian
+  native: Аҧсуа
+
+ae:
+  english: Avestan
+  native: avesta
+
+af:
+  english: Afrikaans
+  native: Afrikaans
+
+ak:
+  english: Akan
+  native: Akan
+
+am:
+  english: Amharic
+  native: አማርኛ
+
+an:
+  english: Aragonese
+  native: Aragonés
+
+ar:
+  english: Arabic
+  native: العربية
+
+as:
+  english: Assamese
+  native: অসমীয়া
+
+av:
+  english: Avaric
+  native: авар мацӀ; магӀарул мацӀ
+
+ay:
+  english: Aymara
+  native: aymar aru
+
+az:
+  english: Azerbaijani
+  native: azərbaycan dili
+
+ba:
+  english: Bashkir
+  native: башҡорт теле
+
+be:
+  english: Belarusian
+  native: Беларуская
+
+bg:
+  english: Bulgarian
+  native: български език
+
+bh:
+  english: Bihari
+  native: भोजपुरी
+
+bi:
+  english: Bislama
+  native: Bislama
+
+bm:
+  english: Bambara
+  native: bamanankan
+
+bn:
+  english: Bengali
+  native: বাংলা
+
+bo:
+  english: Tibetan
+  native: བོད་ཡིག
+
+br:
+  english: Breton
+  native: brezhoneg
+
+bs:
+  english: Bosnian
+  native: bosanski jezik
+
+ca:
+  english: Catalan
+  native: Català
+
+ce:
+  english: Chechen
+  native: нохчийн мотт
+
+ch:
+  english: Chamorro
+  native: Chamoru
+
+co:
+  english: Corsican
+  native: corsu; lingua corsa
+
+cr:
+  english: Cree
+  native: ᓀᐦᐃᔭᐍᐏᐣ
+
+cs:
+  english: Czech
+  native: česky; čeština
+
+cu:
+  english: Church Slavic
+  native: ѩзыкъ словѣньскъ
+
+cv:
+  english: Chuvash
+  native: чӑваш чӗлхи
+
+cy:
+  english: Welsh
+  native: Cymraeg
+
+da:
+  english: Danish
+  native: dansk
+
+de:
+  english: German
+  native: Deutsch
+
+dv:
+  english: Divehi
+  native: ދިވެހި
+
+dz:
+  english: Dzongkha
+  native: རྫོང་ཁ
+
+ee:
+  english: Ewe
+  native: Ɛʋɛgbɛ
+
+el:
+  english: Greek
+  native: Ελληνικά
+
+en:
+  english: English
+  native: English
+
+eo:
+  english: Esperanto
+  native: Esperanto
+
+es:
+  english: Spanish
+  native: Español; castellano
+
+et:
+  english: Estonian
+  native: eesti; eesti keel
+
+eu:
+  english: Basque
+  native: euskara; euskera
+
+fa:
+  english: Persian
+  native: فارسی
+
+ff:
+  english: Fulah
+  native: Fulfulde
+
+fi:
+  english: Finnish
+  native: suomi; suomen kieli
+
+fj:
+  english: Fijian
+  native: vosa Vakaviti
+
+fo:
+  english: Faroese
+  native: Føroyskt
+
+fr:
+  english: French
+  native: Français; langue française
+
+fy:
+  english: Western Frisian
+  native: Frysk
+
+ga:
+  english: Irish
+  native: Gaeilge
+
+gd:
+  english: Scottish Gaelic
+  native: Gàidhlig
+
+gl:
+  english: Galician
+  native: Galego
+
+gn:
+  english: Guaraní
+  native: Avañe'ẽ
+
+gu:
+  english: Gujarati
+  native: ગુજરાતી
+
+gv:
+  english: Manx
+  native: Gaelg; Gailck
+
+ha:
+  english: Hausa
+  native: هَوُسَ
+
+he:
+  english: Hebrew
+  native: עברית
+
+hi:
+  english: Hindi
+  native: हिन्दी; हिंदी
+
+ho:
+  english: Hiri Motu
+  native: Hiri Motu
+
+hr:
+  english: Croatian
+  native: Hrvatski
+
+ht:
+  english: Haitian
+  native: Kreyòl ayisyen
+
+hu:
+  english: Hungarian
+  native: Magyar
+
+hy:
+  english: Armenian
+  native: Հայերեն
+
+hz:
+  english: Herero
+  native: Otjiherero
+
+ia:
+  english: Interlingua (International Auxiliary Language Association)
+  native: Interlingua
+
+id:
+  english: Indonesian
+  native: Bahasa Indonesia
+
+ie:
+  english: Interlingue
+  native: Interlingue
+
+ig:
+  english: Igbo
+  native: Igbo
+
+ii:
+  english: Sichuan Yi
+  native: ꆇꉙ
+
+ik:
+  english: Inupiaq
+  native: Iñupiaq; Iñupiatun
+
+io:
+  english: Ido
+  native: Ido
+
+is:
+  english: Icelandic
+  native: Íslenska
+
+it:
+  english: Italian
+  native: Italiano
+
+iu:
+  english: Inuktitut
+  native: ᐃᓄᒃᑎᑐᑦ
+
+ja:
+  english: Japanese
+  native: 日本語 (にほんご/にっぽんご)
+
+jv:
+  english: Javanese
+  native: basa Jawa
+
+ka:
+  english: Georgian
+  native: ქართული
+
+kg:
+  english: Kongo
+  native: KiKongo
+
+ki:
+  english: Kikuyu
+  native: Gĩkũyũ
+
+kj:
+  english: Kwanyama
+  native: Kuanyama
+
+kk:
+  english: Kazakh
+  native: Қазақ тілі
+
+kl:
+  english: Kalaallisut
+  native: kalaallisut; kalaallit oqaasii
+
+km:
+  english: Khmer
+  native: ភាសាខ្មែរ
+
+kn:
+  english: Kannada
+  native: ಕನ್ನಡ
+
+ko:
+  english: Korean
+  native: 한국어 (韓國語); 조선말 (朝鮮語)
+
+kr:
+  english: Kanuri
+  native: Kanuri
+
+ks:
+  english: Kashmiri
+  native: कश्मीरी; كشميري‎
+
+ku:
+  english: Kurdish
+  native: Kurdî; كوردی‎
+
+kv:
+  english: Komi
+  native: коми кыв
+
+kw:
+  english: Cornish
+  native: Kernewek
+
+ky:
+  english: Kirghiz
+  native: кыргыз тили
+
+la:
+  english: Latin
+  native: latine; lingua latina
+
+lb:
+  english: Luxembourgish
+  native: Lëtzebuergesch
+
+lg:
+  english: Ganda
+  native: Luganda
+
+li:
+  english: Limburgish
+  native: Limburgs
+
+ln:
+  english: Lingala
+  native: Lingála
+
+lo:
+  english: Lao
+  native: ພາສາລາວ
+
+lt:
+  english: Lithuanian
+  native: lietuvių kalba
+
+lu:
+  english: Luba-Katanga
+  native: 
+
+lv:
+  english: Latvian
+  native: latviešu valoda
+
+mg:
+  english: Malagasy
+  native: Malagasy fiteny
+
+mh:
+  english: Marshallese
+  native: Kajin M̧ajeļ
+
+mi:
+  english: Māori
+  native: te reo Māori
+
+mk:
+  english: Macedonian
+  native: македонски јазик
+
+ml:
+  english: Malayalam
+  native: മലയാളം
+
+mn:
+  english: Mongolian
+  native: Монгол
+
+mr:
+  english: Marathi
+  native: मराठी
+
+ms:
+  english: Malay
+  native: bahasa Melayu; بهاس ملايو‎
+
+mt:
+  english: Maltese
+  native: Malti
+
+my:
+  english: Burmese
+  native: ဗမာစာ
+
+na:
+  english: Nauru
+  native: Ekakairũ Naoero
+
+nb:
+  english: Norwegian Bokmål
+  native: Norsk bokmål
+
+nd:
+  english: North Ndebele
+  native: isiNdebele
+
+ne:
+  english: Nepali
+  native: नेपाली
+
+ng:
+  english: Ndonga
+  native: Owambo
+
+nl:
+  english: Dutch
+  native: Nederlands
+
+nn:
+  english: Norwegian Nynorsk
+  native: Norsk nynorsk
+
+no:
+  english: Norwegian
+  native: Norsk
+
+nr:
+  english: South Ndebele
+  native: isiNdebele
+
+nv:
+  english: Navajo
+  native: Diné bizaad; Dinékʼehǰí
+
+ny:
+  english: Chichewa
+  native: chiCheŵa; chinyanja
+
+oc:
+  english: Occitan
+  native: Occitan
+
+oj:
+  english: Ojibwa
+  native: ᐊᓂᔑᓈᐯᒧᐎᓐ
+
+om:
+  english: Oromo
+  native: Afaan Oromoo
+
+or:
+  english: Oriya
+  native: ଓଡ଼ିଆ
+
+os:
+  english: Ossetian
+  native: Ирон æвзаг
+
+pa:
+  english: Panjabi
+  native: ਪੰਜਾਬੀ; پنجابی‎
+
+pi:
+  english: Pāli
+  native: पाऴि
+
+pl:
+  english: Polish
+  native: polski
+
+ps:
+  english: Pashto
+  native: پښتو
+
+pt:
+  english: Portuguese
+  native: Português
+
+qu:
+  english: Quechua
+  native: Runa Simi; Kichwa
+
+rm:
+  english: Raeto-Romance
+  native: rumantsch grischun
+
+rn:
+  english: Kirundi
+  native: kiRundi
+
+ro:
+  english: Romanian
+  native: română
+
+ru:
+  english: Russian
+  native: русский язык
+
+rw:
+  english: Kinyarwanda
+  native: Ikinyarwanda
+
+sa:
+  english: Sanskrit
+  native: संस्कृतम्
+
+sc:
+  english: Sardinian
+  native: sardu
+
+sd:
+  english: Sindhi
+  native: सिन्धी; سنڌي، سندھی‎
+
+se:
+  english: Northern Sami
+  native: Davvisámegiella
+
+sg:
+  english: Sango
+  native: yângâ tî sängö
+
+si:
+  english: Sinhala
+  native: සිංහල
+
+sk:
+  english: Slovak
+  native: slovenčina
+
+sl:
+  english: Slovenian
+  native: slovenščina
+
+sm:
+  english: Samoan
+  native: gagana fa'a Samoa
+
+sn:
+  english: Shona
+  native: chiShona
+
+so:
+  english: Somali
+  native: Soomaaliga; af Soomaali
+
+sq:
+  english: Albanian
+  native: Shqip
+
+sr:
+  english: Serbian
+  native: српски језик
+
+ss:
+  english: Swati
+  native: SiSwati
+
+st:
+  english: Southern Sotho
+  native: Sesotho
+
+su:
+  english: Sundanese
+  native: Basa Sunda
+
+sv:
+  english: Swedish
+  native: svenska
+
+sw:
+  english: Swahili
+  native: Kiswahili
+
+ta:
+  english: Tamil
+  native: தமிழ்
+
+te:
+  english: Telugu
+  native: తెలుగు
+
+tg:
+  english: Tajik
+  native: тоҷикӣ; toğikī; تاجیکی‎
+
+th:
+  english: Thai
+  native: ไทย
+
+ti:
+  english: Tigrinya
+  native: ትግርኛ
+
+tk:
+  english: Turkmen
+  native: Türkmen; Түркмен
+
+tl:
+  english: Tagalog
+  native: Tagalog
+
+tn:
+  english: Tswana
+  native: Setswana
+
+to:
+  english: Tonga
+  native: faka Tonga
+
+tr:
+  english: Turkish
+  native: Türkçe
+
+ts:
+  english: Tsonga
+  native: Xitsonga
+
+tt:
+  english: Tatar
+  native: татарча; tatarça; تاتارچا‎
+
+tw:
+  english: Twi
+  native: Twi
+
+ty:
+  english: Tahitian
+  native: Reo Mā`ohi
+
+ug:
+  english: Uighur
+  native: Uyƣurqə; ئۇيغۇرچە‎
+
+uk:
+  english: Ukrainian
+  native: Українська
+
+ur:
+  english: Urdu
+  native: اردو
+
+uz:
+  english: Uzbek
+  native: O'zbek; Ўзбек; أۇزبېك‎
+
+ve:
+  english: Venda
+  native: Tshivenḓa
+
+vi:
+  english: Vietnamese
+  native: Tiếng Việt
+
+vo:
+  english: Volapük
+  native: Volapük
+
+wa:
+  english: Walloon
+  native: Walon
+
+wo:
+  english: Wolof
+  native: Wollof
+
+xh:
+  english: Xhosa
+  native: isiXhosa
+
+yi:
+  english: Yiddish
+  native: ייִדיש
+
+yo:
+  english: Yoruba
+  native: Yorùbá
+
+za:
+  english: Zhuang
+  native: Saɯ cueŋƅ; Saw cuengh
+
+zh:
+  english: Chinese
+  native: 中文 (Zhōngwén), 汉语, 漢語
+
+zu:
+  english: Zulu
+  native: isiZulu
index 4b45ce33fb206198e2b166045e0c3fc279fe15c6..6b8973cf32d6c9f5fd98fa0914634603f985b8be 100644 (file)
@@ -26,4 +26,3 @@ class CreateLanguages < ActiveRecord::Migration
     raise IrreversibleMigration.new
   end
 end
-
diff --git a/test/fixtures/languages.yml b/test/fixtures/languages.yml
new file mode 100644 (file)
index 0000000..e992da2
--- /dev/null
@@ -0,0 +1,11 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+en:
+  code: en
+  english_name: English
+  native_name: English
+
+de:
+  code: de
+  english_name: German
+  native_name: Deutsch
diff --git a/test/unit/language_test.rb b/test/unit/language_test.rb
new file mode 100644 (file)
index 0000000..da30044
--- /dev/null
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class LanguageTest < ActiveSupport::TestCase
+  test "language count" do
+    assert_equal 2, Language.count
+  end
+end