Permalink
Browse files

import from old svn hosting (revision 200)

  • Loading branch information...
0 parents commit a727ed7f1dda9870a025593c0e0cfc34130dfdc1 @yannlugrin committed Oct 13, 2006
Showing with 8,324 additions and 0 deletions.
  1. +9 −0 LICENSE
  2. +49 −0 README
  3. +240 −0 data/country_data.csv
  4. +188 −0 data/language_data.csv
  5. +3,421 −0 data/translation_data.csv
  6. +10 −0 generators/globalize/USAGE
  7. +42 −0 generators/globalize/globalize_generator.rb
  8. BIN generators/globalize/templates/migration.rb.gz
  9. BIN generators/globalize/templates/tiny_migration.rb.gz
  10. +30 −0 init.rb
  11. +170 −0 lib/globalize/localization/core_ext.rb
  12. +33 −0 lib/globalize/localization/core_ext_hooks.rb
  13. +496 −0 lib/globalize/localization/db_translate.rb
  14. +152 −0 lib/globalize/localization/db_view_translator.rb
  15. +173 −0 lib/globalize/localization/locale.rb
  16. +40 −0 lib/globalize/localization/rfc_3066.rb
  17. +24 −0 lib/globalize/models/country.rb
  18. +188 −0 lib/globalize/models/currency.rb
  19. +84 −0 lib/globalize/models/language.rb
  20. +4 −0 lib/globalize/models/model_translation.rb
  21. +9 −0 lib/globalize/models/translation.rb
  22. +14 −0 lib/globalize/models/view_translation.rb
  23. +122 −0 lib/globalize/rails/action_mailer.rb
  24. +62 −0 lib/globalize/rails/action_view.rb
  25. +129 −0 lib/globalize/rails/active_record.rb
  26. +83 −0 lib/globalize/rails/date_helper.rb
  27. +81 −0 populators/pop_dates.rb
  28. +18 −0 populators/pop_migration.rb
  29. +26 −0 populators/pop_pluralization.rb
  30. +32 −0 populators/pop_seps.rb
  31. +121 −0 tasks/data.rake
  32. +54 −0 test/action_mailer_test.rb
  33. +1 −0 test/action_mailer_test/globalize_mailer/test.en-US.plain.text.rhtml
  34. +1 −0 test/action_mailer_test/globalize_mailer/test.en.plain.text.rhtml
  35. +1 −0 test/action_mailer_test/globalize_mailer/test.he.plain.text.rhtml
  36. +1 −0 test/action_mailer_test/globalize_mailer/test.plain.text.rhtml
  37. +13 −0 test/config/database.yml
  38. +61 −0 test/core_ext_test.rb
  39. +131 −0 test/currency_test.rb
  40. +634 −0 test/date_helper_test.rb
  41. +85 −0 test/db/schema.rb
  42. +335 −0 test/db_translation_test.rb
  43. +7 −0 test/fixtures/globalize_categories.yml
  44. +7 −0 test/fixtures/globalize_categories_products.yml
  45. +41 −0 test/fixtures/globalize_countries.yml
  46. +64 −0 test/fixtures/globalize_languages.yml
  47. +5 −0 test/fixtures/globalize_manufacturers.yml
  48. +29 −0 test/fixtures/globalize_products.yml
  49. +335 −0 test/fixtures/globalize_translations.yml
  50. +27 −0 test/locale_test.rb
  51. +17 −0 test/model_test.rb
  52. +33 −0 test/standard_data_test_helper.rb
  53. +19 −0 test/test_helper.rb
  54. +54 −0 test/test_standard_data.rb
  55. +29 −0 test/validation_test.rb
  56. +49 −0 test/view_picking_test.rb
  57. +237 −0 test/view_translation_test.rb
  58. +1 −0 test/views/test.he-IL.rhtml
  59. +1 −0 test/views/test.rhtml
  60. +1 −0 test/views/test2.he.rhtml
  61. +1 −0 test/views/test2.rhtml
