gettext 1.10.0 → 1.90.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,112 @@
|
|
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::SystemJRuby</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::SystemJRuby</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/locale/jruby_rb.html">
|
59
|
+
lib/locale/jruby.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
<a href="SystemJRuby.html">Locale::SystemJRuby</a> module for JRuby This is
|
78
|
+
a low-level class. Application shouldn‘t use this directly.
|
79
|
+
</p>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if includes -->
|
91
|
+
|
92
|
+
<div id="section">
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if method_list -->
|
102
|
+
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<div id="validator-badges">
|
108
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
</body>
|
112
|
+
</html>
|
@@ -0,0 +1,113 @@
|
|
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::SystemPosix</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::SystemPosix</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/locale/posix_rb.html">
|
59
|
+
lib/locale/posix.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
<a href="SystemPosix.html">Locale::SystemPosix</a> module for Posix OS
|
78
|
+
(Unix) This is a low-level class. Application shouldn‘t use this
|
79
|
+
directly.
|
80
|
+
</p>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<!-- if method_list -->
|
103
|
+
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
<div id="validator-badges">
|
109
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</body>
|
113
|
+
</html>
|
@@ -0,0 +1,182 @@
|
|
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::SystemWin32</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::SystemWin32</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/locale/win32_table_rb.html">
|
59
|
+
lib/locale/win32_table.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../../files/lib/locale/win32_rb.html">
|
63
|
+
lib/locale/win32.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
</table>
|
70
|
+
</div>
|
71
|
+
<!-- banner header -->
|
72
|
+
|
73
|
+
<div id="bodyContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<div id="contextContent">
|
78
|
+
|
79
|
+
<div id="description">
|
80
|
+
<p>
|
81
|
+
<a href="SystemWin32.html">Locale::SystemWin32</a> module for win32. This
|
82
|
+
is a low-level class. Application shouldn‘t use this directly.
|
83
|
+
</p>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
<div id="method-list">
|
91
|
+
<h3 class="section-bar">Methods</h3>
|
92
|
+
|
93
|
+
<div class="name-list">
|
94
|
+
<a href="#M000100">get_charset</a>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if includes -->
|
102
|
+
|
103
|
+
<div id="section">
|
104
|
+
|
105
|
+
|
106
|
+
<div id="constants-list">
|
107
|
+
<h3 class="section-bar">Constants</h3>
|
108
|
+
|
109
|
+
<div class="name-list">
|
110
|
+
<table summary="Constants">
|
111
|
+
<tr class="top-aligned-row context-row">
|
112
|
+
<td class="context-item-name">LocaleTable</td>
|
113
|
+
<td>=</td>
|
114
|
+
<td class="context-item-value">[ [0x0000, "en", "CP1252"], [0x007f, "invariant", "CP1252"], [0x0400, "invalid", "CP1252"], [0x0800, "system", "CP1252"], [0x0436, "af-ZA", "CP1252"], [0x041c, "sq-AL", "CP1252"], [0x0484, "gsw-FR", "CP1252"], [0x045e, "am-ET", "UNICODE"], [0x0401, "ar-SA", "CP1256"], [0x0801, "ar-IQ", "CP1256"], [0x0c01, "ar-EG", "CP1256"], [0x1001, "ar-LY", "CP1256"], [0x1401, "ar-DZ", "CP1256"], [0x1801, "ar-MA", "CP1256"], [0x1c01, "ar-TN", "CP1256"], [0x2001, "ar-OM", "CP1256"], [0x2401, "ar-YE", "CP1256"], [0x2801, "ar-SY", "CP1256"], [0x2c01, "ar-JO", "CP1256"], [0x3001, "ar-LB", "CP1256"], [0x3401, "ar-KW", "CP1256"], [0x3801, "ar-AE", "CP1256"], [0x3c01, "ar-BH", "CP1256"], [0x4001, "ar-QA", "CP1256"], [0x042b, "hy-AM", "UNICODE"], [0x044d, "as-IN", "UNICODE"], [0x042c, "az-AZ-Latn", "CP1254"], [0x082c, "az-AZ-Cyrl", "CP1251"], [0x046d, "ba-RU", "UNICODE"], [0x042d, "eu-ES", "CP1252"], [0x0423, "be-BY", "CP1251"], [0x0445, "bn-IN", "UNICODE"], [0x201a, "bs-BA-Cyrl", "CP1251"], [0x141a, "bs-BA-Latn", "CP1250"], [0x047e, "br-FR", "CP1251"], [0x0402, "bg-BG", "CP1251"], [0x0455, "my-MM", "UNICODE"], [0x0403, "ca-ES", "CP1252"], [0x0004, "zh-CHS", "CP936"], [0x0404, "zh-TW", "CP950"], [0x0804, "zh-CN", "CP936"], [0x0c04, "zh-HK", "CP950"], [0x1004, "zh-SG", "CP936"], [0x1404, "zh-MO", "CP950"], [0x7c04, "zh-CHT", "CP950"], [0x0483, "co-FR", "CP1252"], [0x041a, "hr-HR", "CP1250"], [0x101a, "hr-BA", "CP1250"], [0x0405, "cs-CZ", "CP1250"], [0x0406, "da-DK", "CP1252"], [0x048c, "gbz-AF", "CP1256"], [0x0465, "dv-MV", "UNICODE"], [0x0413, "nl-NL", "CP1252"], [0x0813, "nl-BE", "CP1252"], [0x0409, "en-US", "CP1252"], [0x0809, "en-GB", "CP1252"], [0x0c09, "en-AU", "CP1252"], [0x1009, "en-CA", "CP1252"], [0x1409, "en-NZ", "CP1252"], [0x1809, "en-IE", "CP1252"], [0x1c09, "en-ZA", "CP1252"], [0x2009, "en-JA", "CP1252"], [0x2409, "en-CB", "CP1252"], [0x2809, "en-BZ", "CP1252"], [0x2c09, "en-TT", "CP1252"], [0x3009, "en-ZW", "CP1252"], [0x3409, "en-PH", "CP1252"], [0x4009, "en-IN", "CP1252"], [0x4409, "en-MY", "CP1252"], [0x4809, "en-SG", "CP1252"], [0x0425, "et-EE", "CP1257"], [0x0438, "fo-FO", "CP1252"], [0x464, "fil-PH", "CP1252"], [0x040b, "fi-FI", "CP1252"], [0x040c, "fr-FR", "CP1252"], [0x080c, "fr-BE", "CP1252"], [0x0c0c, "fr-CA", "CP1252"], [0x100c, "fr-CH", "CP1252"], [0x140c, "fr-LU", "CP1252"], [0x180c, "fr-MC", "CP1252"], [0x0462, "fy-NL", "CP1252"], [0x0456, "gl-ES", "CP1252"], [0x0437, "ka-GE", "UNICODE"], [0x0407, "de-DE", "CP1252"], [0x0807, "de-CH", "CP1252"], [0x0c07, "de-AT", "CP1252"], [0x1007, "de-LU", "CP1252"], [0x1407, "de-LI", "CP1252"], [0x0408, "el-GR", "CP1253"], [0x046f, "kl-GL", "CP1252"], [0x0447, "gu-IN", "UNICODE"], [0x0468, "ha-NG-Latn", "CP1252"], [0x040d, "he-IL", "CP1255"], [0x0439, "hi-IN", "UNICODE"], [0x040e, "hu-HU", "CP1250"], [0x040f, "is-IS", "CP1252"], [0x0421, "id-ID", "CP1252"], [0x045d, "iu-CA-Cans", "UNICODE"], [0x085d, "iu-CA-Latn", "CP1252"], [0x083c, "ga-IE", "CP1252"], [0x0434, "xh-ZA", "CP1252"], [0x0435, "zu-ZA", "CP1252"], [0x0410, "it-IT", "CP1252"], [0x0810, "it-CH", "CP1252"], [0x0411, "ja-JP", "CP932"], [0x044b, "kn-IN", "UNICODE"], [0x043f, "kk-KZ", "CP1251"], [0x0453, "kh-KH", "UNICODE"], [0x0486, "qut-GT", "CP1252"], [0x0487, "rw-RW", "CP1252"], [0x0457, "kok-IN", "UNICODE"], [0x0412, "ko-KR", "CP949"], [0x0812, "ko-KR@win95", "CP949"], [0x0440, "ky-KG", "CP1251"], [0x0454, "lo-LA", "UNICODE"], [0x0426, "lv-LV", "CP1257"], [0x0427, "lt-LT", "CP1257"], [0x0827, "lt-LT@win98", "CP1257"], [0x082e, "wee-DE", "CP1252"], [0x046e, "lb-LU", "CP1252"], [0x042f, "mk-MK", "CP1251"], [0x043e, "ms-MY", "CP1252"], [0x083e, "ms-BN", "CP1252"], [0x044c, "ml-IN", "UNICODE"], [0x043a, "mt-MT", "CP1252"], [0x0481, "mi-NZ", "CP1252"], [0x047a, "arn-CL", "CP1252"], [0x044e, "mr-IN", "UNICODE"], [0x047c, "moh-CA", "CP1252"], [0x0450, "mn-MN", "CP1251"], [0x0850, "mn-CN", "UNICODE"], [0x0461, "ne-NP", "UNICODE"], [0x0414, "nb-NO", "CP1252"], [0x0814, "nn-NO", "CP1252"], [0x0482, "oc-FR", "CP1252"], [0x0448, "or-IN", "UNICODE"], [0x0463, "ps-AF", "UNICODE"], [0x0429, "fa-IR", "CP1256"], [0x0415, "pl-PL", "CP1250"], [0x0416, "pt-BR", "CP1252"], [0x0816, "pt-PT", "CP1252"], [0x0446, "pa-IN", "UNICODE"], [0x046b, "quz-BO", "CP1252"], [0x086b, "quz-EC", "CP1252"], [0x0c6b, "quz-PE", "CP1252"], [0x0418, "ro-RO", "CP1250"], [0x0417, "rm-CH", "CP1252"], [0x0419, "ru-RU", "CP1251"], [0x243b, "smn-FI", "CP1252"], [0x103b, "smj-NO", "CP1252"], [0x143b, "smj-SE", "CP1252"], [0x043b, "se-NO", "CP1252"], [0x083b, "se-SE", "CP1252"], [0x0c3b, "se-FI", "CP1252"], [0x203b, "sms-FI", "CP1252"], [0x183b, "sma-NO", "CP1252"], [0x1c3b, "sma-SE", "CP1252"], [0x044f, "sa-IN", "UNICODE"], [0x0c1a, "sr-SP-Cyrl", "CP1251"], [0x1c1a, "sr-BA-Cyrl", "CP1251"], [0x081a, "sr-SP-Latn", "CP1250"], [0x181a, "sr-BA-Latn", "CP1250"], [0x046c, "ns-ZA", "CP1252"], [0x0432, "tn-ZA", "CP1252"], [0x045b, "si-LK", "UNICODE"], [0x041b, "sk-SK", "CP1250"], [0x0424, "sl-SI", "CP1250"], [0x040a, "es-ES-ts", "CP1252"], [0x080a, "es-MX", "CP1252"], [0x0c0a, "es-ES", "CP1252"], [0x100a, "es-GT", "CP1252"], [0x140a, "es-CR", "CP1252"], [0x180a, "es-PA", "CP1252"], [0x1c0a, "es-DO", "CP1252"], [0x200a, "es-VE", "CP1252"], [0x240a, "es-CO", "CP1252"], [0x280a, "es-PE", "CP1252"], [0x2c0a, "es-AR", "CP1252"], [0x300a, "es-EC", "CP1252"], [0x340a, "es-CL", "CP1252"], [0x380a, "es-UY", "CP1252"], [0x3c0a, "es-PY", "CP1252"], [0x400a, "es-BO", "CP1252"], [0x440a, "es-SV", "CP1252"], [0x480a, "es-HN", "CP1252"], [0x4c0a, "es-NI", "CP1252"], [0x500a, "es-PR", "CP1252"], [0x540a, "es-US", "CP1252"], [0x0430, "sutu", "UNICODE"], [0x0441, "sw-KE", "CP1252"], [0x041d, "sv-SE", "CP1252"], [0x081d, "sv-FI", "CP1252"], [0x045a, "syr-SY", "UNICODE"], [0x0428, "tg-TJ-Cyrl", "CP1251"], [0x085f, "ber-DZ", "CP1252"], [0x0449, "ta-IN", "UNICODE"], [0x0444, "tt-RU", "CP1251"], [0x044a, "te-IN", "UNICODE"], [0x041e, "th-TH", "CP874"], [0x0451, "bo-CN", "UNICODE"], [0x0851, "bo-BT", "UNICODE"], [0x041f, "tr-TR", "CP1254"], [0x0442, "tk-TM", "CP1251"], [0x0480, "ug-CN", "CP1256"], [0x0422, "uk-UA", "CP1251"], [0x042e, "wen-DE", "CP1252"], [0x0420, "ur-PK", "CP1256"], [0x0820, "tr-IN", "CP1256"], [0x0443, "uz-UZ-Latn", "CP1254"], [0x0843, "uz-UZ-Cyrl", "CP1251"], [0x042a, "vi-VN", "CP1252"], [0x0452, "cy-GB", "CP1252"], [0x0488, "wo-SN", "CP1252"], [0x0485, "sah-RU", "CP1251"], [0x0478, "ii-CN", "UNICODE"], [0x046a, "yo-NG", "UNICODE"], ]</td>
|
115
|
+
<td width="3em"> </td>
|
116
|
+
<td class="context-item-desc">
|
117
|
+
LangID, locale name, code page
|
118
|
+
|
119
|
+
</td>
|
120
|
+
</tr>
|
121
|
+
</table>
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<!-- if method_list -->
|
131
|
+
<div id="methods">
|
132
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
133
|
+
|
134
|
+
<div id="method-M000100" class="method-detail">
|
135
|
+
<a name="M000100"></a>
|
136
|
+
|
137
|
+
<div class="method-heading">
|
138
|
+
<a href="#M000100" class="method-signature">
|
139
|
+
<span class="method-name">get_charset</span><span class="method-args">(locale)</span>
|
140
|
+
</a>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<div class="method-description">
|
144
|
+
<p>
|
145
|
+
Gets the Win32 charset of the locale.
|
146
|
+
</p>
|
147
|
+
<ul>
|
148
|
+
<li>locale: <a href="Object.html">Locale::Object</a>
|
149
|
+
|
150
|
+
</li>
|
151
|
+
<li>Returns the charset of the locale
|
152
|
+
|
153
|
+
</li>
|
154
|
+
</ul>
|
155
|
+
<p><a class="source-toggle" href="#"
|
156
|
+
onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
|
157
|
+
<div class="method-source-code" id="M000100-source">
|
158
|
+
<pre>
|
159
|
+
<span class="ruby-comment cmt"># File lib/locale/win32.rb, line 30</span>
|
160
|
+
30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_charset</span>(<span class="ruby-identifier">locale</span>)
|
161
|
+
31: <span class="ruby-identifier">loc</span> = <span class="ruby-constant">LocaleTable</span>.<span class="ruby-identifier">find</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">locale</span>.<span class="ruby-identifier">to_win</span>}
|
162
|
+
32: <span class="ruby-identifier">loc</span> = <span class="ruby-constant">LocaleTable</span>.<span class="ruby-identifier">find</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">=~</span> <span class="ruby-node">/^#{locale.language}-/</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">loc</span>
|
163
|
+
33: <span class="ruby-identifier">loc</span> <span class="ruby-value">? </span><span class="ruby-identifier">loc</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">:</span> <span class="ruby-value str">"CP1252"</span>
|
164
|
+
34: <span class="ruby-keyword kw">end</span>
|
165
|
+
</pre>
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
|
171
|
+
</div>
|
172
|
+
|
173
|
+
|
174
|
+
</div>
|
175
|
+
|
176
|
+
|
177
|
+
<div id="validator-badges">
|
178
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
</body>
|
182
|
+
</html>
|
@@ -0,0 +1,678 @@
|
|
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>Class: MOFile</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>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">MOFile</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/gettext/mo_rb.html">
|
59
|
+
lib/gettext/mo.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Hash
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000011">hash_string</a>
|
90
|
+
<a href="#M000007">load</a>
|
91
|
+
<a href="#M000013">load_from_file</a>
|
92
|
+
<a href="#M000008">load_from_stream</a>
|
93
|
+
<a href="#M000005">new</a>
|
94
|
+
<a href="#M000010">next_prime</a>
|
95
|
+
<a href="#M000004">open</a>
|
96
|
+
<a href="#M000009">prime?</a>
|
97
|
+
<a href="#M000014">save_to_file</a>
|
98
|
+
<a href="#M000012">save_to_stream</a>
|
99
|
+
<a href="#M000015">set_comment</a>
|
100
|
+
<a href="#M000006">update!</a>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if includes -->
|
108
|
+
|
109
|
+
<div id="section">
|
110
|
+
|
111
|
+
<div id="class-list">
|
112
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
113
|
+
|
114
|
+
Class <a href="MOFile/InvalidFormat.html" class="link">MOFile::InvalidFormat</a><br />
|
115
|
+
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div id="constants-list">
|
119
|
+
<h3 class="section-bar">Constants</h3>
|
120
|
+
|
121
|
+
<div class="name-list">
|
122
|
+
<table summary="Constants">
|
123
|
+
<tr class="top-aligned-row context-row">
|
124
|
+
<td class="context-item-name">Header</td>
|
125
|
+
<td>=</td>
|
126
|
+
<td class="context-item-value">Struct.new(:magic, :revision, :nstrings, :orig_table_offset, :translated_table_offset, :hash_table_size, :hash_table_offset)</td>
|
127
|
+
</tr>
|
128
|
+
<tr class="top-aligned-row context-row">
|
129
|
+
<td class="context-item-name">MAGIC_BIG_ENDIAN</td>
|
130
|
+
<td>=</td>
|
131
|
+
<td class="context-item-value">"\x95\x04\x12\xde"</td>
|
132
|
+
</tr>
|
133
|
+
<tr class="top-aligned-row context-row">
|
134
|
+
<td class="context-item-name">MAGIC_LITTLE_ENDIAN</td>
|
135
|
+
<td>=</td>
|
136
|
+
<td class="context-item-value">"\xde\x12\x04\x95"</td>
|
137
|
+
</tr>
|
138
|
+
<tr class="top-aligned-row context-row">
|
139
|
+
<td class="context-item-name">HASHWORDBITS</td>
|
140
|
+
<td>=</td>
|
141
|
+
<td class="context-item-value">32</td>
|
142
|
+
<td width="3em"> </td>
|
143
|
+
<td class="context-item-desc">
|
144
|
+
From gettext-0.12.1/gettext-runtime/intl/hash-string.h Defines the so
|
145
|
+
called `hashpjw’ function by P.J. Weinberger [see Aho/Sethi/Ullman,
|
146
|
+
COMPILERS: Principles, Techniques and Tools, 1986, 1987 Bell Telephone
|
147
|
+
Laboratories, Inc.]
|
148
|
+
|
149
|
+
</td>
|
150
|
+
</tr>
|
151
|
+
</table>
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<div id="attribute-list">
|
158
|
+
<h3 class="section-bar">Attributes</h3>
|
159
|
+
|
160
|
+
<div class="name-list">
|
161
|
+
<table>
|
162
|
+
<tr class="top-aligned-row context-row">
|
163
|
+
<td class="context-item-name">charset</td>
|
164
|
+
<td class="context-item-value"> [R] </td>
|
165
|
+
<td class="context-item-desc"></td>
|
166
|
+
</tr>
|
167
|
+
<tr class="top-aligned-row context-row">
|
168
|
+
<td class="context-item-name">filename</td>
|
169
|
+
<td class="context-item-value"> [R] </td>
|
170
|
+
<td class="context-item-desc"></td>
|
171
|
+
</tr>
|
172
|
+
<tr class="top-aligned-row context-row">
|
173
|
+
<td class="context-item-name">last_modified</td>
|
174
|
+
<td class="context-item-value"> [RW] </td>
|
175
|
+
<td class="context-item-desc"></td>
|
176
|
+
</tr>
|
177
|
+
<tr class="top-aligned-row context-row">
|
178
|
+
<td class="context-item-name">little_endian</td>
|
179
|
+
<td class="context-item-value"> [RW] </td>
|
180
|
+
<td class="context-item-desc"></td>
|
181
|
+
</tr>
|
182
|
+
<tr class="top-aligned-row context-row">
|
183
|
+
<td class="context-item-name">nplurals</td>
|
184
|
+
<td class="context-item-value"> [R] </td>
|
185
|
+
<td class="context-item-desc"></td>
|
186
|
+
</tr>
|
187
|
+
<tr class="top-aligned-row context-row">
|
188
|
+
<td class="context-item-name">path</td>
|
189
|
+
<td class="context-item-value"> [RW] </td>
|
190
|
+
<td class="context-item-desc"></td>
|
191
|
+
</tr>
|
192
|
+
<tr class="top-aligned-row context-row">
|
193
|
+
<td class="context-item-name">plural</td>
|
194
|
+
<td class="context-item-value"> [R] </td>
|
195
|
+
<td class="context-item-desc"></td>
|
196
|
+
</tr>
|
197
|
+
</table>
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<!-- if method_list -->
|
204
|
+
<div id="methods">
|
205
|
+
<h3 class="section-bar">Public Class methods</h3>
|
206
|
+
|
207
|
+
<div id="method-M000005" class="method-detail">
|
208
|
+
<a name="M000005"></a>
|
209
|
+
|
210
|
+
<div class="method-heading">
|
211
|
+
<a href="#M000005" class="method-signature">
|
212
|
+
<span class="method-name">new</span><span class="method-args">(output_charset = nil)</span>
|
213
|
+
</a>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div class="method-description">
|
217
|
+
<p><a class="source-toggle" href="#"
|
218
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
219
|
+
<div class="method-source-code" id="M000005-source">
|
220
|
+
<pre>
|
221
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 41</span>
|
222
|
+
41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">output_charset</span> = <span class="ruby-keyword kw">nil</span>)
|
223
|
+
42: <span class="ruby-ivar">@filename</span> = <span class="ruby-keyword kw">nil</span>
|
224
|
+
43: <span class="ruby-ivar">@last_modified</span> = <span class="ruby-keyword kw">nil</span>
|
225
|
+
44: <span class="ruby-ivar">@little_endian</span> = <span class="ruby-keyword kw">true</span>
|
226
|
+
45: <span class="ruby-ivar">@output_charset</span> = <span class="ruby-identifier">output_charset</span>
|
227
|
+
46: <span class="ruby-keyword kw">super</span>()
|
228
|
+
47: <span class="ruby-keyword kw">end</span>
|
229
|
+
</pre>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
<div id="method-M000004" class="method-detail">
|
235
|
+
<a name="M000004"></a>
|
236
|
+
|
237
|
+
<div class="method-heading">
|
238
|
+
<a href="#M000004" class="method-signature">
|
239
|
+
<span class="method-name">open</span><span class="method-args">(arg = nil, output_charset = nil)</span>
|
240
|
+
</a>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div class="method-description">
|
244
|
+
<p><a class="source-toggle" href="#"
|
245
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
246
|
+
<div class="method-source-code" id="M000004-source">
|
247
|
+
<pre>
|
248
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 36</span>
|
249
|
+
36: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">arg</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">output_charset</span> = <span class="ruby-keyword kw">nil</span>)
|
250
|
+
37: <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">output_charset</span>)
|
251
|
+
38: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">arg</span>)
|
252
|
+
39: <span class="ruby-keyword kw">end</span>
|
253
|
+
</pre>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
</div>
|
257
|
+
|
258
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
259
|
+
|
260
|
+
<div id="method-M000011" class="method-detail">
|
261
|
+
<a name="M000011"></a>
|
262
|
+
|
263
|
+
<div class="method-heading">
|
264
|
+
<a href="#M000011" class="method-signature">
|
265
|
+
<span class="method-name">hash_string</span><span class="method-args">(str)</span>
|
266
|
+
</a>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<div class="method-description">
|
270
|
+
<p><a class="source-toggle" href="#"
|
271
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
272
|
+
<div class="method-source-code" id="M000011-source">
|
273
|
+
<pre>
|
274
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 170</span>
|
275
|
+
170: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_string</span>(<span class="ruby-identifier">str</span>)
|
276
|
+
171: <span class="ruby-identifier">hval</span> = <span class="ruby-value">0</span>
|
277
|
+
172: <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
278
|
+
173: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">each_byte</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
|
279
|
+
174: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">b</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'\0'</span>
|
280
|
+
175: <span class="ruby-identifier">hval</span> <span class="ruby-operator"><<=</span> <span class="ruby-value">4</span>
|
281
|
+
176: <span class="ruby-identifier">hval</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_i</span>
|
282
|
+
177: <span class="ruby-identifier">g</span> = <span class="ruby-identifier">hval</span> <span class="ruby-operator">&</span> (<span class="ruby-value">0xf</span> <span class="ruby-operator"><<</span> (<span class="ruby-constant">HASHWORDBITS</span> <span class="ruby-operator">-</span> <span class="ruby-value">4</span>))
|
283
|
+
178: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">g</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>)
|
284
|
+
179: <span class="ruby-identifier">hval</span> <span class="ruby-operator">^=</span> <span class="ruby-identifier">g</span> <span class="ruby-operator">>></span> (<span class="ruby-constant">HASHWORDBITS</span> <span class="ruby-operator">-</span> <span class="ruby-value">8</span>)
|
285
|
+
180: <span class="ruby-identifier">hval</span> <span class="ruby-operator">^=</span> <span class="ruby-identifier">g</span>
|
286
|
+
181: <span class="ruby-keyword kw">end</span>
|
287
|
+
182: <span class="ruby-keyword kw">end</span>
|
288
|
+
183: <span class="ruby-identifier">hval</span>
|
289
|
+
184: <span class="ruby-keyword kw">end</span>
|
290
|
+
</pre>
|
291
|
+
</div>
|
292
|
+
</div>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
<div id="method-M000007" class="method-detail">
|
296
|
+
<a name="M000007"></a>
|
297
|
+
|
298
|
+
<div class="method-heading">
|
299
|
+
<a href="#M000007" class="method-signature">
|
300
|
+
<span class="method-name">load</span><span class="method-args">(arg)</span>
|
301
|
+
</a>
|
302
|
+
</div>
|
303
|
+
|
304
|
+
<div class="method-description">
|
305
|
+
<p><a class="source-toggle" href="#"
|
306
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
307
|
+
<div class="method-source-code" id="M000007-source">
|
308
|
+
<pre>
|
309
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 60</span>
|
310
|
+
60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load</span>(<span class="ruby-identifier">arg</span>)
|
311
|
+
61: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">arg</span>
|
312
|
+
62: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
|
313
|
+
63: <span class="ruby-keyword kw">begin</span>
|
314
|
+
64: <span class="ruby-identifier">st</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>(<span class="ruby-identifier">arg</span>)
|
315
|
+
65: <span class="ruby-ivar">@last_modified</span> = [<span class="ruby-identifier">st</span>.<span class="ruby-identifier">ctime</span>, <span class="ruby-identifier">st</span>.<span class="ruby-identifier">mtime</span>]
|
316
|
+
66: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
|
317
|
+
67: <span class="ruby-keyword kw">end</span>
|
318
|
+
68: <span class="ruby-identifier">load_from_file</span>(<span class="ruby-identifier">arg</span>)
|
319
|
+
69: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">IO</span>
|
320
|
+
70: <span class="ruby-identifier">load_from_stream</span>(<span class="ruby-identifier">arg</span>)
|
321
|
+
71: <span class="ruby-keyword kw">end</span>
|
322
|
+
72: <span class="ruby-ivar">@filename</span> = <span class="ruby-identifier">arg</span>
|
323
|
+
73: <span class="ruby-keyword kw">self</span>
|
324
|
+
74: <span class="ruby-keyword kw">end</span>
|
325
|
+
</pre>
|
326
|
+
</div>
|
327
|
+
</div>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
<div id="method-M000013" class="method-detail">
|
331
|
+
<a name="M000013"></a>
|
332
|
+
|
333
|
+
<div class="method-heading">
|
334
|
+
<a href="#M000013" class="method-signature">
|
335
|
+
<span class="method-name">load_from_file</span><span class="method-args">(filename)</span>
|
336
|
+
</a>
|
337
|
+
</div>
|
338
|
+
|
339
|
+
<div class="method-description">
|
340
|
+
<p><a class="source-toggle" href="#"
|
341
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
342
|
+
<div class="method-source-code" id="M000013-source">
|
343
|
+
<pre>
|
344
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 253</span>
|
345
|
+
253: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_from_file</span>(<span class="ruby-identifier">filename</span>)
|
346
|
+
254: <span class="ruby-ivar">@filename</span> = <span class="ruby-identifier">filename</span>
|
347
|
+
255: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'rb'</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">load_from_stream</span>(<span class="ruby-identifier">f</span>)}
|
348
|
+
256: <span class="ruby-keyword kw">end</span>
|
349
|
+
</pre>
|
350
|
+
</div>
|
351
|
+
</div>
|
352
|
+
</div>
|
353
|
+
|
354
|
+
<div id="method-M000008" class="method-detail">
|
355
|
+
<a name="M000008"></a>
|
356
|
+
|
357
|
+
<div class="method-heading">
|
358
|
+
<a href="#M000008" class="method-signature">
|
359
|
+
<span class="method-name">load_from_stream</span><span class="method-args">(io)</span>
|
360
|
+
</a>
|
361
|
+
</div>
|
362
|
+
|
363
|
+
<div class="method-description">
|
364
|
+
<p><a class="source-toggle" href="#"
|
365
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
366
|
+
<div class="method-source-code" id="M000008-source">
|
367
|
+
<pre>
|
368
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 76</span>
|
369
|
+
76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_from_stream</span>(<span class="ruby-identifier">io</span>)
|
370
|
+
77: <span class="ruby-identifier">magic</span> = <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value">4</span>)
|
371
|
+
78: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">magic</span>
|
372
|
+
79: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">MAGIC_BIG_ENDIAN</span>
|
373
|
+
80: <span class="ruby-ivar">@little_endian</span> = <span class="ruby-keyword kw">false</span>
|
374
|
+
81: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">MAGIC_LITTLE_ENDIAN</span>
|
375
|
+
82: <span class="ruby-ivar">@little_endian</span> = <span class="ruby-keyword kw">true</span>
|
376
|
+
83: <span class="ruby-keyword kw">else</span>
|
377
|
+
84: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidFormat</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">"Unknown signature %s"</span>, <span class="ruby-identifier">magic</span>.<span class="ruby-identifier">dump</span>))
|
378
|
+
85: <span class="ruby-keyword kw">end</span>
|
379
|
+
86:
|
380
|
+
87: <span class="ruby-identifier">header</span> = <span class="ruby-constant">Header</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">magic</span>, <span class="ruby-operator">*</span>(<span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value">4</span> <span class="ruby-operator">*</span> <span class="ruby-value">6</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-ivar">@little_endian</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'V6'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'N6'</span>)))
|
381
|
+
88: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidFormat</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">"file format revision %d isn't supported"</span>, <span class="ruby-identifier">header</span>.<span class="ruby-identifier">revision</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">header</span>.<span class="ruby-identifier">revision</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
382
|
+
89:
|
383
|
+
90: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">header</span>.<span class="ruby-identifier">orig_table_offset</span>
|
384
|
+
91: <span class="ruby-identifier">orig_table_data</span> = <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>((<span class="ruby-value">4</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>) <span class="ruby-operator">*</span> <span class="ruby-identifier">header</span>.<span class="ruby-identifier">nstrings</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-ivar">@little_endian</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'V*'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'N*'</span>)
|
385
|
+
92:
|
386
|
+
93: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">header</span>.<span class="ruby-identifier">translated_table_offset</span>
|
387
|
+
94: <span class="ruby-identifier">trans_table_data</span> = <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>((<span class="ruby-value">4</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>) <span class="ruby-operator">*</span> <span class="ruby-identifier">header</span>.<span class="ruby-identifier">nstrings</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-ivar">@little_endian</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'V*'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'N*'</span>)
|
388
|
+
95:
|
389
|
+
96: <span class="ruby-identifier">original_strings</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">header</span>.<span class="ruby-identifier">nstrings</span>)
|
390
|
+
97: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">header</span>.<span class="ruby-identifier">nstrings</span>
|
391
|
+
98: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">orig_table_data</span>[<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>]
|
392
|
+
99: <span class="ruby-identifier">original_strings</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">orig_table_data</span>[<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">0</span>])
|
393
|
+
100: <span class="ruby-keyword kw">end</span>
|
394
|
+
101:
|
395
|
+
102: <span class="ruby-identifier">clear</span>
|
396
|
+
103: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">header</span>.<span class="ruby-identifier">nstrings</span>
|
397
|
+
104: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">trans_table_data</span>[<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>]
|
398
|
+
105: <span class="ruby-identifier">str</span> = <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">trans_table_data</span>[<span class="ruby-identifier">i</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">0</span>])
|
399
|
+
106:
|
400
|
+
107: <span class="ruby-keyword kw">if</span> (<span class="ruby-operator">!</span> <span class="ruby-identifier">original_strings</span>[<span class="ruby-identifier">i</span>]) <span class="ruby-operator">||</span> <span class="ruby-identifier">original_strings</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">""</span>
|
401
|
+
108: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">str</span>
|
402
|
+
109: <span class="ruby-ivar">@charset</span> = <span class="ruby-keyword kw">nil</span>
|
403
|
+
110: <span class="ruby-ivar">@nplurals</span> = <span class="ruby-keyword kw">nil</span>
|
404
|
+
111: <span class="ruby-ivar">@plural</span> = <span class="ruby-keyword kw">nil</span>
|
405
|
+
112: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">each_line</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
406
|
+
113: <span class="ruby-keyword kw">if</span> <span class="ruby-regexp re">/^Content-Type:/i</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">line</span> <span class="ruby-keyword kw">and</span> <span class="ruby-regexp re">/charset=((?:\w|-)+)/i</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">line</span>
|
407
|
+
114: <span class="ruby-ivar">@charset</span> = <span class="ruby-identifier">$1</span>
|
408
|
+
115: <span class="ruby-keyword kw">elsif</span> <span class="ruby-regexp re">/^Plural-Forms:\s*nplurals\s*\=\s*(\d*);\s*plural\s*\=\s*([^;]*)\n?/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">line</span>
|
409
|
+
116: <span class="ruby-ivar">@nplurals</span> = <span class="ruby-identifier">$1</span>
|
410
|
+
117: <span class="ruby-ivar">@plural</span> = <span class="ruby-identifier">$2</span>
|
411
|
+
118: <span class="ruby-keyword kw">end</span>
|
412
|
+
119: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@charset</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@nplurals</span>
|
413
|
+
120: }
|
414
|
+
121: <span class="ruby-ivar">@nplurals</span> = <span class="ruby-value str">"1"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@nplurals</span>
|
415
|
+
122: <span class="ruby-ivar">@plural</span> = <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@plural</span>
|
416
|
+
123: <span class="ruby-keyword kw">end</span>
|
417
|
+
124: <span class="ruby-keyword kw">else</span>
|
418
|
+
125: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@output_charset</span>
|
419
|
+
126: <span class="ruby-keyword kw">begin</span>
|
420
|
+
127: <span class="ruby-identifier">str</span> = <span class="ruby-constant">Iconv</span>.<span class="ruby-identifier">conv</span>(<span class="ruby-ivar">@output_charset</span>, <span class="ruby-ivar">@charset</span>, <span class="ruby-identifier">str</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@charset</span>
|
421
|
+
128: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Iconv</span><span class="ruby-operator">::</span><span class="ruby-constant">Failure</span>
|
422
|
+
129: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
423
|
+
130: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">print</span> <span class="ruby-value str">"@charset = "</span>, <span class="ruby-ivar">@charset</span>, <span class="ruby-value str">"\n"</span>
|
424
|
+
131: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">print</span> <span class="ruby-value str">"@output_charset = "</span>, <span class="ruby-ivar">@output_charset</span>, <span class="ruby-value str">"\n"</span>
|
425
|
+
132: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">print</span> <span class="ruby-value str">"msgid = "</span>, <span class="ruby-identifier">original_strings</span>[<span class="ruby-identifier">i</span>], <span class="ruby-value str">"\n"</span>
|
426
|
+
133: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">print</span> <span class="ruby-value str">"msgstr = "</span>, <span class="ruby-identifier">str</span>, <span class="ruby-value str">"\n"</span>
|
427
|
+
134: <span class="ruby-keyword kw">end</span>
|
428
|
+
135: <span class="ruby-keyword kw">end</span>
|
429
|
+
136: <span class="ruby-keyword kw">end</span>
|
430
|
+
137: <span class="ruby-keyword kw">end</span>
|
431
|
+
138: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">original_strings</span>[<span class="ruby-identifier">i</span>]] = <span class="ruby-identifier">str</span>
|
432
|
+
139: <span class="ruby-keyword kw">end</span>
|
433
|
+
140: <span class="ruby-keyword kw">self</span>
|
434
|
+
141: <span class="ruby-keyword kw">end</span>
|
435
|
+
</pre>
|
436
|
+
</div>
|
437
|
+
</div>
|
438
|
+
</div>
|
439
|
+
|
440
|
+
<div id="method-M000010" class="method-detail">
|
441
|
+
<a name="M000010"></a>
|
442
|
+
|
443
|
+
<div class="method-heading">
|
444
|
+
<a href="#M000010" class="method-signature">
|
445
|
+
<span class="method-name">next_prime</span><span class="method-args">(seed)</span>
|
446
|
+
</a>
|
447
|
+
</div>
|
448
|
+
|
449
|
+
<div class="method-description">
|
450
|
+
<p>
|
451
|
+
From gettext-0.12.1/gettext-tools/lib/hash.c
|
452
|
+
</p>
|
453
|
+
<p><a class="source-toggle" href="#"
|
454
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
455
|
+
<div class="method-source-code" id="M000010-source">
|
456
|
+
<pre>
|
457
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 157</span>
|
458
|
+
157: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_prime</span>(<span class="ruby-identifier">seed</span>)
|
459
|
+
158: <span class="ruby-identifier">seed</span> <span class="ruby-operator">|=</span> <span class="ruby-value">1</span>
|
460
|
+
159: <span class="ruby-keyword kw">while</span> (<span class="ruby-operator">!</span> <span class="ruby-identifier">prime?</span>(<span class="ruby-identifier">seed</span>))
|
461
|
+
160: <span class="ruby-identifier">seed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">2</span>
|
462
|
+
161: <span class="ruby-keyword kw">end</span>
|
463
|
+
162: <span class="ruby-identifier">seed</span>
|
464
|
+
163: <span class="ruby-keyword kw">end</span>
|
465
|
+
</pre>
|
466
|
+
</div>
|
467
|
+
</div>
|
468
|
+
</div>
|
469
|
+
|
470
|
+
<div id="method-M000009" class="method-detail">
|
471
|
+
<a name="M000009"></a>
|
472
|
+
|
473
|
+
<div class="method-heading">
|
474
|
+
<a href="#M000009" class="method-signature">
|
475
|
+
<span class="method-name">prime?</span><span class="method-args">(candidate)</span>
|
476
|
+
</a>
|
477
|
+
</div>
|
478
|
+
|
479
|
+
<div class="method-description">
|
480
|
+
<p>
|
481
|
+
From gettext-0.12.1/gettext-tools/lib/hash.c
|
482
|
+
</p>
|
483
|
+
<p><a class="source-toggle" href="#"
|
484
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
485
|
+
<div class="method-source-code" id="M000009-source">
|
486
|
+
<pre>
|
487
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 144</span>
|
488
|
+
144: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prime?</span>(<span class="ruby-identifier">candidate</span>)
|
489
|
+
145: <span class="ruby-identifier">divn</span> = <span class="ruby-value">3</span>
|
490
|
+
146: <span class="ruby-identifier">sq</span> = <span class="ruby-identifier">divn</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">divn</span>
|
491
|
+
147:
|
492
|
+
148: <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">sq</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">candidate</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">candidate</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">divn</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>)
|
493
|
+
149: <span class="ruby-identifier">divn</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
494
|
+
150: <span class="ruby-identifier">sq</span> <span class="ruby-operator">+=</span> <span class="ruby-value">4</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">divn</span>
|
495
|
+
151: <span class="ruby-identifier">divn</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
496
|
+
152: <span class="ruby-keyword kw">end</span>
|
497
|
+
153: <span class="ruby-identifier">candidate</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">divn</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
|
498
|
+
154: <span class="ruby-keyword kw">end</span>
|
499
|
+
</pre>
|
500
|
+
</div>
|
501
|
+
</div>
|
502
|
+
</div>
|
503
|
+
|
504
|
+
<div id="method-M000014" class="method-detail">
|
505
|
+
<a name="M000014"></a>
|
506
|
+
|
507
|
+
<div class="method-heading">
|
508
|
+
<a href="#M000014" class="method-signature">
|
509
|
+
<span class="method-name">save_to_file</span><span class="method-args">(filename)</span>
|
510
|
+
</a>
|
511
|
+
</div>
|
512
|
+
|
513
|
+
<div class="method-description">
|
514
|
+
<p><a class="source-toggle" href="#"
|
515
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
516
|
+
<div class="method-source-code" id="M000014-source">
|
517
|
+
<pre>
|
518
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 258</span>
|
519
|
+
258: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save_to_file</span>(<span class="ruby-identifier">filename</span>)
|
520
|
+
259: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'wb'</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">save_to_stream</span>(<span class="ruby-identifier">f</span>)}
|
521
|
+
260: <span class="ruby-keyword kw">end</span>
|
522
|
+
</pre>
|
523
|
+
</div>
|
524
|
+
</div>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div id="method-M000012" class="method-detail">
|
528
|
+
<a name="M000012"></a>
|
529
|
+
|
530
|
+
<div class="method-heading">
|
531
|
+
<a href="#M000012" class="method-signature">
|
532
|
+
<span class="method-name">save_to_stream</span><span class="method-args">(io)</span>
|
533
|
+
</a>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
<div class="method-description">
|
537
|
+
<p><a class="source-toggle" href="#"
|
538
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
539
|
+
<div class="method-source-code" id="M000012-source">
|
540
|
+
<pre>
|
541
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 186</span>
|
542
|
+
186: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save_to_stream</span>(<span class="ruby-identifier">io</span>)
|
543
|
+
187: <span class="ruby-comment cmt">#Save data as little endian format.</span>
|
544
|
+
188: <span class="ruby-identifier">header_size</span> = <span class="ruby-value">4</span> <span class="ruby-operator">*</span> <span class="ruby-value">7</span>
|
545
|
+
189: <span class="ruby-identifier">table_size</span> = <span class="ruby-value">4</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">size</span>
|
546
|
+
190:
|
547
|
+
191: <span class="ruby-identifier">hash_table_size</span> = <span class="ruby-identifier">next_prime</span>((<span class="ruby-identifier">size</span> <span class="ruby-operator">*</span> <span class="ruby-value">4</span>) <span class="ruby-operator">/</span> <span class="ruby-value">3</span>)
|
548
|
+
192: <span class="ruby-identifier">hash_table_size</span> = <span class="ruby-value">3</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash_table_size</span> <span class="ruby-operator"><=</span> <span class="ruby-value">2</span>
|
549
|
+
193: <span class="ruby-identifier">header</span> = <span class="ruby-constant">Header</span>.<span class="ruby-identifier">new</span>(
|
550
|
+
194: <span class="ruby-constant">MAGIC_LITTLE_ENDIAN</span>, <span class="ruby-comment cmt"># magic</span>
|
551
|
+
195: <span class="ruby-value">0</span>, <span class="ruby-comment cmt"># revision</span>
|
552
|
+
196: <span class="ruby-identifier">size</span>, <span class="ruby-comment cmt"># nstrings</span>
|
553
|
+
197: <span class="ruby-identifier">header_size</span>, <span class="ruby-comment cmt"># orig_table_offset</span>
|
554
|
+
198: <span class="ruby-identifier">header_size</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">table_size</span>, <span class="ruby-comment cmt"># translated_table_offset</span>
|
555
|
+
199: <span class="ruby-identifier">hash_table_size</span>, <span class="ruby-comment cmt"># hash_table_size</span>
|
556
|
+
200: <span class="ruby-identifier">header_size</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">table_size</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-comment cmt"># hash_table_offset</span>
|
557
|
+
201: )
|
558
|
+
202: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">header</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'a4V*'</span>))
|
559
|
+
203:
|
560
|
+
204: <span class="ruby-identifier">ary</span> = <span class="ruby-identifier">to_a</span>
|
561
|
+
205: <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">sort!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>[<span class="ruby-value">0</span>] <span class="ruby-operator"><=></span> <span class="ruby-identifier">b</span>[<span class="ruby-value">0</span>]} <span class="ruby-comment cmt"># sort by original string</span>
|
562
|
+
206:
|
563
|
+
207: <span class="ruby-identifier">pos</span> = <span class="ruby-identifier">header</span>.<span class="ruby-identifier">hash_table_size</span> <span class="ruby-operator">*</span> <span class="ruby-value">4</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">header</span>.<span class="ruby-identifier">hash_table_offset</span>
|
564
|
+
208:
|
565
|
+
209: <span class="ruby-identifier">orig_table_data</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>()
|
566
|
+
210: <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
|
567
|
+
211: <span class="ruby-identifier">orig_table_data</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">item</span>.<span class="ruby-identifier">size</span>)
|
568
|
+
212: <span class="ruby-identifier">orig_table_data</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pos</span>)
|
569
|
+
213: <span class="ruby-identifier">pos</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-comment cmt"># +1 is <NUL></span>
|
570
|
+
214: }
|
571
|
+
215: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">orig_table_data</span>.<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'V*'</span>))
|
572
|
+
216:
|
573
|
+
217: <span class="ruby-identifier">trans_table_data</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>()
|
574
|
+
218: <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">_</span>, <span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
|
575
|
+
219: <span class="ruby-identifier">trans_table_data</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">item</span>.<span class="ruby-identifier">size</span>)
|
576
|
+
220: <span class="ruby-identifier">trans_table_data</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pos</span>)
|
577
|
+
221: <span class="ruby-identifier">pos</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-comment cmt"># +1 is <NUL></span>
|
578
|
+
222: }
|
579
|
+
223: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">trans_table_data</span>.<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'V*'</span>))
|
580
|
+
224:
|
581
|
+
225: <span class="ruby-identifier">hash_tab</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">hash_table_size</span>)
|
582
|
+
226: <span class="ruby-identifier">j</span> = <span class="ruby-value">0</span>
|
583
|
+
227: <span class="ruby-identifier">ary</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">size</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
|
584
|
+
228: <span class="ruby-identifier">hash_val</span> = <span class="ruby-identifier">hash_string</span>(<span class="ruby-identifier">key</span>)
|
585
|
+
229: <span class="ruby-identifier">idx</span> = <span class="ruby-identifier">hash_val</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">hash_table_size</span>
|
586
|
+
230: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash_tab</span>[<span class="ruby-identifier">idx</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
587
|
+
231: <span class="ruby-identifier">incr</span> = <span class="ruby-value">1</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">hash_val</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">hash_table_size</span> <span class="ruby-operator">-</span> <span class="ruby-value">2</span>))
|
588
|
+
232: <span class="ruby-keyword kw">begin</span>
|
589
|
+
233: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">idx</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">hash_table_size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">incr</span>)
|
590
|
+
234: <span class="ruby-identifier">idx</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">hash_table_size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">incr</span>
|
591
|
+
235: <span class="ruby-keyword kw">else</span>
|
592
|
+
236: <span class="ruby-identifier">idx</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">incr</span>
|
593
|
+
237: <span class="ruby-keyword kw">end</span>
|
594
|
+
238: <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">until</span> (<span class="ruby-identifier">hash_tab</span>[<span class="ruby-identifier">idx</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>)
|
595
|
+
239: <span class="ruby-keyword kw">end</span>
|
596
|
+
240: <span class="ruby-identifier">hash_tab</span>[<span class="ruby-identifier">idx</span>] = <span class="ruby-identifier">j</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
597
|
+
241: <span class="ruby-identifier">j</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
598
|
+
242: }
|
599
|
+
243: <span class="ruby-identifier">hash_tab</span>.<span class="ruby-identifier">collect!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span> <span class="ruby-value">? </span><span class="ruby-identifier">i</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>}
|
600
|
+
244:
|
601
|
+
245: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">hash_tab</span>.<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'V*'</span>))
|
602
|
+
246:
|
603
|
+
247: <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">item</span>); <span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"\0"</span>) }
|
604
|
+
248: <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">_</span>, <span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">item</span>); <span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"\0"</span>) }
|
605
|
+
249:
|
606
|
+
250: <span class="ruby-keyword kw">self</span>
|
607
|
+
251: <span class="ruby-keyword kw">end</span>
|
608
|
+
</pre>
|
609
|
+
</div>
|
610
|
+
</div>
|
611
|
+
</div>
|
612
|
+
|
613
|
+
<div id="method-M000015" class="method-detail">
|
614
|
+
<a name="M000015"></a>
|
615
|
+
|
616
|
+
<div class="method-heading">
|
617
|
+
<a href="#M000015" class="method-signature">
|
618
|
+
<span class="method-name">set_comment</span><span class="method-args">(msgid_or_sym, comment)</span>
|
619
|
+
</a>
|
620
|
+
</div>
|
621
|
+
|
622
|
+
<div class="method-description">
|
623
|
+
<p><a class="source-toggle" href="#"
|
624
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
625
|
+
<div class="method-source-code" id="M000015-source">
|
626
|
+
<pre>
|
627
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 262</span>
|
628
|
+
262: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_comment</span>(<span class="ruby-identifier">msgid_or_sym</span>, <span class="ruby-identifier">comment</span>)
|
629
|
+
263: <span class="ruby-comment cmt">#Do nothing</span>
|
630
|
+
264: <span class="ruby-keyword kw">end</span>
|
631
|
+
</pre>
|
632
|
+
</div>
|
633
|
+
</div>
|
634
|
+
</div>
|
635
|
+
|
636
|
+
<div id="method-M000006" class="method-detail">
|
637
|
+
<a name="M000006"></a>
|
638
|
+
|
639
|
+
<div class="method-heading">
|
640
|
+
<a href="#M000006" class="method-signature">
|
641
|
+
<span class="method-name">update!</span><span class="method-args">()</span>
|
642
|
+
</a>
|
643
|
+
</div>
|
644
|
+
|
645
|
+
<div class="method-description">
|
646
|
+
<p><a class="source-toggle" href="#"
|
647
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
648
|
+
<div class="method-source-code" id="M000006-source">
|
649
|
+
<pre>
|
650
|
+
<span class="ruby-comment cmt"># File lib/gettext/mo.rb, line 49</span>
|
651
|
+
49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update!</span>
|
652
|
+
50: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-ivar">@filename</span>)
|
653
|
+
51: <span class="ruby-identifier">st</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>(<span class="ruby-ivar">@filename</span>)
|
654
|
+
52: <span class="ruby-identifier">load</span>(<span class="ruby-ivar">@filename</span>) <span class="ruby-keyword kw">unless</span> (<span class="ruby-ivar">@last_modified</span> <span class="ruby-operator">==</span> [<span class="ruby-identifier">st</span>.<span class="ruby-identifier">ctime</span>, <span class="ruby-identifier">st</span>.<span class="ruby-identifier">mtime</span>])
|
655
|
+
53: <span class="ruby-keyword kw">else</span>
|
656
|
+
54: <span class="ruby-identifier">puts</span> <span class="ruby-node">"#{@filename} was lost."</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
657
|
+
55: <span class="ruby-identifier">clear</span>
|
658
|
+
56: <span class="ruby-keyword kw">end</span>
|
659
|
+
57: <span class="ruby-keyword kw">self</span>
|
660
|
+
58: <span class="ruby-keyword kw">end</span>
|
661
|
+
</pre>
|
662
|
+
</div>
|
663
|
+
</div>
|
664
|
+
</div>
|
665
|
+
|
666
|
+
|
667
|
+
</div>
|
668
|
+
|
669
|
+
|
670
|
+
</div>
|
671
|
+
|
672
|
+
|
673
|
+
<div id="validator-badges">
|
674
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
675
|
+
</div>
|
676
|
+
|
677
|
+
</body>
|
678
|
+
</html>
|