Merged I18N branch to head.
authorTom Hughes <tom@compton.nu>
Sun, 31 May 2009 17:26:41 +0000 (17:26 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 31 May 2009 17:26:41 +0000 (17:26 +0000)
app/models/language.rb [deleted file]
config/initializers/available_locales.rb [deleted file]
config/languages.yml [deleted file]
db/migrate/032_add_user_locale.rb [deleted file]
db/migrate/033_change_diary_entries_language.rb [deleted file]
db/migrate/034_create_languages.rb [deleted file]
test/fixtures/languages.yml [deleted file]
test/unit/language_test.rb [deleted file]

diff --git a/app/models/language.rb b/app/models/language.rb
deleted file mode 100644 (file)
index a33c760..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-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
deleted file mode 100644 (file)
index 026be26..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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
deleted file mode 100644 (file)
index df0a832..0000000
+++ /dev/null
@@ -1,735 +0,0 @@
-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
diff --git a/db/migrate/032_add_user_locale.rb b/db/migrate/032_add_user_locale.rb
deleted file mode 100644 (file)
index de36547..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-class AddUserLocale < ActiveRecord::Migration
-  def self.up
-    add_column "users", "locale", :string
-  end
-
-  def self.down
-    remove_column "users", "locale"
-  end
-end
diff --git a/db/migrate/033_change_diary_entries_language.rb b/db/migrate/033_change_diary_entries_language.rb
deleted file mode 100644 (file)
index 2ca8448..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-class ChangeDiaryEntriesLanguage < ActiveRecord::Migration
-  def self.up
-    remove_column "diary_entries", "language"
-    add_column "diary_entries", "language_code", :string
-  end
-
-  def self.down
-    remove_column "diary_entries", "language_code"
-    add_column "diary_entries", "language", :string, :limit => 3
-  end
-end
diff --git a/db/migrate/034_create_languages.rb b/db/migrate/034_create_languages.rb
deleted file mode 100644 (file)
index 17f5efe..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'lib/migrate'
-
-class CreateLanguages < ActiveRecord::Migration
-  def self.up
-    create_table :languages, innodb_table do |t|
-      t.string :code, :null => false
-      t.string :english_name, :null => false
-      t.string :native_name
-    end
-
-    add_primary_key :languages, [:code]
-
-    YAML.load(File.read(RAILS_ROOT + "/config/languages.yml")).each do |k,v|
-      Language.create do |l|
-        l.code = k
-        l.english_name = v["english"]
-        l.native_name = v["native"]
-      end
-    end
-
-    add_foreign_key :users, [:locale], :languages, [:code]
-    add_foreign_key :diary_entries, [:language_code], :languages, [:code]    
-  end
-
-  def self.down
-    remove_foreign_key :diary_entries, [:language_code], :languages, [:code]
-    remove_foreign_key :users, [:locale], :languages, [:code]
-
-    drop_table :languages
-  end
-end
-
diff --git a/test/fixtures/languages.yml b/test/fixtures/languages.yml
deleted file mode 100644 (file)
index e992da2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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
deleted file mode 100644 (file)
index da30044..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.dirname(__FILE__) + '/../test_helper'
-
-class LanguageTest < ActiveSupport::TestCase
-  test "language count" do
-    assert_equal 2, Language.count
-  end
-end