@@ -0,0 +1,9 @@
+Copyright (c) 2005 Joshua Harvey [Jerusalem, Israel]
+
+This is the MIT license, the license Ruby on Rails itself is licensed under.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49 README
@@ -0,0 +1,49 @@
+=Welcome to Globalize
+
+*Globalize* is a Ruby on Rails plugin designed to support globalized applications. It supports translation into multiple languages (for both db content and controller and view code) and localization of time, data, and numbers. It's under the MIT License, same as Ruby on Rails.
+
+==How to use it
+
+===In your models
+
+ class Product < ActiveRecord::Base
+ translates :name, :description, :specs
+ end
+
+Then:
+
+ Locale.set("en-US")
+ prod = Product.find(1)
+
+<tt>prod.name -> "Meatballs"</tt>
+
+ Locale.set("es-ES")
+ prod = Product.find(1)
+
+<tt>prod.name -> "Albondigas"</tt>
+
+=== In your views (or anywhere else)
+
+ Locale.set("he-IL")
+ <%= "Thanks for ordering!".t %> -> "תודה על ההזמנה!"
+ <%= "You've got %d items in your cart" / 5 %> -> "יש 5 מוצרים בסל שלך"
+
+ Locale.set("es-ES")
+ <%= Time.now.loc("%d %B %Y") %> -> "17 Octubre 2005"
+ <%= 12345.45.loc %> -> "12.345,45"
+
+There's more, but let's save that for later.
+
+==How to install
+
+From your rails app root directory:
+
+1. <tt>script/plugin install http://svn.globalize-rails.org/svn/globalize/globalize/trunk</tt>
+1. <tt>rake globalize:setup</tt> (might take a while, about a minute or so)
+
+...and you're globalized, dude!
+
+Optionally, try:
+
+* <tt>rake test_plugins</tt>
+* <tt>rake plugindoc</tt>
@@ -0,0 +1,240 @@
+"id","code","english_name","date_format","currency_format","currency_code","thousands_sep","decimal_sep","currency_decimal_sep","number_grouping_scheme"
+1,"AD","Andorra",,,"EUR",,,,"western"
+2,"AE","United Arab Emirates",,,"AED",",",".",".","western"
+3,"AF","Afghanistan",,,"AFA",,,,"western"
+4,"AG","Antigua and Barbuda",,,"XCD",,,,"western"
+5,"AI","Anguilla",,,"XCD",,,,"western"
+6,"AL","Albania",,,"ALL",".",",",",","western"
+7,"AM","Armenia",,,"AMD",,,,"western"
+8,"AN","Netherlands Antilles",,,"ANG",,,,"western"
+9,"AO","Angola",,,"AON",,,,"western"
+10,"AQ","Antarctica",,,"NOK",,,,"western"
+11,"AR","Argentina",,,"ARA",".",",",",","western"
+12,"AS","American Samoa",,,"USD",,,,"western"
+13,"AT","Austria",,"€ %n","EUR",,",",",","western"
+14,"AU","Australia",,,"AUD",",",".",".","western"
+15,"AW","Aruba",,,"AWG",,,,"western"
+16,"AZ","Azerbaijan",,,"AZM",,".",".","western"
+17,"BA","Bosnia and Herzegovina",,,"BAM",,",",",","western"
+18,"BB","Barbados",,,"BBD",,,,"western"
+19,"BD","Bangladesh",,,"BDT",",",".",".","western"
+20,"BE","Belgium",,"%n €","EUR",".",",",",","western"
+21,"BF","Burkina Faso",,,"XAF",,,,"western"
+22,"BG","Bulgaria",,,"BGL"," ",",",",","western"
+23,"BH","Bahrain",,,"BHD",",",".",".","western"
+24,"BI","Burundi",,,"BIF",,,,"western"
+25,"BJ","Benin",,,"XAF",,,,"western"
+26,"BM","Bermuda",,,"BMD",,,,"western"
+27,"BN","Brunei Darussalam",,,"BND",,,,"western"
+28,"BO","Bolivia",,,"BOB",".",",",",","western"
+29,"BR","Brazil",,"R$%n","BRR",".",",",",","western"
+30,"BS","Bahamas",,,"BSD",,,,"western"
+31,"BT","Bhutan",,,"BTN",,,,"western"
+32,"BV","Bouvet Island",,,"NOK",,,,"western"
+33,"BW","Botswana",,,"BWP",",",".",".","western"
+34,"BY","Belarus",,,"BYR",,".",".","western"
+35,"BZ","Belize",,,"BZD",,,,"western"
+36,"CA","Canada",,,"CAD",",",".",".","western"
+37,"CC","Cocos Islands",,,"AUD",,,,"western"
+38,"CD","Congo",,,,,,,"western"
+39,"CF","Central African Republic",,,"XAF",,,,"western"
+40,"CG","Congo",,,"XAF",,,,"western"
+41,"CH","Switzerland",,"SFr. %n","CHF","'",",",".","western"
+42,"CI","Cote D'Ivoire",,,"XAF",,,,"western"
+43,"CK","Cook Islands",,,"NZD",,,,"western"
+44,"CL","Chile",,,"CLF",".",",",",","western"
+45,"CM","Cameroon",,,"XAF",,,,"western"
+46,"CN","China",,"Y%n","CNY",",",".",".","western"
+47,"CO","Colombia",,,"COP",".",",",",","western"
+48,"CR","Costa Rica",,,"CRC",",",".",".","western"
+49,"CS","Serbia and Montenegro",,,"CSD",,,,"western"
+50,"CU","Cuba",,,"CUP",,,,"western"
+51,"CV","Cape Verde",,,"CVE",,,,"western"
+52,"CX","Christmas Island",,,"AUD",,,,"western"
+53,"CY","Cyprus",,,"CYP",,,,"western"
+54,"CZ","Czech Republic",,,"CZK"," ",",",",","western"
+55,"DE","Germany",,"%n €","EUR",".",",",",","western"
+56,"DJ","Djibouti",,,"DJF",,,,"western"
+57,"DK","Denmark",,,"DKK",".",",",",","western"
+58,"DM","Dominica",,,"XCD",,,,"western"
+59,"DO","Dominican Republic",,,"DOP",",",".",".","western"
+60,"DZ","Algeria",,,"DZD",",",".",".","western"
+61,"EC","Ecuador",,,"USD",".",",",",","western"
+62,"EE","Estonia",,,"EEK"," ",",",",","western"
+63,"EG","Egypt",,,"EGP",",",".",".","western"
+64,"EH","Western Sahara",,,"MAD",,,,"western"
+65,"ER","Eritrea",,,"ERN",",",".",".","western"
+66,"ES","Spain",,"%n €","EUR",".",",",",","western"
+67,"ET","Ethiopia",,,"ETB",",",".",".","western"
+68,"FI","Finland",,,"EUR"," ",",",",","western"
+69,"FJ","Fiji",,,"FJD",,,,"western"
+70,"FK","Falkland Islands",,,"FKP",,,,"western"
+71,"FM","Micronesia",,,"USD",,,,"western"
+72,"FO","Faeroe Islands",,,"DKK",".",",",",","western"
+73,"FR","France",,"%n €","EUR",,",",",","western"
+74,"GA","Gabon",,,"XAF",,,,"western"
+75,"GB","United Kingdom",,"£%n","GBP",",",".",".","western"
+76,"GD","Grenada",,,"XCD",,,,"western"
+77,"GE","Georgia",,,"GEL",".",",",",","western"
+78,"GF","French Guiana",,,"EUR",,,,"western"
+79,"GH","Ghana",,,"GHC",,,,"western"
+80,"GI","Gibraltar",,,"GIP",,,,"western"
+81,"GL","Greenland",,,"DKK",".",",",",","western"
+82,"GM","Gambia",,,"GMD",,,,"western"
+83,"GN","Guinea",,,"GNS",,,,"western"
+84,"GP","Guadaloupe",,,"EUR",,,,"western"
+85,"GQ","Equatorial Guinea",,,"XAF",,,,"western"
+86,"GR","Greece",,,"EUR",".",",",",","western"
+87,"GS","South Georgia and the South Sandwich Islands",,,"GBP",,,,"western"
+88,"GT","Guatemala",,,"GTQ",",",".",".","western"
+89,"GU","Guam",,,"USD",,,,"western"
+90,"GW","Guinea-Bissau",,,"GWP",,,,"western"
+91,"GY","Guyana",,,"GYD",,,,"western"
+92,"HK","Hong Kong",,"HK$%n","HKD",",",".",".","western"
+93,"HM","Heard and McDonald Islands",,,"AUD",,,,"western"
+94,"HN","Honduras",,,"HNL",",",".",".","western"
+95,"HR","Hrvatska",,,"HRK",,",",",","western"
+96,"HT","Haiti",,,"HTG",,,,"western"
+97,"HU","Hungary",,,"HUF",".",",",",","western"
+98,"ID","Indonesia",,,"IDR",".",",",",","western"
+99,"IE","Ireland",,,"EUR",",",".",".","western"
+100,"IL","Israel",,"%n ₪","ILS",",",".",".","western"
+101,"IN","India",,"Rs.%n","INR",",",".",".","indian"
+102,"IO","British Indian Ocean Territory",,,"GBP",,,,"western"
+103,"IQ","Iraq",,,"IQD",",",".",".","western"
+104,"IR","Iran",,,"IRR","٬","٫","٫","western"
+105,"IS","Iceland",,,"ISK",".",",",",","western"
+106,"IT","Italy",,"€ %n","EUR",".",",",",","western"
+107,"JM","Jamaica",,,"JMD",,,,"western"
+108,"JO","Jordan",,,"JOD",",",".",".","western"
+109,"JP","Japan",,"¥%n","JPY",",",".",".","western"
+110,"KE","Kenya",,,"KES",,,,"western"
+111,"KG","Kyrgyz Republic",,,"KGS",,,,"western"
+112,"KH","Cambodia",,,"KHR",,,,"western"
+113,"KI","Kiribati",,,"AUD",,,,"western"
+114,"KM","Comoros",,,"KMF",,,,"western"
+115,"KN","St. Kitts and Nevis",,,"XCD",,,,"western"
+116,"KP","Korea",,,"KPW",,,,"western"
+117,"KR","Korea",,,"KRW",",",".",".","western"
+118,"KW","Kuwait",,,"KWD",",",".",".","western"
+119,"KY","Cayman Islands",,,"KYD",,,,"western"
+120,"KZ","Kazakhstan",,,"KZT",,,,"western"
+121,"LA","Lao People's Democratic Republic",,,"LAK",",",".",".","western"
+122,"LB","Lebanon",,,"LBP",",",".",".","western"
+123,"LC","St. Lucia",,,"XCD",,,,"western"
+124,"LI","Liechtenstein",,,"CHF",,,,"western"
+125,"LK","Sri Lanka",,,"LKR",,,,"western"
+126,"LR","Liberia",,,"LRD",,,,"western"
+127,"LS","Lesotho",,,"LSL",,,,"western"
+128,"LT","Lithuania",,,"LTL",".",",",",","western"
+129,"LU","Luxembourg",,,"EUR",".",",",",","western"
+130,"LV","Latvia",,,"LVL"," ",",",",","western"
+131,"LY","Libyan Arab Jamahiriya",,,"LYD",",",".",".","western"
+132,"MA","Morocco",,,"MAD",",",".",".","western"
+133,"MC","Monaco",,,"EUR",,,,"western"
+134,"MD","Moldova",,,"MDL",,,,"western"
+135,"MG","Madagascar",,,"MGF",,,,"western"
+136,"MH","Marshall Islands",,,"USD",,,,"western"
+137,"MK","Macedonia",,,"MKD",,",",",","western"
+138,"ML","Mali",,,"XAF",,,,"western"
+139,"MM","Myanmar",,,,,,,"western"
+140,"MN","Mongolia",,,"MNT",,".",".","western"
+141,"MO","Macao",,,"MOP",,,,"western"
+142,"MP","Northern Mariana Islands",,,"USD",,,,"western"
+143,"MQ","Martinique",,,"EUR",,,,"western"
+144,"MR","Mauritania",,,"MRO",,,,"western"
+145,"MS","Montserrat",,,"XCD",,,,"western"
+146,"MT","Malta",,,"MTL",",",".",".","western"
+147,"MU","Mauritius",,,"MUR",,,,"western"
+148,"MV","Maldives",,,"MVR",,,,"western"
+149,"MW","Malawi",,,"MWK",,,,"western"
+150,"MX","Mexico",,,"MXN",",",".",".","western"
+151,"MY","Malaysia",,,"MYR",",",".",".","western"
+152,"MZ","Mozambique",,,"MZM",,,,"western"
+153,"NA","Namibia",,,"NAD",,,,"western"
+154,"NC","New Caledonia",,,"XPF",,,,"western"
+155,"NE","Niger",,,"XOF",,,,"western"
+156,"NF","Norfolk Island",,,"AUD",,,,"western"
+157,"NG","Nigeria",,,"NGN",,,,"western"
+158,"NI","Nicaragua",,,"NIC",",",".",".","western"
+159,"NL","Netherlands",,"€ %n","EUR",,",",",","western"
+160,"NO","Norway",,"kr %n","NOK"," ",",",",","western"
+161,"NP","Nepal",,,"NPR",",",".",".","western"
+162,"NR","Nauru",,,"AUD",,,,"western"
+163,"NU","Niue",,,"NZD",,,,"western"
+164,"NZ","New Zealand",,,"NZD",",",".",".","western"
+165,"OM","Oman",,,"OMR",",",".",".","western"
+166,"PA","Panama",,,"PAB",",",".",".","western"
+167,"PE","Peru",,,"PEI",",",".",".","western"
+168,"PF","French Polynesia",,,"XPF",,,,"western"
+169,"PG","Papua New Guinea",,,"PGK",,,,"western"
+170,"PH","Philippines",,,"PHP",",",".",".","western"
+171,"PK","Pakistan",,,"PKR",",",".",".","western"
+172,"PL","Poland",,,"PLN",".",",",",","western"
+173,"PM","St. Pierre and Miquelon",,,"EUR",,,,"western"
+174,"PN","Pitcairn Island",,,"NZD",,,,"western"
+175,"PR","Puerto Rico",,,"USD",",",".",".","western"
+176,"PS","Palestinian Territory",,,,,,,"western"
+177,"PT","Portugal",,"%n €","EUR",".","$","$","western"
+178,"PW","Palau",,,"USD",,,,"western"
+179,"PY","Paraguay",,,"PYG",".",",",",","western"
+180,"QA","Qatar",,,"QAR",",",".",".","western"
+181,"RE","Reunion",,,"EUR",,,,"western"
+182,"RO","Romania",,,"ROL",".",",",",","western"
+183,"RU","Russian Federation",,,"RUB",,".",".","western"
+184,"RW","Rwanda",,,"RWF",,,,"western"
+185,"SA","Saudi Arabia",,,"SAR",,".",".","western"
+186,"SB","Solomon Islands",,,"SBD",,,,"western"
+187,"SC","Seychelles",,,"SCR",,,,"western"
+188,"SD","Sudan",,,"SDP",",",".",".","western"
+189,"SE","Sweden",,"%n kr","SEK",,",",",","western"
+190,"SG","Singapore",,,"SGD",",",".",".","western"
+191,"SH","St. Helena",,,"SHP",,,,"western"
+192,"SI","Slovenia",,,"SIT",,",",",","western"
+193,"SJ","Svalbard & Jan Mayen Islands",,,"NOK",,,,"western"
+194,"SK","Slovakia",,,"SKK"," ",",",",","western"
+195,"SL","Sierra Leone",,,"SLL",,,,"western"
+196,"SM","San Marino",,,"EUR",,,,"western"
+197,"SN","Senegal",,,"XOF",,,,"western"
+198,"SO","Somalia",,,"SOS",,,,"western"
+199,"SR","Suriname",,,"SRG",,,,"western"
+200,"ST","Sao Tome and Principe",,,"STD",,,,"western"
+201,"SV","El Salvador",,,"SVC",",",".",".","western"
+202,"SY","Syrian Arab Republic",,,"SYP",",",".",".","western"
+203,"SZ","Swaziland",,,"SZL",,,,"western"
+204,"TC","Turks and Caicos Islands",,,"USD",,,,"western"
+205,"TD","Chad",,,"XAF",,,,"western"
+206,"TF","French Southern Territories",,,"EUR",,,,"western"
+207,"TG","Togo",,,"XAF",,,,"western"
+208,"TH","Thailand",,,"THB",",",".",".","western"
+209,"TJ","Tajikistan",,,"TJR",,".",".","western"
+210,"TK","Tokelau",,,"NZD",,,,"western"
+211,"TL","Timor-Leste",,,,,,,"western"
+212,"TM","Turkmenistan",,,"TMM",,,,"western"
+213,"TN","Tunisia",,,"TND",",",".",".","western"
+214,"TO","Tonga",,,"TOP",,,,"western"
+215,"TR","Turkey",,,"TRL",".",",",",","western"
+216,"TT","Trinidad and Tobago",,,"TTD",,,,"western"
+217,"TV","Tuvalu",,,"AUD",,,,"western"
+218,"TW","Taiwan",,"NT$%n","TWD",",",".",".","western"
+219,"TZ","Tanzania",,,"TZS",,,,"western"
+220,"UA","Ukraine",,,"UAH",,".",".","western"
+221,"UG","Uganda",,,"UGS",",",".",".","western"
+222,"UM","United States Minor Outlying Islands",,,"USD",,,,"western"
+223,"US","United States of America",,,"USD",",",".",".","western"
+224,"UY","Uruguay",,,"UYU",".",",",",","western"
+225,"UZ","Uzbekistan",,,"UZS",",",".",".","western"
+226,"VA","Holy See",,,"EUR",,,,"western"
+227,"VC","St. Vincent and the Grenadines",,,"XCD",,,,"western"
+228,"VE","Venezuela",,,"VEB",".",",",",","western"
+229,"VG","British Virgin Islands",,,"USD",,,,"western"
+230,"VI","US Virgin Islands",,,"USD",,,,"western"
+231,"VN","Viet Nam",,,"VND",".",",",",","western"
+232,"VU","Vanuatu",,,"VUV",,,,"western"
+233,"WF","Wallis and Futuna Islands",,,"XPF",,,,"western"
+234,"WS","Samoa",,,"WST",,,,"western"
+235,"YE","Yemen",,,,",",".",".","western"
+236,"YT","Mayotte",,,"EUR",,,,"western"
+237,"ZA","South Africa",,,"ZAR",",",".",".","western"
+238,"ZM","Zambia",,,"ZMK",,,,"western"
+239,"ZW","Zimbabwe",,,"ZWD",",",".",".","western"
Oops, something went wrong.

0 comments on commit a727ed7

Please sign in to comment.