gettext 1.10.0 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +156 -2
- data/NEWS +28 -0
- data/README +128 -138
- data/Rakefile +83 -43
- data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/hu/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/hu/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ua/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ua/LC_MESSAGES/rgettext.mo +0 -0
- data/doc/classes/ActiveRecord/Base.html +360 -0
- data/doc/classes/ActiveRecord/ConnectionAdapters/Column.html +182 -0
- data/doc/classes/ActiveRecord/Migration.html +118 -0
- data/doc/classes/GetText.html +1790 -0
- data/doc/classes/GetText/ActiveRecordParser.html +236 -0
- data/doc/classes/GetText/Container.html +119 -0
- data/doc/classes/GetText/ErbContainer.html +223 -0
- data/doc/classes/GetText/ErbParser.html +156 -0
- data/doc/classes/GetText/GladeParser.html +133 -0
- data/doc/classes/GetText/NoboundTextDomainError.html +119 -0
- data/doc/classes/GetText/PoParser.html +169 -0
- data/doc/classes/GetText/Rails.html +293 -0
- data/doc/classes/GetText/RubyParser.html +123 -0
- data/doc/classes/GetText/TextDomain.html +572 -0
- data/doc/classes/GetText/TextDomainManager.html +443 -0
- data/doc/classes/Iconv.html +257 -0
- data/doc/classes/Iconv/Failure.html +105 -0
- data/doc/classes/Iconv/IllegalSequence.html +118 -0
- data/doc/classes/Iconv/InvalidCharacter.html +118 -0
- data/doc/classes/Iconv/InvalidEncoding.html +118 -0
- data/doc/classes/Locale.html +839 -0
- data/doc/classes/Locale/Object.html +799 -0
- data/doc/classes/Locale/SystemBase.html +271 -0
- data/doc/classes/Locale/SystemCGI.html +312 -0
- data/doc/classes/Locale/SystemJRuby.html +112 -0
- data/doc/classes/Locale/SystemPosix.html +113 -0
- data/doc/classes/Locale/SystemWin32.html +182 -0
- data/doc/classes/MOFile.html +678 -0
- data/doc/classes/MOFile/InvalidFormat.html +111 -0
- data/doc/classes/Module.html +158 -0
- data/doc/classes/String.html +225 -0
- data/doc/created.rid +1 -0
- data/doc/files/ChangeLog.html +2355 -0
- data/doc/files/README.html +510 -0
- data/doc/files/lib/gettext/active_record_rb.html +110 -0
- data/doc/files/lib/gettext/cgi_rb.html +110 -0
- data/doc/files/lib/gettext/container_rb.html +108 -0
- data/doc/files/lib/gettext/erb_rb.html +109 -0
- data/doc/files/lib/gettext/iconv_rb.html +109 -0
- data/doc/files/lib/gettext/mo_rb.html +108 -0
- data/doc/files/lib/gettext/parser/active_record_rb.html +119 -0
- data/doc/files/lib/gettext/parser/erb_rb.html +109 -0
- data/doc/files/lib/gettext/parser/glade_rb.html +109 -0
- data/doc/files/lib/gettext/parser/ruby_rb.html +110 -0
- data/doc/files/lib/gettext/poparser_rb.html +108 -0
- data/doc/files/lib/gettext/rails_compat_rb.html +108 -0
- data/doc/files/lib/gettext/rails_rb.html +112 -0
- data/doc/files/lib/gettext/rgettext_rb.html +110 -0
- data/doc/files/lib/gettext/rmsgfmt_rb.html +112 -0
- data/doc/files/lib/gettext/rmsgmerge_rb.html +112 -0
- data/doc/files/lib/gettext/string_rb.html +101 -0
- data/doc/files/lib/gettext/textdomain_rb.html +109 -0
- data/doc/files/lib/gettext/textdomainmanager_rb.html +109 -0
- data/doc/files/lib/gettext/utils_rb.html +111 -0
- data/doc/files/lib/gettext/version_rb.html +101 -0
- data/doc/files/lib/gettext_rb.html +113 -0
- data/doc/files/lib/locale/base_rb.html +101 -0
- data/doc/files/lib/locale/cgi_rb.html +108 -0
- data/doc/files/lib/locale/jruby_rb.html +110 -0
- data/doc/files/lib/locale/object_rb.html +101 -0
- data/doc/files/lib/locale/posix_rb.html +108 -0
- data/doc/files/lib/locale/win32_rb.html +110 -0
- data/doc/files/lib/locale/win32_table_rb.html +101 -0
- data/doc/files/lib/locale_rb.html +111 -0
- data/doc/fr_class_index.html +57 -0
- data/doc/fr_file_index.html +58 -0
- data/doc/fr_method_index.html +155 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/gettext.rb +102 -50
- data/lib/gettext/cgi.rb +2 -27
- data/lib/gettext/iconv.rb +76 -62
- data/lib/gettext/mo.rb +3 -3
- data/lib/gettext/parser/erb.rb +2 -2
- data/lib/gettext/rails.rb +69 -48
- data/lib/gettext/rgettext.rb +2 -2
- data/lib/gettext/rmsgmerge.rb +2 -2
- data/lib/gettext/string.rb +9 -5
- data/lib/gettext/textdomain.rb +3 -3
- data/lib/gettext/textdomainmanager.rb +5 -5
- data/lib/gettext/utils.rb +4 -3
- data/lib/gettext/version.rb +1 -1
- data/lib/{gettext/locale.rb → locale.rb} +11 -58
- data/lib/locale/base.rb +60 -0
- data/lib/{gettext/locale_cgi.rb → locale/cgi.rb} +30 -28
- data/lib/locale/jruby.rb +36 -0
- data/lib/{gettext/locale_object.rb → locale/object.rb} +78 -24
- data/lib/locale/posix.rb +22 -0
- data/lib/locale/win32.rb +48 -0
- data/lib/{gettext/locale_table_win32.rb → locale/win32_table.rb} +3 -2
- data/po/es/rails.po +1 -2
- data/po/hu/rails.po +139 -0
- data/po/hu/rgettext.po +126 -0
- data/po/ja/rails.po +5 -5
- data/po/ua/rails.po +150 -0
- data/po/ua/rgettext.po +132 -0
- data/pre-setup.rb +2 -4
- data/samples/cgi/cookie.cgi +1 -0
- data/samples/cgi/helloerb1.cgi +6 -3
- data/samples/cgi/helloerb2.cgi +6 -3
- data/samples/cgi/http.rb +3 -7
- data/samples/cgi/index.cgi +2 -1
- data/samples/cgi/locale/hu/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/hu/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/hu/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/hu/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/ua/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/ua/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/ua/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/ua/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/po/hu/helloerb1.po +59 -0
- data/samples/cgi/po/hu/helloerb2.po +51 -0
- data/samples/cgi/po/hu/hellolib.po +23 -0
- data/samples/cgi/po/hu/main.po +82 -0
- data/samples/cgi/po/ua/helloerb1.po +62 -0
- data/samples/cgi/po/ua/helloerb2.po +54 -0
- data/samples/cgi/po/ua/hellolib.po +26 -0
- data/samples/cgi/po/ua/main.po +84 -0
- data/samples/locale/hu/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/hu/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/hu/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/hu/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/hu/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/hu/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/hu/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/ua/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/ua/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/ua/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/ua/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/ua/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/ua/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/ua/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/po/hu/hello.po +22 -0
- data/samples/po/hu/hello2.po +30 -0
- data/samples/po/hu/hello_noop.po +26 -0
- data/samples/po/hu/hello_plural.po +25 -0
- data/samples/po/hu/helloglade2.po +31 -0
- data/samples/po/hu/hellogtk.po +22 -0
- data/samples/po/hu/hellotk.po +23 -0
- data/samples/po/ua/hello.po +22 -0
- data/samples/po/ua/hello2.po +30 -0
- data/samples/po/ua/hello_noop.po +26 -0
- data/samples/po/ua/hello_plural.po +29 -0
- data/samples/po/ua/helloglade2.po +34 -0
- data/samples/po/ua/hellogtk.po +22 -0
- data/samples/po/ua/hellotk.po +26 -0
- data/samples/rails/README +15 -31
- data/samples/rails/Rakefile +1 -1
- data/samples/rails/app/controllers/application.rb +11 -4
- data/samples/rails/app/controllers/articles_controller.rb +96 -0
- data/samples/rails/app/helpers/application_helper.rb +1 -1
- data/samples/rails/app/helpers/{blog_helper.rb → articles_helper.rb} +6 -7
- data/samples/rails/app/views/articles/edit.html.erb +18 -0
- data/samples/rails/app/views/articles/index.html.erb +17 -0
- data/samples/rails/app/views/articles/new.html.erb +16 -0
- data/samples/rails/app/views/articles/show.html.erb +6 -0
- data/samples/rails/app/views/layouts/articles.html.erb +26 -0
- data/samples/rails/config/boot.rb +104 -13
- data/samples/rails/config/database.yml +24 -21
- data/samples/rails/config/environment.rb +35 -30
- data/samples/rails/config/environments/development.rb +5 -6
- data/samples/rails/config/environments/production.rb +2 -3
- data/samples/rails/config/environments/test.rb +5 -2
- data/samples/rails/config/initializers/inflections.rb +10 -0
- data/samples/rails/config/initializers/mime_types.rb +5 -0
- data/samples/rails/config/routes.rb +30 -11
- data/samples/rails/db/migrate/001_create_articles.rb +14 -0
- data/samples/rails/db/schema.rb +16 -5
- data/samples/rails/lib/tasks/gettext.rake +2 -2
- data/samples/rails/locale/bs/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ca/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/cs/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/de/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/el/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/en/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/eo/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/es/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/fr/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/hr/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/hu/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/it/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/nb/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/nl/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/pt_BR/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ru/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ua/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/vi/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/zh/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/zh_TW/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/po/blog.pot +24 -24
- data/samples/rails/po/bs/blog.po +29 -29
- data/samples/rails/po/ca/blog.po +27 -27
- data/samples/rails/po/cs/blog.po +27 -27
- data/samples/rails/po/de/blog.po +27 -27
- data/samples/rails/po/el/blog.po +27 -27
- data/samples/rails/po/en/blog.po +24 -24
- data/samples/rails/po/eo/blog.po +27 -27
- data/samples/rails/po/es/blog.po +27 -27
- data/samples/rails/po/fr/blog.po +27 -27
- data/samples/rails/po/hr/blog.po +29 -29
- data/samples/rails/po/hu/blog.po +105 -0
- data/samples/rails/po/it/blog.po +27 -27
- data/samples/rails/po/ja/blog.po +27 -27
- data/samples/rails/po/ko/blog.po +27 -27
- data/samples/rails/po/nb/blog.po +26 -27
- data/samples/rails/po/nl/blog.po +27 -27
- data/samples/rails/po/pt_BR/blog.po +27 -27
- data/samples/rails/po/ru/blog.po +27 -27
- data/samples/rails/po/ua/blog.po +108 -0
- data/samples/rails/po/vi/blog.po +26 -31
- data/samples/rails/po/zh/blog.po +27 -27
- data/samples/rails/po/zh_TW/blog.po +27 -27
- data/samples/rails/public/404.html +27 -5
- data/samples/rails/public/422.html +30 -0
- data/samples/rails/public/500.html +27 -5
- data/samples/rails/public/index.html +6 -6
- data/samples/rails/public/javascripts/application.js +2 -0
- data/samples/rails/public/javascripts/controls.js +532 -319
- data/samples/rails/public/javascripts/dragdrop.js +521 -133
- data/samples/rails/public/javascripts/effects.js +708 -442
- data/samples/rails/public/javascripts/prototype.js +3393 -953
- data/samples/rails/public/stylesheets/blog.css +4 -0
- data/samples/rails/public/stylesheets/scaffold.css +5 -5
- data/samples/rails/test/functional/articles_controller_test.rb +51 -0
- data/samples/rails/test/test_helper.rb +31 -19
- data/samples/rails/test/unit/article_test.rb +2 -9
- data/samples/rails/vendor/plugins/gettext/init.rb +5 -3
- data/samples/rails/vendor/plugins/gettext/lib/gettext_plugin.rb +9 -10
- data/samples/rails/vendor/plugins/gettext/locale/eo/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/hu/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/locale/ua/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/vendor/plugins/gettext/po/eo/gettext_plugin.po +28 -0
- data/samples/rails/vendor/plugins/gettext/po/hu/gettext_plugin.po +27 -0
- data/samples/rails/vendor/plugins/gettext/po/ua/gettext_plugin.po +30 -0
- data/test/Rakefile +2 -1
- data/test/benchmark.rb +28 -0
- data/test/fixtures/topic.rb +15 -0
- data/test/rails/Rakefile +2 -1
- data/test/rails/app/controllers/articles_controller.rb +1 -1
- data/test/rails/app/controllers/users_controller.rb +10 -0
- data/test/rails/app/models/user.rb +2 -1
- data/test/rails/app/views/articles/{_form.rhtml → _form.html.erb} +0 -0
- data/test/rails/app/views/articles/active_form_error.html.erb +1 -0
- data/test/rails/app/views/articles/change_title_error_messages_for.html.erb +21 -0
- data/test/rails/app/views/articles/{edit.rhtml → edit.html.erb} +0 -0
- data/test/rails/app/views/articles/{list.rhtml → list.html.erb} +0 -3
- data/test/rails/app/views/articles/{list_fr.rhtml → list_fr.html.erb} +0 -0
- data/test/rails/app/views/articles/{multi_error_messages_for.rhtml → multi_error_messages_for.html.erb} +0 -0
- data/test/rails/app/views/articles/{new.rhtml → new.html.erb} +0 -0
- data/test/rails/app/views/articles/{show.rhtml → show.html.erb} +0 -0
- data/test/rails/app/views/layouts/{application.rhtml → application.html.erb} +0 -0
- data/test/rails/app/views/layouts/{mailer.rhtml → mailer.html.erb} +0 -0
- data/test/rails/app/views/layouts/users.html.erb +13 -0
- data/test/rails/app/views/users/custom_error_message.html.erb +13 -0
- data/test/rails/app/views/users/custom_error_message_fr.html.erb +13 -0
- data/test/rails/config/environment.rb +6 -1
- data/test/rails/config/environments/development.rb +0 -3
- data/test/rails/db/schema.rb +17 -10
- data/test/rails/locale/ja/LC_MESSAGES/rails_test.mo +0 -0
- data/test/rails/log/development.log +136 -29
- data/test/rails/log/test.log +2002 -128
- data/test/rails/po/ja/rails_test.po +68 -61
- data/test/rails/po/rails_test.pot +57 -55
- data/test/rails/test/fixtures/users.yml +5 -0
- data/test/rails/test/functional/articles_controller_test.rb +6 -1
- data/test/rails/test/functional/users_controller_test.rb +65 -0
- data/test/rails/test/result/en/custom_error_message.html +83 -0
- data/test/rails/test/result/en/custom_error_message_with_plural.html +83 -0
- data/test/rails/test/result/en/list.html +0 -3
- data/test/rails/test/result/en/multi_error_messages_for.html +1 -1
- data/test/rails/test/result/fr/custom_error_message.html +83 -0
- data/test/rails/test/result/fr/custom_error_message_with_plural.html +83 -0
- data/test/rails/test/result/ja/custom_error_message.html +83 -0
- data/test/rails/test/result/ja/custom_error_message_with_plural.html +83 -0
- data/test/rails/test/result/ja/list.html +0 -3
- data/test/rails/test/result/ja/multi_error_messages_for.html +1 -1
- data/test/test.sh +5 -7
- data/test/{gettext_test_active_record.rb → test_active_record.rb} +20 -10
- data/test/{gettext_test_cgi.rb → test_cgi.rb} +0 -0
- data/test/{gettext_test.rb → test_gettext.rb} +91 -9
- data/test/test_java.sh +12 -0
- data/test/{gettext_test_locale.rb → test_locale.rb} +3 -8
- data/test/{gettext_test_multi_textdomain.rb → test_multi_textdomain.rb} +2 -2
- data/test/{gettext_test_parser.rb → test_parser.rb} +77 -77
- data/test/{gettext_test_rails.rb → test_rails.rb} +0 -0
- data/test/{gettext_test_rails_caching.rb → test_rails_caching.rb} +16 -2
- data/test/{gettext_test_string.rb → test_string.rb} +1 -0
- data/test/{test_rubyparser_N.rb → testlib/N_.rb} +0 -0
- data/test/testlib/erb.rhtml +15 -0
- data/test/testlib/erb.rxml +16 -0
- data/test/{test_rubyparser.rb → testlib/gettext.rb} +0 -0
- data/test/testlib/gladeparser.glade +183 -0
- data/test/{test_rubyparser_n_.rb → testlib/ngettext.rb} +0 -0
- data/test/{test_nsgettext.rb → testlib/nsgettext.rb} +0 -0
- data/test/{test_sgettext.rb → testlib/sgettext.rb} +0 -0
- data/test/{testlib1.rb → testlib/testlib1.rb} +0 -0
- data/test/{testlib2.rb → testlib/testlib2.rb} +1 -1
- data/test/{testlib3.rb → testlib/testlib3.rb} +0 -0
- data/test/{testlib4.rb → testlib/testlib4.rb} +1 -1
- data/test/{testlib5.rb → testlib/testlib5.rb} +0 -0
- data/test/{testlib6.rb → testlib/testlib6.rb} +0 -0
- metadata +1374 -1171
- data/ext/gettext/extconf.rb +0 -20
- data/ext/gettext/locale_system.c +0 -83
- data/lib/gettext/locale_posix.rb +0 -82
- data/lib/gettext/locale_win32.rb +0 -82
- data/samples/cgi/ruby.bat +0 -4
- data/samples/rails/app/controllers/blog_controller.rb +0 -58
- data/samples/rails/app/views/blog/_form.rhtml +0 -25
- data/samples/rails/app/views/blog/edit.rhtml +0 -22
- data/samples/rails/app/views/blog/list.rhtml +0 -29
- data/samples/rails/app/views/blog/new.rhtml +0 -21
- data/samples/rails/app/views/blog/show.rhtml +0 -18
- data/samples/rails/app/views/layouts/blog.rhtml +0 -36
- data/samples/rails/test/functional/blog_controller_test.rb +0 -98
- data/test/gettext_runner.rb +0 -22
|
@@ -0,0 +1,839 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Module: Locale</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Module</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Locale</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/lib/locale/base_rb.html">
|
|
59
|
+
lib/locale/base.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
<a href="../files/lib/locale/object_rb.html">
|
|
63
|
+
lib/locale/object.rb
|
|
64
|
+
</a>
|
|
65
|
+
<br />
|
|
66
|
+
<a href="../files/lib/locale/jruby_rb.html">
|
|
67
|
+
lib/locale/jruby.rb
|
|
68
|
+
</a>
|
|
69
|
+
<br />
|
|
70
|
+
<a href="../files/lib/locale/posix_rb.html">
|
|
71
|
+
lib/locale/posix.rb
|
|
72
|
+
</a>
|
|
73
|
+
<br />
|
|
74
|
+
<a href="../files/lib/locale/win32_table_rb.html">
|
|
75
|
+
lib/locale/win32_table.rb
|
|
76
|
+
</a>
|
|
77
|
+
<br />
|
|
78
|
+
<a href="../files/lib/locale/win32_rb.html">
|
|
79
|
+
lib/locale/win32.rb
|
|
80
|
+
</a>
|
|
81
|
+
<br />
|
|
82
|
+
<a href="../files/lib/locale/cgi_rb.html">
|
|
83
|
+
lib/locale/cgi.rb
|
|
84
|
+
</a>
|
|
85
|
+
<br />
|
|
86
|
+
<a href="../files/lib/locale_rb.html">
|
|
87
|
+
lib/locale.rb
|
|
88
|
+
</a>
|
|
89
|
+
<br />
|
|
90
|
+
</td>
|
|
91
|
+
</tr>
|
|
92
|
+
|
|
93
|
+
</table>
|
|
94
|
+
</div>
|
|
95
|
+
<!-- banner header -->
|
|
96
|
+
|
|
97
|
+
<div id="bodyContent">
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
<div id="contextContent">
|
|
102
|
+
|
|
103
|
+
<div id="description">
|
|
104
|
+
<p>
|
|
105
|
+
<a href="Locale.html">Locale</a> module manages the locale informations of
|
|
106
|
+
the application.
|
|
107
|
+
</p>
|
|
108
|
+
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div id="method-list">
|
|
115
|
+
<h3 class="section-bar">Methods</h3>
|
|
116
|
+
|
|
117
|
+
<div class="name-list">
|
|
118
|
+
<a href="#M000081">cgi</a>
|
|
119
|
+
<a href="#M000080">cgi=</a>
|
|
120
|
+
<a href="#M000092">charset</a>
|
|
121
|
+
<a href="#M000094">clear</a>
|
|
122
|
+
<a href="#M000091">codeset</a>
|
|
123
|
+
<a href="#M000086">current</a>
|
|
124
|
+
<a href="#M000088">current=</a>
|
|
125
|
+
<a href="#M000093">current_charset</a>
|
|
126
|
+
<a href="#M000085">default</a>
|
|
127
|
+
<a href="#M000083">default=</a>
|
|
128
|
+
<a href="#M000090">get</a>
|
|
129
|
+
<a href="#M000089">set</a>
|
|
130
|
+
<a href="#M000079">set_cgi</a>
|
|
131
|
+
<a href="#M000087">set_current</a>
|
|
132
|
+
<a href="#M000082">set_default</a>
|
|
133
|
+
<a href="#M000084">system</a>
|
|
134
|
+
<a href="#M000095">system_module</a>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
<!-- if includes -->
|
|
142
|
+
|
|
143
|
+
<div id="section">
|
|
144
|
+
|
|
145
|
+
<div id="class-list">
|
|
146
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
|
147
|
+
|
|
148
|
+
Module <a href="Locale/SystemBase.html" class="link">Locale::SystemBase</a><br />
|
|
149
|
+
Module <a href="Locale/SystemCGI.html" class="link">Locale::SystemCGI</a><br />
|
|
150
|
+
Module <a href="Locale/SystemJRuby.html" class="link">Locale::SystemJRuby</a><br />
|
|
151
|
+
Module <a href="Locale/SystemPosix.html" class="link">Locale::SystemPosix</a><br />
|
|
152
|
+
Module <a href="Locale/SystemWin32.html" class="link">Locale::SystemWin32</a><br />
|
|
153
|
+
Class <a href="Locale/Object.html" class="link">Locale::Object</a><br />
|
|
154
|
+
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
<!-- if method_list -->
|
|
164
|
+
<div id="methods">
|
|
165
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
166
|
+
|
|
167
|
+
<div id="method-M000081" class="method-detail">
|
|
168
|
+
<a name="M000081"></a>
|
|
169
|
+
|
|
170
|
+
<div class="method-heading">
|
|
171
|
+
<a href="#M000081" class="method-signature">
|
|
172
|
+
<span class="method-name">cgi</span><span class="method-args">()</span>
|
|
173
|
+
</a>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<div class="method-description">
|
|
177
|
+
<p>
|
|
178
|
+
Gets the CGI object. If it is nil, returns new CGI object.
|
|
179
|
+
</p>
|
|
180
|
+
<ul>
|
|
181
|
+
<li>Returns: the CGI object
|
|
182
|
+
|
|
183
|
+
</li>
|
|
184
|
+
</ul>
|
|
185
|
+
<p><a class="source-toggle" href="#"
|
|
186
|
+
onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
|
|
187
|
+
<div class="method-source-code" id="M000081-source">
|
|
188
|
+
<pre>
|
|
189
|
+
<span class="ruby-comment cmt"># File lib/locale/cgi.rb, line 100</span>
|
|
190
|
+
100: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cgi</span>
|
|
191
|
+
101: <span class="ruby-ivar">@@locale_system_module</span>.<span class="ruby-identifier">cgi</span>
|
|
192
|
+
102: <span class="ruby-keyword kw">end</span>
|
|
193
|
+
</pre>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<div id="method-M000080" class="method-detail">
|
|
199
|
+
<a name="M000080"></a>
|
|
200
|
+
|
|
201
|
+
<div class="method-heading">
|
|
202
|
+
<a href="#M000080" class="method-signature">
|
|
203
|
+
<span class="method-name">cgi=</span><span class="method-args">(cgi_)</span>
|
|
204
|
+
</a>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<div class="method-description">
|
|
208
|
+
<p>
|
|
209
|
+
Sets a CGI object.
|
|
210
|
+
</p>
|
|
211
|
+
<ul>
|
|
212
|
+
<li>cgi_: CGI object
|
|
213
|
+
|
|
214
|
+
</li>
|
|
215
|
+
<li>Returns: cgi_
|
|
216
|
+
|
|
217
|
+
</li>
|
|
218
|
+
</ul>
|
|
219
|
+
<p><a class="source-toggle" href="#"
|
|
220
|
+
onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
|
|
221
|
+
<div class="method-source-code" id="M000080-source">
|
|
222
|
+
<pre>
|
|
223
|
+
<span class="ruby-comment cmt"># File lib/locale/cgi.rb, line 93</span>
|
|
224
|
+
93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cgi=</span>(<span class="ruby-identifier">cgi_</span>)
|
|
225
|
+
94: <span class="ruby-identifier">set_cgi</span>(<span class="ruby-identifier">cgi_</span>)
|
|
226
|
+
95: <span class="ruby-identifier">cgi_</span>
|
|
227
|
+
96: <span class="ruby-keyword kw">end</span>
|
|
228
|
+
</pre>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
<div id="method-M000092" class="method-detail">
|
|
234
|
+
<a name="M000092"></a>
|
|
235
|
+
|
|
236
|
+
<div class="method-heading">
|
|
237
|
+
<a href="#M000092" class="method-signature">
|
|
238
|
+
<span class="method-name">charset</span><span class="method-args">()</span>
|
|
239
|
+
</a>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<div class="method-description">
|
|
243
|
+
<p>
|
|
244
|
+
Gets the <a href="Locale.html#M000092">charset</a> of the <a
|
|
245
|
+
href="Locale.html#M000086">current</a> locale.
|
|
246
|
+
</p>
|
|
247
|
+
<ul>
|
|
248
|
+
<li>Returns: the <a href="Locale.html#M000092">charset</a> of the <a
|
|
249
|
+
href="Locale.html#M000086">current</a> locale (<a
|
|
250
|
+
href="String.html">String</a>)
|
|
251
|
+
|
|
252
|
+
</li>
|
|
253
|
+
</ul>
|
|
254
|
+
<p><a class="source-toggle" href="#"
|
|
255
|
+
onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
|
|
256
|
+
<div class="method-source-code" id="M000092-source">
|
|
257
|
+
<pre>
|
|
258
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 161</span>
|
|
259
|
+
161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">charset</span>
|
|
260
|
+
162: <span class="ruby-identifier">codeset</span>
|
|
261
|
+
163: <span class="ruby-keyword kw">end</span>
|
|
262
|
+
</pre>
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
<div id="method-M000094" class="method-detail">
|
|
268
|
+
<a name="M000094"></a>
|
|
269
|
+
|
|
270
|
+
<div class="method-heading">
|
|
271
|
+
<a href="#M000094" class="method-signature">
|
|
272
|
+
<span class="method-name">clear</span><span class="method-args">()</span>
|
|
273
|
+
</a>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<div class="method-description">
|
|
277
|
+
<p>
|
|
278
|
+
Clear default/current locale.
|
|
279
|
+
</p>
|
|
280
|
+
<ul>
|
|
281
|
+
<li>Returns: self
|
|
282
|
+
|
|
283
|
+
</li>
|
|
284
|
+
</ul>
|
|
285
|
+
<p><a class="source-toggle" href="#"
|
|
286
|
+
onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
|
|
287
|
+
<div class="method-source-code" id="M000094-source">
|
|
288
|
+
<pre>
|
|
289
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 172</span>
|
|
290
|
+
172: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear</span>
|
|
291
|
+
173: <span class="ruby-identifier">set</span>(<span class="ruby-keyword kw">nil</span>)
|
|
292
|
+
174: <span class="ruby-identifier">set_current</span>(<span class="ruby-keyword kw">nil</span>)
|
|
293
|
+
175: <span class="ruby-keyword kw">self</span>
|
|
294
|
+
176: <span class="ruby-keyword kw">end</span>
|
|
295
|
+
</pre>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
<div id="method-M000091" class="method-detail">
|
|
301
|
+
<a name="M000091"></a>
|
|
302
|
+
|
|
303
|
+
<div class="method-heading">
|
|
304
|
+
<a href="#M000091" class="method-signature">
|
|
305
|
+
<span class="method-name">codeset</span><span class="method-args">()</span>
|
|
306
|
+
</a>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<div class="method-description">
|
|
310
|
+
<p>
|
|
311
|
+
Same as <a href="Locale.html#M000092">charset</a>. Gets the <a
|
|
312
|
+
href="Locale.html#M000092">charset</a> of the <a
|
|
313
|
+
href="Locale.html#M000086">current</a> locale.
|
|
314
|
+
</p>
|
|
315
|
+
<ul>
|
|
316
|
+
<li>Returns: the <a href="Locale.html#M000092">charset</a> of the <a
|
|
317
|
+
href="Locale.html#M000086">current</a> locale (<a
|
|
318
|
+
href="String.html">String</a>)
|
|
319
|
+
|
|
320
|
+
</li>
|
|
321
|
+
</ul>
|
|
322
|
+
<p><a class="source-toggle" href="#"
|
|
323
|
+
onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
|
|
324
|
+
<div class="method-source-code" id="M000091-source">
|
|
325
|
+
<pre>
|
|
326
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 155</span>
|
|
327
|
+
155: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">codeset</span>
|
|
328
|
+
156: <span class="ruby-identifier">current</span>.<span class="ruby-identifier">charset</span>
|
|
329
|
+
157: <span class="ruby-keyword kw">end</span>
|
|
330
|
+
</pre>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<div id="method-M000086" class="method-detail">
|
|
336
|
+
<a name="M000086"></a>
|
|
337
|
+
|
|
338
|
+
<div class="method-heading">
|
|
339
|
+
<a href="#M000086" class="method-signature">
|
|
340
|
+
<span class="method-name">current</span><span class="method-args">()</span>
|
|
341
|
+
</a>
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
<div class="method-description">
|
|
345
|
+
<p>
|
|
346
|
+
Gets the <a href="Locale.html#M000086">current</a> locale (<a
|
|
347
|
+
href="Locale/Object.html">Locale::Object</a>).
|
|
348
|
+
</p>
|
|
349
|
+
<p>
|
|
350
|
+
If the <a href="Locale.html#M000086">current</a> locale is not <a
|
|
351
|
+
href="Locale.html#M000089">set</a>, this returns <a
|
|
352
|
+
href="Locale.html#M000085">default</a> locale.
|
|
353
|
+
</p>
|
|
354
|
+
<ul>
|
|
355
|
+
<li>Returns: the <a href="Locale.html#M000086">current</a> locale (<a
|
|
356
|
+
href="Locale/Object.html">Locale::Object</a>).
|
|
357
|
+
|
|
358
|
+
</li>
|
|
359
|
+
</ul>
|
|
360
|
+
<p><a class="source-toggle" href="#"
|
|
361
|
+
onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
|
|
362
|
+
<div class="method-source-code" id="M000086-source">
|
|
363
|
+
<pre>
|
|
364
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 72</span>
|
|
365
|
+
72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current</span>
|
|
366
|
+
73: <span class="ruby-ivar">@@current</span> = <span class="ruby-identifier">default</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@current</span>
|
|
367
|
+
74: <span class="ruby-ivar">@@current</span>
|
|
368
|
+
75: <span class="ruby-keyword kw">end</span>
|
|
369
|
+
</pre>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
<div id="method-M000088" class="method-detail">
|
|
375
|
+
<a name="M000088"></a>
|
|
376
|
+
|
|
377
|
+
<div class="method-heading">
|
|
378
|
+
<a href="#M000088" class="method-signature">
|
|
379
|
+
<span class="method-name">current=</span><span class="method-args">(lang)</span>
|
|
380
|
+
</a>
|
|
381
|
+
</div>
|
|
382
|
+
|
|
383
|
+
<div class="method-description">
|
|
384
|
+
<p>
|
|
385
|
+
Sets a <a href="Locale.html#M000086">current</a> locale. This is a single
|
|
386
|
+
argument version of <a href="Locale.html#M000087">Locale.set_current</a>.
|
|
387
|
+
</p>
|
|
388
|
+
<ul>
|
|
389
|
+
<li>lang: the <a href="Locale/Object.html">Locale::Object</a>
|
|
390
|
+
|
|
391
|
+
</li>
|
|
392
|
+
<li>Returns: the <a href="Locale.html#M000086">current</a> locale (<a
|
|
393
|
+
href="Locale/Object.html">Locale::Object</a>).
|
|
394
|
+
|
|
395
|
+
<pre>
|
|
396
|
+
Locale.current = "ja_JP.eucJP"
|
|
397
|
+
Locale.current = Locale::Object.new("ja", "JP", "eucJP")
|
|
398
|
+
</pre>
|
|
399
|
+
</li>
|
|
400
|
+
</ul>
|
|
401
|
+
<p><a class="source-toggle" href="#"
|
|
402
|
+
onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
|
|
403
|
+
<div class="method-source-code" id="M000088-source">
|
|
404
|
+
<pre>
|
|
405
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 111</span>
|
|
406
|
+
111: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current=</span>(<span class="ruby-identifier">lang</span>)
|
|
407
|
+
112: <span class="ruby-identifier">set_current</span>(<span class="ruby-identifier">lang</span>)
|
|
408
|
+
113: <span class="ruby-ivar">@@current</span>
|
|
409
|
+
114: <span class="ruby-keyword kw">end</span>
|
|
410
|
+
</pre>
|
|
411
|
+
</div>
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
|
|
415
|
+
<div id="method-M000093" class="method-detail">
|
|
416
|
+
<a name="M000093"></a>
|
|
417
|
+
|
|
418
|
+
<div class="method-heading">
|
|
419
|
+
<a href="#M000093" class="method-signature">
|
|
420
|
+
<span class="method-name">current_charset</span><span class="method-args">()</span>
|
|
421
|
+
</a>
|
|
422
|
+
</div>
|
|
423
|
+
|
|
424
|
+
<div class="method-description">
|
|
425
|
+
<p>
|
|
426
|
+
Same as <a href="Locale.html#M000091">codeset</a>. Returns the <a
|
|
427
|
+
href="Locale.html#M000092">charset</a> of the <a
|
|
428
|
+
href="Locale.html#M000086">current</a> locale.
|
|
429
|
+
</p>
|
|
430
|
+
<ul>
|
|
431
|
+
<li>Returns: the <a href="Locale.html#M000092">charset</a> of the <a
|
|
432
|
+
href="Locale.html#M000086">current</a> locale (<a
|
|
433
|
+
href="String.html">String</a>)
|
|
434
|
+
|
|
435
|
+
</li>
|
|
436
|
+
</ul>
|
|
437
|
+
<p><a class="source-toggle" href="#"
|
|
438
|
+
onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
|
|
439
|
+
<div class="method-source-code" id="M000093-source">
|
|
440
|
+
<pre>
|
|
441
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 166</span>
|
|
442
|
+
166: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_charset</span>
|
|
443
|
+
167: <span class="ruby-identifier">codeset</span>
|
|
444
|
+
168: <span class="ruby-keyword kw">end</span>
|
|
445
|
+
</pre>
|
|
446
|
+
</div>
|
|
447
|
+
</div>
|
|
448
|
+
</div>
|
|
449
|
+
|
|
450
|
+
<div id="method-M000085" class="method-detail">
|
|
451
|
+
<a name="M000085"></a>
|
|
452
|
+
|
|
453
|
+
<div class="method-heading">
|
|
454
|
+
<a href="#M000085" class="method-signature">
|
|
455
|
+
<span class="method-name">default</span><span class="method-args">()</span>
|
|
456
|
+
</a>
|
|
457
|
+
</div>
|
|
458
|
+
|
|
459
|
+
<div class="method-description">
|
|
460
|
+
<p>
|
|
461
|
+
Gets the <a href="Locale.html#M000085">default</a> locale.
|
|
462
|
+
</p>
|
|
463
|
+
<p>
|
|
464
|
+
If the <a href="Locale.html#M000085">default</a> locale not <a
|
|
465
|
+
href="Locale.html#M000089">set</a>, this returns <a
|
|
466
|
+
href="Locale.html#M000084">system</a> locale.
|
|
467
|
+
</p>
|
|
468
|
+
<ul>
|
|
469
|
+
<li>Returns: the <a href="Locale.html#M000085">default</a> locale (<a
|
|
470
|
+
href="Locale/Object.html">Locale::Object</a>).
|
|
471
|
+
|
|
472
|
+
</li>
|
|
473
|
+
</ul>
|
|
474
|
+
<p><a class="source-toggle" href="#"
|
|
475
|
+
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
|
|
476
|
+
<div class="method-source-code" id="M000085-source">
|
|
477
|
+
<pre>
|
|
478
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 64</span>
|
|
479
|
+
64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default</span>
|
|
480
|
+
65: <span class="ruby-ivar">@@default</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@@default</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">system</span>
|
|
481
|
+
66: <span class="ruby-keyword kw">end</span>
|
|
482
|
+
</pre>
|
|
483
|
+
</div>
|
|
484
|
+
</div>
|
|
485
|
+
</div>
|
|
486
|
+
|
|
487
|
+
<div id="method-M000083" class="method-detail">
|
|
488
|
+
<a name="M000083"></a>
|
|
489
|
+
|
|
490
|
+
<div class="method-heading">
|
|
491
|
+
<a href="#M000083" class="method-signature">
|
|
492
|
+
<span class="method-name">default=</span><span class="method-args">(locale)</span>
|
|
493
|
+
</a>
|
|
494
|
+
</div>
|
|
495
|
+
|
|
496
|
+
<div class="method-description">
|
|
497
|
+
<p>
|
|
498
|
+
Same as <a href="Locale.html#M000082">Locale.set_default</a>.
|
|
499
|
+
</p>
|
|
500
|
+
<ul>
|
|
501
|
+
<li>locale: the <a href="Locale.html#M000085">default</a> locale (<a
|
|
502
|
+
href="Locale/Object.html">Locale::Object</a>).
|
|
503
|
+
|
|
504
|
+
</li>
|
|
505
|
+
<li>Returns: locale.
|
|
506
|
+
|
|
507
|
+
</li>
|
|
508
|
+
</ul>
|
|
509
|
+
<p><a class="source-toggle" href="#"
|
|
510
|
+
onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
|
|
511
|
+
<div class="method-source-code" id="M000083-source">
|
|
512
|
+
<pre>
|
|
513
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 49</span>
|
|
514
|
+
49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default=</span>(<span class="ruby-identifier">locale</span>)
|
|
515
|
+
50: <span class="ruby-identifier">set_default</span>(<span class="ruby-identifier">locale</span>)
|
|
516
|
+
51: <span class="ruby-ivar">@@default</span>
|
|
517
|
+
52: <span class="ruby-keyword kw">end</span>
|
|
518
|
+
</pre>
|
|
519
|
+
</div>
|
|
520
|
+
</div>
|
|
521
|
+
</div>
|
|
522
|
+
|
|
523
|
+
<div id="method-M000090" class="method-detail">
|
|
524
|
+
<a name="M000090"></a>
|
|
525
|
+
|
|
526
|
+
<div class="method-heading">
|
|
527
|
+
<a href="#M000090" class="method-signature">
|
|
528
|
+
<span class="method-name">current<br />
|
|
529
|
+
get<br />
|
|
530
|
+
</span>
|
|
531
|
+
</a>
|
|
532
|
+
</div>
|
|
533
|
+
|
|
534
|
+
<div class="method-description">
|
|
535
|
+
<ul>
|
|
536
|
+
<li>Returns: the <a href="Locale.html#M000086">current</a> locale (<a
|
|
537
|
+
href="Locale/Object.html">Locale::Object</a>).
|
|
538
|
+
|
|
539
|
+
</li>
|
|
540
|
+
</ul>
|
|
541
|
+
<p>
|
|
542
|
+
<b>Notice</b>: lctype is deprecated. Use this with no parameter instead.
|
|
543
|
+
</p>
|
|
544
|
+
<p><a class="source-toggle" href="#"
|
|
545
|
+
onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
|
|
546
|
+
<div class="method-source-code" id="M000090-source">
|
|
547
|
+
<pre>
|
|
548
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 148</span>
|
|
549
|
+
148: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>
|
|
550
|
+
149: <span class="ruby-ivar">@@current</span> = <span class="ruby-identifier">default</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@current</span>
|
|
551
|
+
150: <span class="ruby-ivar">@@current</span>
|
|
552
|
+
151: <span class="ruby-keyword kw">end</span>
|
|
553
|
+
</pre>
|
|
554
|
+
</div>
|
|
555
|
+
</div>
|
|
556
|
+
</div>
|
|
557
|
+
|
|
558
|
+
<div id="method-M000089" class="method-detail">
|
|
559
|
+
<a name="M000089"></a>
|
|
560
|
+
|
|
561
|
+
<div class="method-heading">
|
|
562
|
+
<a href="#M000089" class="method-signature">
|
|
563
|
+
<span class="method-name">set(lang)<br />
|
|
564
|
+
set(lang, country = nil, charset = nil)<br />
|
|
565
|
+
</span>
|
|
566
|
+
</a>
|
|
567
|
+
</div>
|
|
568
|
+
|
|
569
|
+
<div class="method-description">
|
|
570
|
+
<ul>
|
|
571
|
+
<li>lang: language as <a href="String.html">String</a>, or <a
|
|
572
|
+
href="Locale/Object.html">Locale::Object</a>
|
|
573
|
+
|
|
574
|
+
</li>
|
|
575
|
+
<li>country: country as <a href="String.html">String</a> or nil
|
|
576
|
+
|
|
577
|
+
</li>
|
|
578
|
+
<li><a href="Locale.html#M000092">charset</a>: <a
|
|
579
|
+
href="Locale.html#M000092">charset</a> as <a href="String.html">String</a>
|
|
580
|
+
or nil
|
|
581
|
+
|
|
582
|
+
</li>
|
|
583
|
+
<li>Returns: a <a href="Locale/Object.html">Locale::Object</a>.
|
|
584
|
+
|
|
585
|
+
</li>
|
|
586
|
+
</ul>
|
|
587
|
+
<p>
|
|
588
|
+
Sets a <a href="Locale.html#M000085">default</a> locale. This function is
|
|
589
|
+
an alias of <a href="Locale.html#M000082">Locale.set_default</a> with
|
|
590
|
+
calling <a href="Locale.html#M000087">set_current</a>(nil).
|
|
591
|
+
</p>
|
|
592
|
+
<p>
|
|
593
|
+
<b>Notice</b>: <a href="Locale.html#M000089">Locale.set</a>(lctype, locale)
|
|
594
|
+
is deprecated.
|
|
595
|
+
</p>
|
|
596
|
+
<p><a class="source-toggle" href="#"
|
|
597
|
+
onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
|
|
598
|
+
<div class="method-source-code" id="M000089-source">
|
|
599
|
+
<pre>
|
|
600
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 129</span>
|
|
601
|
+
129: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">lang</span>, <span class="ruby-identifier">country</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">charset</span> = <span class="ruby-keyword kw">nil</span>)
|
|
602
|
+
130: <span class="ruby-identifier">set_current</span>(<span class="ruby-keyword kw">nil</span>)
|
|
603
|
+
131: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lang</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">String</span>
|
|
604
|
+
132: <span class="ruby-identifier">set_default</span>(<span class="ruby-constant">Locale</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">lang</span>, <span class="ruby-identifier">country</span>, <span class="ruby-identifier">charset</span>))
|
|
605
|
+
133: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">lang</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Locale</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>
|
|
606
|
+
134: <span class="ruby-identifier">set_default</span>(<span class="ruby-identifier">lang</span>)
|
|
607
|
+
135: <span class="ruby-keyword kw">else</span>
|
|
608
|
+
136: <span class="ruby-identifier">set_default</span>(<span class="ruby-keyword kw">nil</span>)
|
|
609
|
+
137: <span class="ruby-keyword kw">end</span>
|
|
610
|
+
138: <span class="ruby-ivar">@@default</span>
|
|
611
|
+
139: <span class="ruby-keyword kw">end</span>
|
|
612
|
+
</pre>
|
|
613
|
+
</div>
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
|
|
617
|
+
<div id="method-M000079" class="method-detail">
|
|
618
|
+
<a name="M000079"></a>
|
|
619
|
+
|
|
620
|
+
<div class="method-heading">
|
|
621
|
+
<a href="#M000079" class="method-signature">
|
|
622
|
+
<span class="method-name">set_cgi</span><span class="method-args">(cgi_)</span>
|
|
623
|
+
</a>
|
|
624
|
+
</div>
|
|
625
|
+
|
|
626
|
+
<div class="method-description">
|
|
627
|
+
<p>
|
|
628
|
+
Sets a CGI object.
|
|
629
|
+
</p>
|
|
630
|
+
<ul>
|
|
631
|
+
<li>cgi_: CGI object
|
|
632
|
+
|
|
633
|
+
</li>
|
|
634
|
+
<li>Returns: self
|
|
635
|
+
|
|
636
|
+
</li>
|
|
637
|
+
</ul>
|
|
638
|
+
<p><a class="source-toggle" href="#"
|
|
639
|
+
onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
|
|
640
|
+
<div class="method-source-code" id="M000079-source">
|
|
641
|
+
<pre>
|
|
642
|
+
<span class="ruby-comment cmt"># File lib/locale/cgi.rb, line 85</span>
|
|
643
|
+
85: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_cgi</span>(<span class="ruby-identifier">cgi_</span>)
|
|
644
|
+
86: <span class="ruby-ivar">@@locale_system_module</span>.<span class="ruby-identifier">set_cgi</span>(<span class="ruby-identifier">cgi_</span>)
|
|
645
|
+
87: <span class="ruby-keyword kw">self</span>
|
|
646
|
+
88: <span class="ruby-keyword kw">end</span>
|
|
647
|
+
</pre>
|
|
648
|
+
</div>
|
|
649
|
+
</div>
|
|
650
|
+
</div>
|
|
651
|
+
|
|
652
|
+
<div id="method-M000087" class="method-detail">
|
|
653
|
+
<a name="M000087"></a>
|
|
654
|
+
|
|
655
|
+
<div class="method-heading">
|
|
656
|
+
<a href="#M000087" class="method-signature">
|
|
657
|
+
<span class="method-name">set_current</span><span class="method-args">(lang, country = nil, charset = nil)</span>
|
|
658
|
+
</a>
|
|
659
|
+
</div>
|
|
660
|
+
|
|
661
|
+
<div class="method-description">
|
|
662
|
+
<p>
|
|
663
|
+
Sets a locale as the <a href="Locale.html#M000086">current</a> locale.
|
|
664
|
+
</p>
|
|
665
|
+
<p>
|
|
666
|
+
This returns the <a href="Locale.html#M000086">current</a> <a
|
|
667
|
+
href="Locale/Object.html">Locale::Object</a>.
|
|
668
|
+
</p>
|
|
669
|
+
<ul>
|
|
670
|
+
<li>lang: <a href="Locale/Object.html">Locale::Object</a> or locale name(<a
|
|
671
|
+
href="String.html">String</a>), or language name.
|
|
672
|
+
|
|
673
|
+
</li>
|
|
674
|
+
<li>country: the country code(<a href="String.html">String</a>)
|
|
675
|
+
|
|
676
|
+
</li>
|
|
677
|
+
<li><a href="Locale.html#M000092">charset</a>: the <a
|
|
678
|
+
href="Locale.html#M000092">charset</a>(override the <a
|
|
679
|
+
href="Locale.html#M000092">charset</a> even if the locale name has <a
|
|
680
|
+
href="Locale.html#M000092">charset</a>).
|
|
681
|
+
|
|
682
|
+
</li>
|
|
683
|
+
<li>Returns: self
|
|
684
|
+
|
|
685
|
+
<pre>
|
|
686
|
+
Locale.set_current("ja_JP.eucJP")
|
|
687
|
+
Locale.set_current("ja", "JP")
|
|
688
|
+
Locale.set_current("ja", "JP", "eucJP")
|
|
689
|
+
Locale.set_current("ja", nil, "eucJP")
|
|
690
|
+
Locale.set_current(Locale::Object.new("ja", "JP", "eucJP"))
|
|
691
|
+
</pre>
|
|
692
|
+
</li>
|
|
693
|
+
</ul>
|
|
694
|
+
<p><a class="source-toggle" href="#"
|
|
695
|
+
onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
|
|
696
|
+
<div class="method-source-code" id="M000087-source">
|
|
697
|
+
<pre>
|
|
698
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 90</span>
|
|
699
|
+
90: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_current</span>(<span class="ruby-identifier">lang</span>, <span class="ruby-identifier">country</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">charset</span> = <span class="ruby-keyword kw">nil</span>)
|
|
700
|
+
91: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lang</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
|
701
|
+
92: <span class="ruby-ivar">@@current</span> = <span class="ruby-keyword kw">nil</span>
|
|
702
|
+
93: <span class="ruby-keyword kw">else</span>
|
|
703
|
+
94: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lang</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Locale</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>
|
|
704
|
+
95: <span class="ruby-ivar">@@current</span> = <span class="ruby-identifier">lang</span>
|
|
705
|
+
96: <span class="ruby-keyword kw">else</span>
|
|
706
|
+
97: <span class="ruby-ivar">@@current</span> = <span class="ruby-constant">Locale</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">lang</span>, <span class="ruby-identifier">country</span>, <span class="ruby-identifier">charset</span>)
|
|
707
|
+
98: <span class="ruby-keyword kw">end</span>
|
|
708
|
+
99: <span class="ruby-ivar">@@current</span>.<span class="ruby-identifier">charset</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@@locale_system_module</span>.<span class="ruby-identifier">charset</span>
|
|
709
|
+
100: <span class="ruby-keyword kw">end</span>
|
|
710
|
+
101: <span class="ruby-keyword kw">self</span>
|
|
711
|
+
102: <span class="ruby-keyword kw">end</span>
|
|
712
|
+
</pre>
|
|
713
|
+
</div>
|
|
714
|
+
</div>
|
|
715
|
+
</div>
|
|
716
|
+
|
|
717
|
+
<div id="method-M000082" class="method-detail">
|
|
718
|
+
<a name="M000082"></a>
|
|
719
|
+
|
|
720
|
+
<div class="method-heading">
|
|
721
|
+
<a href="#M000082" class="method-signature">
|
|
722
|
+
<span class="method-name">set_default</span><span class="method-args">(locale)</span>
|
|
723
|
+
</a>
|
|
724
|
+
</div>
|
|
725
|
+
|
|
726
|
+
<div class="method-description">
|
|
727
|
+
<p>
|
|
728
|
+
Sets the <a href="Locale.html#M000085">default</a> locale (<a
|
|
729
|
+
href="Locale/Object.html">Locale::Object</a> or <a
|
|
730
|
+
href="String.html">String</a>(such as ja_JP.eucJP)).
|
|
731
|
+
</p>
|
|
732
|
+
<ul>
|
|
733
|
+
<li>locale: the <a href="Locale.html#M000085">default</a> locale
|
|
734
|
+
|
|
735
|
+
</li>
|
|
736
|
+
<li>Returns: self.
|
|
737
|
+
|
|
738
|
+
</li>
|
|
739
|
+
</ul>
|
|
740
|
+
<p><a class="source-toggle" href="#"
|
|
741
|
+
onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
|
|
742
|
+
<div class="method-source-code" id="M000082-source">
|
|
743
|
+
<pre>
|
|
744
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 32</span>
|
|
745
|
+
32: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_default</span>(<span class="ruby-identifier">locale</span>)
|
|
746
|
+
33: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">locale</span>
|
|
747
|
+
34: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">locale</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Locale</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>
|
|
748
|
+
35: <span class="ruby-ivar">@@default</span> = <span class="ruby-identifier">locale</span>
|
|
749
|
+
36: <span class="ruby-keyword kw">else</span>
|
|
750
|
+
37: <span class="ruby-ivar">@@default</span> = <span class="ruby-constant">Locale</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">locale</span>)
|
|
751
|
+
38: <span class="ruby-keyword kw">end</span>
|
|
752
|
+
39: <span class="ruby-ivar">@@default</span>.<span class="ruby-identifier">charset</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@@locale_system_module</span>.<span class="ruby-identifier">charset</span>
|
|
753
|
+
40: <span class="ruby-keyword kw">else</span>
|
|
754
|
+
41: <span class="ruby-ivar">@@default</span> = <span class="ruby-keyword kw">nil</span>
|
|
755
|
+
42: <span class="ruby-keyword kw">end</span>
|
|
756
|
+
43: <span class="ruby-keyword kw">self</span>
|
|
757
|
+
44: <span class="ruby-keyword kw">end</span>
|
|
758
|
+
</pre>
|
|
759
|
+
</div>
|
|
760
|
+
</div>
|
|
761
|
+
</div>
|
|
762
|
+
|
|
763
|
+
<div id="method-M000084" class="method-detail">
|
|
764
|
+
<a name="M000084"></a>
|
|
765
|
+
|
|
766
|
+
<div class="method-heading">
|
|
767
|
+
<a href="#M000084" class="method-signature">
|
|
768
|
+
<span class="method-name">system</span><span class="method-args">()</span>
|
|
769
|
+
</a>
|
|
770
|
+
</div>
|
|
771
|
+
|
|
772
|
+
<div class="method-description">
|
|
773
|
+
<p>
|
|
774
|
+
Gets the <a href="Locale.html#M000084">system</a> locale.
|
|
775
|
+
</p>
|
|
776
|
+
<ul>
|
|
777
|
+
<li>Returns: the <a href="Locale.html#M000084">system</a> locale (<a
|
|
778
|
+
href="Locale/Object.html">Locale::Object</a>).
|
|
779
|
+
|
|
780
|
+
</li>
|
|
781
|
+
</ul>
|
|
782
|
+
<p><a class="source-toggle" href="#"
|
|
783
|
+
onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
|
|
784
|
+
<div class="method-source-code" id="M000084-source">
|
|
785
|
+
<pre>
|
|
786
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 56</span>
|
|
787
|
+
56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">system</span>
|
|
788
|
+
57: <span class="ruby-ivar">@@locale_system_module</span>.<span class="ruby-identifier">system</span>
|
|
789
|
+
58: <span class="ruby-keyword kw">end</span>
|
|
790
|
+
</pre>
|
|
791
|
+
</div>
|
|
792
|
+
</div>
|
|
793
|
+
</div>
|
|
794
|
+
|
|
795
|
+
<div id="method-M000095" class="method-detail">
|
|
796
|
+
<a name="M000095"></a>
|
|
797
|
+
|
|
798
|
+
<div class="method-heading">
|
|
799
|
+
<a href="#M000095" class="method-signature">
|
|
800
|
+
<span class="method-name">system_module</span><span class="method-args">()</span>
|
|
801
|
+
</a>
|
|
802
|
+
</div>
|
|
803
|
+
|
|
804
|
+
<div class="method-description">
|
|
805
|
+
<p>
|
|
806
|
+
Gets the <a href="Locale.html#M000086">current</a> <a
|
|
807
|
+
href="Locale.html#M000084">system</a> module. This is used for debugging.
|
|
808
|
+
</p>
|
|
809
|
+
<ul>
|
|
810
|
+
<li>Returns: the <a href="Locale.html#M000084">system</a> module.
|
|
811
|
+
|
|
812
|
+
</li>
|
|
813
|
+
</ul>
|
|
814
|
+
<p><a class="source-toggle" href="#"
|
|
815
|
+
onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
|
|
816
|
+
<div class="method-source-code" id="M000095-source">
|
|
817
|
+
<pre>
|
|
818
|
+
<span class="ruby-comment cmt"># File lib/locale.rb, line 180</span>
|
|
819
|
+
180: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">system_module</span>
|
|
820
|
+
181: <span class="ruby-ivar">@@locale_system_module</span>
|
|
821
|
+
182: <span class="ruby-keyword kw">end</span>
|
|
822
|
+
</pre>
|
|
823
|
+
</div>
|
|
824
|
+
</div>
|
|
825
|
+
</div>
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
</div>
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
</div>
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
<div id="validator-badges">
|
|
835
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
836
|
+
</div>
|
|
837
|
+
|
|
838
|
+
</body>
|
|
839
|
+
</html>
|