gettext 1.91.0 → 1.92.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 +111 -1
- data/NEWS +35 -0
- data/README +26 -24
- data/bin/rgettext +2 -2
- data/bin/rmsgfmt +2 -2
- data/bin/rmsgmerge +2 -2
- data/doc/classes/ActionView/Helpers/FormBuilder.html +11 -11
- data/doc/classes/ActionView/TemplateFinder.html +152 -0
- data/doc/classes/ActiveRecord/Base.html +87 -87
- data/doc/classes/ActiveRecord/ConnectionAdapters/Column.html +6 -6
- data/doc/classes/GetText.html +617 -491
- data/doc/classes/GetText/ActiveRecordParser.html +13 -13
- data/doc/classes/GetText/ErbContainer.html +12 -12
- data/doc/classes/GetText/ErbParser.html +6 -6
- data/doc/classes/GetText/NoboundTextDomainError.html +1 -1
- data/doc/classes/GetText/PoParser.html +11 -11
- data/doc/classes/GetText/Rails.html +20 -20
- data/doc/classes/GetText/RubyParser.html +5 -0
- data/doc/classes/GetText/TextDomain.html +53 -53
- data/doc/classes/GetText/TextDomainManager.html +54 -54
- data/doc/classes/Iconv.html +20 -20
- data/doc/classes/Locale.html +151 -151
- data/doc/classes/Locale/Object.html +92 -92
- data/doc/classes/Locale/SystemBase.html +32 -32
- data/doc/classes/Locale/SystemCGI.html +31 -31
- data/doc/classes/Locale/SystemWin32.html +6 -6
- data/doc/classes/MOFile.html +311 -293
- data/doc/classes/MOFile/HeaderRev1.html +150 -0
- data/doc/classes/Module.html +6 -6
- data/doc/created.rid +1 -1
- data/doc/files/ChangeLog.html +143 -2
- data/doc/files/README.html +31 -25
- data/doc/files/lib/gettext/active_record_rb.html +1 -1
- data/doc/files/lib/gettext/mo_rb.html +1 -1
- data/doc/files/lib/gettext/parser/active_record_rb.html +1 -1
- data/doc/files/lib/gettext/parser/ruby_rb.html +1 -1
- data/doc/files/lib/gettext/poparser_rb.html +1 -1
- data/doc/files/lib/gettext/rails_rb.html +1 -1
- data/doc/files/lib/gettext/rgettext_rb.html +1 -1
- data/doc/files/lib/gettext/rmsgfmt_rb.html +2 -1
- data/doc/files/lib/gettext/utils_rb.html +1 -1
- data/doc/files/lib/gettext/version_rb.html +1 -1
- data/doc/files/lib/gettext_rb.html +1 -1
- data/doc/fr_class_index.html +2 -0
- data/doc/fr_method_index.html +133 -129
- data/lib/gettext.rb +49 -7
- data/lib/gettext/active_record.rb +49 -4
- data/lib/gettext/mo.rb +39 -12
- data/lib/gettext/parser/active_record.rb +6 -4
- data/lib/gettext/parser/ruby.rb +11 -4
- data/lib/gettext/poparser.rb +81 -52
- data/lib/gettext/rails.rb +28 -11
- data/lib/gettext/rgettext.rb +6 -1
- data/lib/gettext/rmsgfmt.rb +3 -11
- data/lib/gettext/utils.rb +7 -3
- data/lib/gettext/version.rb +1 -1
- data/po/bs/rails.po +55 -20
- data/po/bs/rgettext.po +3 -3
- data/po/ca/rails.po +58 -31
- data/po/ca/rgettext.po +16 -18
- data/po/cs/rails.po +55 -20
- data/po/cs/rgettext.po +3 -3
- data/po/de/rails.po +55 -27
- data/po/de/rgettext.po +21 -22
- data/po/el/rails.po +60 -36
- data/po/el/rgettext.po +15 -17
- data/po/eo/rails.po +51 -23
- data/po/eo/rgettext.po +21 -20
- data/po/es/rails.po +57 -31
- data/po/es/rgettext.po +17 -18
- data/po/et/rails.po +55 -20
- data/po/fr/rails.po +56 -21
- data/po/fr/rgettext.po +3 -3
- data/po/hr/rails.po +55 -20
- data/po/hr/rgettext.po +3 -3
- data/po/hu/rails.po +54 -26
- data/po/hu/rgettext.po +18 -17
- data/po/it/rails.po +55 -20
- data/po/it/rgettext.po +3 -3
- data/po/ja/rails.po +54 -26
- data/po/ja/rgettext.po +17 -18
- data/po/ko/rails.po +56 -21
- data/po/ko/rgettext.po +3 -3
- data/po/lv/rails.po +155 -0
- data/po/lv/rgettext.po +137 -0
- data/po/nb/rails.po +61 -34
- data/po/nb/rgettext.po +22 -19
- data/po/nl/rails.po +56 -21
- data/po/nl/rgettext.po +3 -3
- data/po/pt_BR/rails.po +53 -26
- data/po/pt_BR/rgettext.po +19 -19
- data/po/rails.pot +44 -16
- data/po/rgettext.pot +3 -3
- data/po/ru/rails.po +62 -36
- data/po/ru/rgettext.po +19 -19
- data/po/sr/rails.po +87 -58
- data/po/sr/rgettext.po +38 -33
- data/po/sv/rgettext.po +3 -3
- data/po/ua/rails.po +62 -32
- data/po/ua/rgettext.po +19 -17
- data/po/vi/rails.po +56 -28
- data/po/vi/rgettext.po +35 -34
- data/po/zh/rails.po +52 -24
- data/po/zh/rgettext.po +22 -24
- data/po/zh_TW/rails.po +51 -23
- data/po/zh_TW/rgettext.po +16 -18
- data/samples/cgi/cookie.cgi +0 -0
- data/samples/cgi/helloerb1.cgi +0 -0
- data/samples/cgi/helloerb2.cgi +0 -0
- data/samples/cgi/http.rb +0 -0
- data/samples/cgi/index.cgi +0 -0
- data/samples/cgi/po/lv/helloerb1.po +65 -0
- data/samples/cgi/po/lv/helloerb2.po +52 -0
- data/samples/cgi/po/lv/hellolib.po +24 -0
- data/samples/cgi/po/lv/main.po +77 -0
- data/samples/cgi/po/nb/helloerb1.po +16 -14
- data/samples/cgi/po/nb/helloerb2.po +14 -12
- data/samples/cgi/po/nb/hellolib.po +9 -7
- data/samples/cgi/po/nb/main.po +20 -18
- data/samples/cgi/po/sr/helloerb1.po +8 -8
- data/samples/cgi/po/sr/helloerb2.po +6 -6
- data/samples/cgi/po/sr/hellolib.po +2 -2
- data/samples/cgi/po/sr/main.po +15 -15
- data/samples/cgi/po/ua/helloerb1.po +2 -2
- data/samples/cgi/po/ua/main.po +3 -3
- data/samples/hello_plural.rb +0 -0
- data/samples/makemo.rb +0 -0
- data/samples/po/lv/hello.po +24 -0
- data/samples/po/lv/hello2.po +32 -0
- data/samples/po/lv/hello_noop.po +28 -0
- data/samples/po/lv/hello_plural.po +26 -0
- data/samples/po/lv/helloglade2.po +38 -0
- data/samples/po/lv/hellogtk.po +24 -0
- data/samples/po/lv/hellotk.po +24 -0
- data/samples/po/nb/hello.po +9 -8
- data/samples/po/nb/hello2.po +9 -9
- data/samples/po/nb/hello_noop.po +10 -9
- data/samples/po/nb/hello_plural.po +10 -8
- data/samples/po/nb/helloglade2.po +10 -8
- data/samples/po/nb/hellogtk.po +9 -8
- data/samples/po/nb/hellotk.po +9 -7
- data/samples/po/sr/hello.po +2 -2
- data/samples/po/sr/hello2.po +4 -4
- data/samples/po/sr/hello_noop.po +3 -3
- data/samples/po/sr/hello_plural.po +3 -3
- data/samples/po/sr/helloglade2.po +4 -4
- data/samples/po/sr/hellogtk.po +2 -2
- data/samples/po/sr/hellotk.po +2 -2
- data/samples/po/ua/hello2.po +2 -2
- data/samples/po/ua/hello_plural.po +2 -2
- data/samples/rails/config/boot.rb +3 -2
- data/samples/rails/config/environment.rb +2 -3
- data/samples/rails/db/schema.rb +0 -0
- data/samples/rails/po/lv/blog.po +110 -0
- data/samples/rails/po/nb/blog.po +19 -15
- data/samples/rails/po/sr/blog.po +23 -23
- data/samples/rails/po/ua/blog.po +3 -3
- data/samples/rails/public/dispatch.cgi +0 -0
- data/samples/rails/public/dispatch.fcgi +0 -0
- data/samples/rails/public/dispatch.rb +0 -0
- data/samples/rails/public/javascripts/controls.js +1 -1
- data/samples/rails/public/javascripts/dragdrop.js +1 -1
- data/samples/rails/public/javascripts/effects.js +1 -1
- data/samples/rails/script/about +0 -0
- data/samples/rails/script/breakpointer +0 -0
- data/samples/rails/script/console +0 -0
- data/samples/rails/script/destroy +0 -0
- data/samples/rails/script/generate +0 -0
- data/samples/rails/script/performance/benchmarker +0 -0
- data/samples/rails/script/performance/profiler +0 -0
- data/samples/rails/script/plugin +0 -0
- data/samples/rails/script/process/reaper +0 -0
- data/samples/rails/script/process/spawner +0 -0
- data/samples/rails/script/process/spinner +0 -0
- data/samples/rails/script/runner +0 -0
- data/samples/rails/script/server +0 -0
- data/samples/rails/vendor/plugins/gettext/po/lv/gettext_plugin.po +28 -0
- data/samples/rails/vendor/plugins/gettext/po/nb/gettext_plugin.po +11 -8
- data/samples/rails/vendor/plugins/gettext/po/sr/gettext_plugin.po +5 -5
- data/src/poparser.ry +27 -6
- data/test/benchmark.rb +1 -1
- data/test/db/mysql.drop.sql +1 -0
- data/test/db/mysql.sql +13 -0
- data/test/fixtures/inept_wizard.rb +3 -0
- data/test/fixtures/people.yml +6 -0
- data/test/fixtures/topic.rb +30 -0
- data/test/fixtures/wizard.rb +5 -0
- data/test/po/active_record.pot +151 -66
- data/test/po/ja/active_record.po +177 -92
- data/test/po/ja/test_pgettext.po +41 -0
- data/test/rails/app/controllers/users_controller.rb +1 -0
- data/test/rails/app/views/articles/_form_fr.html.erb +1 -0
- data/test/rails/config/boot.rb +96 -32
- data/test/rails/config/environment.rb +3 -2
- data/test/rails/db/schema.rb +4 -4
- data/test/rails/public/dispatch.cgi +0 -0
- data/test/rails/public/dispatch.fcgi +0 -0
- data/test/rails/public/dispatch.rb +0 -0
- data/test/rails/public/javascripts/controls.js +484 -354
- data/test/rails/public/javascripts/dragdrop.js +88 -58
- data/test/rails/public/javascripts/effects.js +396 -364
- data/test/rails/public/javascripts/prototype.js +2817 -1107
- data/test/rails/script/about +0 -0
- data/test/rails/script/breakpointer +0 -0
- data/test/rails/script/console +0 -0
- data/test/rails/script/destroy +0 -0
- data/test/rails/script/generate +0 -0
- data/test/rails/script/performance/benchmarker +0 -0
- data/test/rails/script/performance/profiler +0 -0
- data/test/rails/script/plugin +0 -0
- data/test/rails/script/process/inspector +0 -0
- data/test/rails/script/process/reaper +0 -0
- data/test/rails/script/process/spawner +0 -0
- data/test/rails/script/runner +0 -0
- data/test/rails/script/server +0 -0
- data/test/rails/test/functional/articles_controller_test.rb +5 -0
- data/test/rails/test/result/en/create_error.html +3 -3
- data/test/rails/test/result/en/custom_error_message.html +3 -3
- data/test/rails/test/result/en/custom_error_message_with_plural.html +60 -60
- data/test/rails/test/result/en/multi_error_messages_for.html +6 -6
- data/test/rails/test/result/en/new.html +3 -3
- data/test/rails/test/result/fr/custom_error_message.html +3 -3
- data/test/rails/test/result/fr/custom_error_message_with_plural.html +60 -60
- data/test/rails/test/result/fr/new.html +23 -0
- data/test/rails/test/result/ja/create_error.html +3 -3
- data/test/rails/test/result/ja/custom_error_message.html +3 -3
- data/test/rails/test/result/ja/custom_error_message_with_plural.html +60 -60
- data/test/rails/test/result/ja/multi_error_messages_for.html +6 -6
- data/test/rails/test/result/ja/new.html +3 -3
- data/test/test.sh +2 -2
- data/test/test_active_record.rb +824 -20
- data/test/test_gettext.rb +34 -4
- data/test/test_java.sh +0 -0
- data/test/test_locale.rb +2 -2
- data/test/test_parser.rb +13 -2
- data/test/test_rails_caching.rb +11 -4
- data/test/testlib/pgettext.rb +33 -0
- metadata +32 -4
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
95
|
-
<a href="#
|
|
89
|
+
<a href="#M000023">columns_with_gettext</a>
|
|
90
|
+
<a href="#M000025">set_error_message_explanation</a>
|
|
91
|
+
<a href="#M000024">set_error_message_title</a>
|
|
92
|
+
<a href="#M000021">untranslate</a>
|
|
93
|
+
<a href="#M000022">untranslate?</a>
|
|
94
|
+
<a href="#M000019">untranslate_all</a>
|
|
95
|
+
<a href="#M000020">untranslate_all?</a>
|
|
96
96
|
</div>
|
|
97
97
|
</div>
|
|
98
98
|
|
|
@@ -122,43 +122,43 @@
|
|
|
122
122
|
<div id="methods">
|
|
123
123
|
<h3 class="section-bar">Public Class methods</h3>
|
|
124
124
|
|
|
125
|
-
<div id="method-
|
|
126
|
-
<a name="
|
|
125
|
+
<div id="method-M000023" class="method-detail">
|
|
126
|
+
<a name="M000023"></a>
|
|
127
127
|
|
|
128
128
|
<div class="method-heading">
|
|
129
|
-
<a href="#
|
|
129
|
+
<a href="#M000023" class="method-signature">
|
|
130
130
|
<span class="method-name">columns_with_gettext</span><span class="method-args">()</span>
|
|
131
131
|
</a>
|
|
132
132
|
</div>
|
|
133
133
|
|
|
134
134
|
<div class="method-description">
|
|
135
135
|
<p><a class="source-toggle" href="#"
|
|
136
|
-
onclick="toggleCode('
|
|
137
|
-
<div class="method-source-code" id="
|
|
136
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
|
137
|
+
<div class="method-source-code" id="M000023-source">
|
|
138
138
|
<pre>
|
|
139
|
-
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
139
|
+
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line 184</span>
|
|
140
|
+
184: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">columns_with_gettext</span>
|
|
141
|
+
185: <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">defined?</span> <span class="ruby-ivar">@columns</span>
|
|
142
|
+
186: <span class="ruby-ivar">@columns</span> = <span class="ruby-keyword kw">nil</span>
|
|
143
|
+
187: <span class="ruby-keyword kw">end</span>
|
|
144
|
+
188: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@columns</span>
|
|
145
|
+
189: <span class="ruby-ivar">@columns</span> = <span class="ruby-identifier">columns_without_gettext</span>
|
|
146
|
+
190: <span class="ruby-ivar">@columns</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">column</span><span class="ruby-operator">|</span>
|
|
147
|
+
191: <span class="ruby-identifier">column</span>.<span class="ruby-identifier">table_class</span> = <span class="ruby-keyword kw">self</span>
|
|
148
|
+
192: }
|
|
149
|
+
193: <span class="ruby-keyword kw">end</span>
|
|
150
|
+
194: <span class="ruby-ivar">@columns</span>
|
|
151
|
+
195: <span class="ruby-keyword kw">end</span>
|
|
152
152
|
</pre>
|
|
153
153
|
</div>
|
|
154
154
|
</div>
|
|
155
155
|
</div>
|
|
156
156
|
|
|
157
|
-
<div id="method-
|
|
158
|
-
<a name="
|
|
157
|
+
<div id="method-M000025" class="method-detail">
|
|
158
|
+
<a name="M000025"></a>
|
|
159
159
|
|
|
160
160
|
<div class="method-heading">
|
|
161
|
-
<a href="#
|
|
161
|
+
<a href="#M000025" class="method-signature">
|
|
162
162
|
<span class="method-name">set_error_message_explanation(msg)<br />
|
|
163
163
|
</span>
|
|
164
164
|
</a>
|
|
@@ -182,23 +182,23 @@ Sets a your own explanation of the error message dialog.
|
|
|
182
182
|
</li>
|
|
183
183
|
</ul>
|
|
184
184
|
<p><a class="source-toggle" href="#"
|
|
185
|
-
onclick="toggleCode('
|
|
186
|
-
<div class="method-source-code" id="
|
|
185
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
|
186
|
+
<div class="method-source-code" id="M000025-source">
|
|
187
187
|
<pre>
|
|
188
|
-
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line 222</span>
|
|
189
|
+
222: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_error_message_explanation</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">plural_msg</span> = <span class="ruby-keyword kw">nil</span>)
|
|
190
|
+
223: <span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">Helpers</span><span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecordHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">L10n</span>.<span class="ruby-identifier">set_error_message_explanation</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">plural_msg</span>)
|
|
191
|
+
224: <span class="ruby-keyword kw">end</span>
|
|
192
192
|
</pre>
|
|
193
193
|
</div>
|
|
194
194
|
</div>
|
|
195
195
|
</div>
|
|
196
196
|
|
|
197
|
-
<div id="method-
|
|
198
|
-
<a name="
|
|
197
|
+
<div id="method-M000024" class="method-detail">
|
|
198
|
+
<a name="M000024"></a>
|
|
199
199
|
|
|
200
200
|
<div class="method-heading">
|
|
201
|
-
<a href="#
|
|
201
|
+
<a href="#M000024" class="method-signature">
|
|
202
202
|
<span class="method-name">set_error_message_title(msg)<br />
|
|
203
203
|
</span>
|
|
204
204
|
</a>
|
|
@@ -222,52 +222,52 @@ Sets a your own title of error message dialog.
|
|
|
222
222
|
</li>
|
|
223
223
|
</ul>
|
|
224
224
|
<p><a class="source-toggle" href="#"
|
|
225
|
-
onclick="toggleCode('
|
|
226
|
-
<div class="method-source-code" id="
|
|
225
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
|
226
|
+
<div class="method-source-code" id="M000024-source">
|
|
227
227
|
<pre>
|
|
228
|
-
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line 208</span>
|
|
229
|
+
208: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_error_message_title</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">plural_msg</span> = <span class="ruby-keyword kw">nil</span>)
|
|
230
|
+
209: <span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">Helpers</span><span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecordHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">L10n</span>.<span class="ruby-identifier">set_error_message_title</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">plural_msg</span>)
|
|
231
|
+
210: <span class="ruby-keyword kw">end</span>
|
|
232
232
|
</pre>
|
|
233
233
|
</div>
|
|
234
234
|
</div>
|
|
235
235
|
</div>
|
|
236
236
|
|
|
237
|
-
<div id="method-
|
|
238
|
-
<a name="
|
|
237
|
+
<div id="method-M000021" class="method-detail">
|
|
238
|
+
<a name="M000021"></a>
|
|
239
239
|
|
|
240
240
|
<div class="method-heading">
|
|
241
|
-
<a href="#
|
|
241
|
+
<a href="#M000021" class="method-signature">
|
|
242
242
|
<span class="method-name">untranslate</span><span class="method-args">(*w)</span>
|
|
243
243
|
</a>
|
|
244
244
|
</div>
|
|
245
245
|
|
|
246
246
|
<div class="method-description">
|
|
247
247
|
<p>
|
|
248
|
-
Sets the <a href="Base.html#
|
|
249
|
-
href="Base.html#
|
|
248
|
+
Sets the <a href="Base.html#M000021">untranslate</a> columns. (e.g.) <a
|
|
249
|
+
href="Base.html#M000021">untranslate</a> :foo, :bar, :baz
|
|
250
250
|
</p>
|
|
251
251
|
<p><a class="source-toggle" href="#"
|
|
252
|
-
onclick="toggleCode('
|
|
253
|
-
<div class="method-source-code" id="
|
|
252
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
|
253
|
+
<div class="method-source-code" id="M000021-source">
|
|
254
254
|
<pre>
|
|
255
|
-
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
255
|
+
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line 167</span>
|
|
256
|
+
167: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">untranslate</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">w</span>)
|
|
257
|
+
168: <span class="ruby-identifier">ary</span> = <span class="ruby-ivar">@@gettext_untranslate_columns</span>[<span class="ruby-keyword kw">self</span>] <span class="ruby-operator">||</span> []
|
|
258
|
+
169: <span class="ruby-identifier">ary</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">collect</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-identifier">to_s</span>}
|
|
259
|
+
170: <span class="ruby-ivar">@@gettext_untranslate_columns</span>[<span class="ruby-keyword kw">self</span>] = <span class="ruby-identifier">ary</span>
|
|
260
|
+
171: <span class="ruby-keyword kw">end</span>
|
|
261
261
|
</pre>
|
|
262
262
|
</div>
|
|
263
263
|
</div>
|
|
264
264
|
</div>
|
|
265
265
|
|
|
266
|
-
<div id="method-
|
|
267
|
-
<a name="
|
|
266
|
+
<div id="method-M000022" class="method-detail">
|
|
267
|
+
<a name="M000022"></a>
|
|
268
268
|
|
|
269
269
|
<div class="method-heading">
|
|
270
|
-
<a href="#
|
|
270
|
+
<a href="#M000022" class="method-signature">
|
|
271
271
|
<span class="method-name">untranslate?</span><span class="method-args">(columnname)</span>
|
|
272
272
|
</a>
|
|
273
273
|
</div>
|
|
@@ -275,28 +275,28 @@ href="Base.html#M000126">untranslate</a> :foo, :bar, :baz
|
|
|
275
275
|
<div class="method-description">
|
|
276
276
|
<p>
|
|
277
277
|
Returns true if the column is set "<a
|
|
278
|
-
href="Base.html#
|
|
279
|
-
href="Base.html#
|
|
278
|
+
href="Base.html#M000021">untranslate</a>". (e.g.) <a
|
|
279
|
+
href="Base.html#M000022">untranslate?</a> :foo
|
|
280
280
|
</p>
|
|
281
281
|
<p><a class="source-toggle" href="#"
|
|
282
|
-
onclick="toggleCode('
|
|
283
|
-
<div class="method-source-code" id="
|
|
282
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
|
283
|
+
<div class="method-source-code" id="M000022-source">
|
|
284
284
|
<pre>
|
|
285
|
-
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
285
|
+
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line 175</span>
|
|
286
|
+
175: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">untranslate?</span>(<span class="ruby-identifier">columnname</span>)
|
|
287
|
+
176: <span class="ruby-identifier">ary</span> = <span class="ruby-ivar">@@gettext_untranslate_columns</span>[<span class="ruby-keyword kw">self</span>] <span class="ruby-operator">||</span> []
|
|
288
|
+
177: <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">columnname</span>)
|
|
289
|
+
178: <span class="ruby-keyword kw">end</span>
|
|
290
290
|
</pre>
|
|
291
291
|
</div>
|
|
292
292
|
</div>
|
|
293
293
|
</div>
|
|
294
294
|
|
|
295
|
-
<div id="method-
|
|
296
|
-
<a name="
|
|
295
|
+
<div id="method-M000019" class="method-detail">
|
|
296
|
+
<a name="M000019"></a>
|
|
297
297
|
|
|
298
298
|
<div class="method-heading">
|
|
299
|
-
<a href="#
|
|
299
|
+
<a href="#M000019" class="method-signature">
|
|
300
300
|
<span class="method-name">untranslate_all</span><span class="method-args">()</span>
|
|
301
301
|
</a>
|
|
302
302
|
</div>
|
|
@@ -306,40 +306,40 @@ href="Base.html#M000127">untranslate?</a> :foo
|
|
|
306
306
|
Untranslate all of the tablename/fieldnames in this model class.
|
|
307
307
|
</p>
|
|
308
308
|
<p><a class="source-toggle" href="#"
|
|
309
|
-
onclick="toggleCode('
|
|
310
|
-
<div class="method-source-code" id="
|
|
309
|
+
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
|
310
|
+
<div class="method-source-code" id="M000019-source">
|
|
311
311
|
<pre>
|
|
312
|
-
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
312
|
+
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line 156</span>
|
|
313
|
+
156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">untranslate_all</span>
|
|
314
|
+
157: <span class="ruby-ivar">@@gettext_untranslate</span>[<span class="ruby-keyword kw">self</span>] = <span class="ruby-keyword kw">true</span>
|
|
315
|
+
158: <span class="ruby-keyword kw">end</span>
|
|
316
316
|
</pre>
|
|
317
317
|
</div>
|
|
318
318
|
</div>
|
|
319
319
|
</div>
|
|
320
320
|
|
|
321
|
-
<div id="method-
|
|
322
|
-
<a name="
|
|
321
|
+
<div id="method-M000020" class="method-detail">
|
|
322
|
+
<a name="M000020"></a>
|
|
323
323
|
|
|
324
324
|
<div class="method-heading">
|
|
325
|
-
<a href="#
|
|
325
|
+
<a href="#M000020" class="method-signature">
|
|
326
326
|
<span class="method-name">untranslate_all?</span><span class="method-args">()</span>
|
|
327
327
|
</a>
|
|
328
328
|
</div>
|
|
329
329
|
|
|
330
330
|
<div class="method-description">
|
|
331
331
|
<p>
|
|
332
|
-
Returns true if "<a href="Base.html#
|
|
332
|
+
Returns true if "<a href="Base.html#M000019">untranslate_all</a>"
|
|
333
333
|
is called. Otherwise false.
|
|
334
334
|
</p>
|
|
335
335
|
<p><a class="source-toggle" href="#"
|
|
336
|
-
onclick="toggleCode('
|
|
337
|
-
<div class="method-source-code" id="
|
|
336
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
|
337
|
+
<div class="method-source-code" id="M000020-source">
|
|
338
338
|
<pre>
|
|
339
|
-
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
339
|
+
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line 161</span>
|
|
340
|
+
161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">untranslate_all?</span>
|
|
341
|
+
162: <span class="ruby-ivar">@@gettext_untranslate</span>[<span class="ruby-keyword kw">self</span>]
|
|
342
|
+
163: <span class="ruby-keyword kw">end</span>
|
|
343
343
|
</pre>
|
|
344
344
|
</div>
|
|
345
345
|
</div>
|
|
@@ -92,7 +92,7 @@ An abstract definition of a column in a table.
|
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
|
93
93
|
|
|
94
94
|
<div class="name-list">
|
|
95
|
-
<a href="#
|
|
95
|
+
<a href="#M000018">human_name_with_gettext</a>
|
|
96
96
|
</div>
|
|
97
97
|
</div>
|
|
98
98
|
|
|
@@ -140,19 +140,19 @@ An abstract definition of a column in a table.
|
|
|
140
140
|
<div id="methods">
|
|
141
141
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
142
142
|
|
|
143
|
-
<div id="method-
|
|
144
|
-
<a name="
|
|
143
|
+
<div id="method-M000018" class="method-detail">
|
|
144
|
+
<a name="M000018"></a>
|
|
145
145
|
|
|
146
146
|
<div class="method-heading">
|
|
147
|
-
<a href="#
|
|
147
|
+
<a href="#M000018" class="method-signature">
|
|
148
148
|
<span class="method-name">human_name_with_gettext</span><span class="method-args">()</span>
|
|
149
149
|
</a>
|
|
150
150
|
</div>
|
|
151
151
|
|
|
152
152
|
<div class="method-description">
|
|
153
153
|
<p><a class="source-toggle" href="#"
|
|
154
|
-
onclick="toggleCode('
|
|
155
|
-
<div class="method-source-code" id="
|
|
154
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
|
155
|
+
<div class="method-source-code" id="M000018-source">
|
|
156
156
|
<pre>
|
|
157
157
|
<span class="ruby-comment cmt"># File lib/gettext/active_record.rb, line 40</span>
|
|
158
158
|
40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">human_name_with_gettext</span>
|
data/doc/classes/GetText.html
CHANGED
|
@@ -144,43 +144,46 @@
|
|
|
144
144
|
<h3 class="section-bar">Methods</h3>
|
|
145
145
|
|
|
146
146
|
<div class="name-list">
|
|
147
|
-
<a href="#
|
|
148
|
-
<a href="#
|
|
149
|
-
<a href="#
|
|
150
|
-
<a href="#
|
|
151
|
-
<a href="#
|
|
152
|
-
<a href="#
|
|
153
|
-
<a href="#
|
|
154
|
-
<a href="#
|
|
155
|
-
<a href="#
|
|
156
|
-
<a href="#
|
|
157
|
-
<a href="#
|
|
158
|
-
<a href="#
|
|
159
|
-
<a href="#
|
|
160
|
-
<a href="#
|
|
161
|
-
<a href="#
|
|
162
|
-
<a href="#
|
|
163
|
-
<a href="#
|
|
164
|
-
<a href="#
|
|
165
|
-
<a href="#
|
|
166
|
-
<a href="#
|
|
167
|
-
<a href="#
|
|
168
|
-
<a href="#
|
|
169
|
-
<a href="#
|
|
170
|
-
<a href="#
|
|
171
|
-
<a href="#
|
|
172
|
-
<a href="#
|
|
173
|
-
<a href="#
|
|
174
|
-
<a href="#
|
|
175
|
-
<a href="#
|
|
176
|
-
<a href="#
|
|
177
|
-
<a href="#
|
|
178
|
-
<a href="#
|
|
179
|
-
<a href="#
|
|
180
|
-
<a href="#
|
|
181
|
-
<a href="#
|
|
182
|
-
<a href="#
|
|
183
|
-
<a href="#
|
|
147
|
+
<a href="#M000092">N_</a>
|
|
148
|
+
<a href="#M000093">Nn_</a>
|
|
149
|
+
<a href="#M000106">_</a>
|
|
150
|
+
<a href="#M000102">add_default_locale_path</a>
|
|
151
|
+
<a href="#M000083">bindtextdomain</a>
|
|
152
|
+
<a href="#M000084">bindtextdomain_to</a>
|
|
153
|
+
<a href="#M000080">cached=</a>
|
|
154
|
+
<a href="#M000081">cached?</a>
|
|
155
|
+
<a href="#M000078">cgi</a>
|
|
156
|
+
<a href="#M000077">cgi=</a>
|
|
157
|
+
<a href="#M000082">clear_cache</a>
|
|
158
|
+
<a href="#M000072">create_mofiles</a>
|
|
159
|
+
<a href="#M000103">current_textdomain_info</a>
|
|
160
|
+
<a href="#M000087">gettext</a>
|
|
161
|
+
<a href="#M000101">locale</a>
|
|
162
|
+
<a href="#M000097">locale=</a>
|
|
163
|
+
<a href="#M000071">msgmerge</a>
|
|
164
|
+
<a href="#M000107">n_</a>
|
|
165
|
+
<a href="#M000090">ngettext</a>
|
|
166
|
+
<a href="#M000091">npgettext</a>
|
|
167
|
+
<a href="#M000110">ns_</a>
|
|
168
|
+
<a href="#M000094">nsgettext</a>
|
|
169
|
+
<a href="#M000100">output_charset</a>
|
|
170
|
+
<a href="#M000099">output_charset=</a>
|
|
171
|
+
<a href="#M000109">p_</a>
|
|
172
|
+
<a href="#M000089">pgettext</a>
|
|
173
|
+
<a href="#M000104">remove_all_textdomains</a>
|
|
174
|
+
<a href="#M000074">rgettext</a>
|
|
175
|
+
<a href="#M000075">rmsgfmt</a>
|
|
176
|
+
<a href="#M000079">rmsgmerge</a>
|
|
177
|
+
<a href="#M000108">s_</a>
|
|
178
|
+
<a href="#M000076">set_cgi</a>
|
|
179
|
+
<a href="#M000095">set_locale</a>
|
|
180
|
+
<a href="#M000096">set_locale_all</a>
|
|
181
|
+
<a href="#M000098">set_output_charset</a>
|
|
182
|
+
<a href="#M000105">setlocale</a>
|
|
183
|
+
<a href="#M000088">sgettext</a>
|
|
184
|
+
<a href="#M000085">textdomain</a>
|
|
185
|
+
<a href="#M000086">textdomain_to</a>
|
|
186
|
+
<a href="#M000073">update_pofiles</a>
|
|
184
187
|
</div>
|
|
185
188
|
</div>
|
|
186
189
|
|
|
@@ -224,7 +227,7 @@ Class <a href="GetText/TextDomainManager.html" class="link">GetText::TextDomainM
|
|
|
224
227
|
<tr class="top-aligned-row context-row">
|
|
225
228
|
<td class="context-item-name">VERSION</td>
|
|
226
229
|
<td>=</td>
|
|
227
|
-
<td class="context-item-value">"1.
|
|
230
|
+
<td class="context-item-value">"1.92.0"</td>
|
|
228
231
|
</tr>
|
|
229
232
|
</table>
|
|
230
233
|
</div>
|
|
@@ -239,11 +242,11 @@ Class <a href="GetText/TextDomainManager.html" class="link">GetText::TextDomainM
|
|
|
239
242
|
<div id="methods">
|
|
240
243
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
241
244
|
|
|
242
|
-
<div id="method-
|
|
243
|
-
<a name="
|
|
245
|
+
<div id="method-M000092" class="method-detail">
|
|
246
|
+
<a name="M000092"></a>
|
|
244
247
|
|
|
245
248
|
<div class="method-heading">
|
|
246
|
-
<a href="#
|
|
249
|
+
<a href="#M000092" class="method-signature">
|
|
247
250
|
<span class="method-name">N_</span><span class="method-args">(msgid)</span>
|
|
248
251
|
</a>
|
|
249
252
|
</div>
|
|
@@ -251,7 +254,7 @@ Class <a href="GetText/TextDomainManager.html" class="link">GetText::TextDomainM
|
|
|
251
254
|
<div class="method-description">
|
|
252
255
|
<p>
|
|
253
256
|
This function does nothing. But it is required in order to recognize the
|
|
254
|
-
msgid by <a href="GetText.html#
|
|
257
|
+
msgid by <a href="GetText.html#M000074">rgettext</a>.
|
|
255
258
|
</p>
|
|
256
259
|
<ul>
|
|
257
260
|
<li>msgid: the message id.
|
|
@@ -262,31 +265,31 @@ msgid by <a href="GetText.html#M000021">rgettext</a>.
|
|
|
262
265
|
</li>
|
|
263
266
|
</ul>
|
|
264
267
|
<p><a class="source-toggle" href="#"
|
|
265
|
-
onclick="toggleCode('
|
|
266
|
-
<div class="method-source-code" id="
|
|
268
|
+
onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
|
|
269
|
+
<div class="method-source-code" id="M000092-source">
|
|
267
270
|
<pre>
|
|
268
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 369</span>
|
|
272
|
+
369: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">N_</span>(<span class="ruby-identifier">msgid</span>)
|
|
273
|
+
370: <span class="ruby-identifier">msgid</span>
|
|
274
|
+
371: <span class="ruby-keyword kw">end</span>
|
|
272
275
|
</pre>
|
|
273
276
|
</div>
|
|
274
277
|
</div>
|
|
275
278
|
</div>
|
|
276
279
|
|
|
277
|
-
<div id="method-
|
|
278
|
-
<a name="
|
|
280
|
+
<div id="method-M000093" class="method-detail">
|
|
281
|
+
<a name="M000093"></a>
|
|
279
282
|
|
|
280
283
|
<div class="method-heading">
|
|
281
|
-
<a href="#
|
|
284
|
+
<a href="#M000093" class="method-signature">
|
|
282
285
|
<span class="method-name">Nn_</span><span class="method-args">(msgid, msgid_plural)</span>
|
|
283
286
|
</a>
|
|
284
287
|
</div>
|
|
285
288
|
|
|
286
289
|
<div class="method-description">
|
|
287
290
|
<p>
|
|
288
|
-
This is same function as <a href="GetText.html#
|
|
289
|
-
href="GetText.html#
|
|
291
|
+
This is same function as <a href="GetText.html#M000092">N_</a> but for <a
|
|
292
|
+
href="GetText.html#M000090">ngettext</a>.
|
|
290
293
|
</p>
|
|
291
294
|
<ul>
|
|
292
295
|
<li>msgid: the message id.
|
|
@@ -300,20 +303,20 @@ href="GetText.html#M000036">ngettext</a>.
|
|
|
300
303
|
</li>
|
|
301
304
|
</ul>
|
|
302
305
|
<p><a class="source-toggle" href="#"
|
|
303
|
-
onclick="toggleCode('
|
|
304
|
-
<div class="method-source-code" id="
|
|
306
|
+
onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
|
|
307
|
+
<div class="method-source-code" id="M000093-source">
|
|
305
308
|
<pre>
|
|
306
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 377</span>
|
|
310
|
+
377: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Nn_</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">msgid_plural</span>)
|
|
311
|
+
378: [<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">msgid_plural</span>]
|
|
312
|
+
379: <span class="ruby-keyword kw">end</span>
|
|
310
313
|
</pre>
|
|
311
314
|
</div>
|
|
312
315
|
</div>
|
|
313
316
|
</div>
|
|
314
317
|
|
|
315
|
-
<div id="method-
|
|
316
|
-
<a name="
|
|
318
|
+
<div id="method-M000106" class="method-detail">
|
|
319
|
+
<a name="M000106"></a>
|
|
317
320
|
|
|
318
321
|
<div class="method-heading">
|
|
319
322
|
<span class="method-name">_</span><span class="method-args">(msgid)</span>
|
|
@@ -321,31 +324,31 @@ href="GetText.html#M000036">ngettext</a>.
|
|
|
321
324
|
|
|
322
325
|
<div class="method-description">
|
|
323
326
|
<p>
|
|
324
|
-
Alias for <a href="GetText.html#
|
|
327
|
+
Alias for <a href="GetText.html#M000087">gettext</a>
|
|
325
328
|
</p>
|
|
326
329
|
</div>
|
|
327
330
|
</div>
|
|
328
331
|
|
|
329
|
-
<div id="method-
|
|
330
|
-
<a name="
|
|
332
|
+
<div id="method-M000102" class="method-detail">
|
|
333
|
+
<a name="M000102"></a>
|
|
331
334
|
|
|
332
335
|
<div class="method-heading">
|
|
333
|
-
<a href="#
|
|
336
|
+
<a href="#M000102" class="method-signature">
|
|
334
337
|
<span class="method-name">add_default_locale_path</span><span class="method-args">(path)</span>
|
|
335
338
|
</a>
|
|
336
339
|
</div>
|
|
337
340
|
|
|
338
341
|
<div class="method-description">
|
|
339
342
|
<p>
|
|
340
|
-
Add default <a href="GetText.html#
|
|
343
|
+
Add default <a href="GetText.html#M000101">locale</a> path.
|
|
341
344
|
</p>
|
|
342
345
|
<ul>
|
|
343
|
-
<li>path: a new <a href="GetText.html#
|
|
346
|
+
<li>path: a new <a href="GetText.html#M000101">locale</a> path. (e.g.)
|
|
344
347
|
"/usr/share/locale/%{<a
|
|
345
|
-
href="GetText.html#
|
|
346
|
-
(‘<a href="GetText.html#
|
|
348
|
+
href="GetText.html#M000101">locale</a>}/LC_MESSAGES/%{name}.mo"
|
|
349
|
+
(‘<a href="GetText.html#M000101">locale</a>’ =>
|
|
347
350
|
"ja_JP", ‘name’ => "<a
|
|
348
|
-
href="GetText.html#
|
|
351
|
+
href="GetText.html#M000085">textdomain</a>")
|
|
349
352
|
|
|
350
353
|
</li>
|
|
351
354
|
<li>Returns: the new DEFAULT_LOCALE_PATHS
|
|
@@ -353,23 +356,23 @@ href="GetText.html#M000032">textdomain</a>")
|
|
|
353
356
|
</li>
|
|
354
357
|
</ul>
|
|
355
358
|
<p><a class="source-toggle" href="#"
|
|
356
|
-
onclick="toggleCode('
|
|
357
|
-
<div class="method-source-code" id="
|
|
359
|
+
onclick="toggleCode('M000102-source');return false;">[Source]</a></p>
|
|
360
|
+
<div class="method-source-code" id="M000102-source">
|
|
358
361
|
<pre>
|
|
359
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
362
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 551</span>
|
|
363
|
+
551: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_default_locale_path</span>(<span class="ruby-identifier">path</span>)
|
|
364
|
+
552: <span class="ruby-constant">TextDomain</span>.<span class="ruby-identifier">add_default_locale_path</span>(<span class="ruby-identifier">path</span>)
|
|
365
|
+
553: <span class="ruby-keyword kw">end</span>
|
|
363
366
|
</pre>
|
|
364
367
|
</div>
|
|
365
368
|
</div>
|
|
366
369
|
</div>
|
|
367
370
|
|
|
368
|
-
<div id="method-
|
|
369
|
-
<a name="
|
|
371
|
+
<div id="method-M000083" class="method-detail">
|
|
372
|
+
<a name="M000083"></a>
|
|
370
373
|
|
|
371
374
|
<div class="method-heading">
|
|
372
|
-
<a href="#
|
|
375
|
+
<a href="#M000083" class="method-signature">
|
|
373
376
|
<span class="method-name">bindtextdomain(domainname, options = {})<br />
|
|
374
377
|
</span>
|
|
375
378
|
</a>
|
|
@@ -377,18 +380,18 @@ href="GetText.html#M000032">textdomain</a>")
|
|
|
377
380
|
|
|
378
381
|
<div class="method-description">
|
|
379
382
|
<p>
|
|
380
|
-
Bind a <a href="GetText.html#
|
|
381
|
-
href="GetText.html#
|
|
383
|
+
Bind a <a href="GetText.html#M000085">textdomain</a>(%{path}/%{<a
|
|
384
|
+
href="GetText.html#M000101">locale</a>}/LC_MESSAGES/%{domainname}.mo) to
|
|
382
385
|
your program. Normally, the texdomain scope becomes a ruby-script-file. So
|
|
383
386
|
you need to call this function each ruby-script-files. On the other hand,
|
|
384
387
|
if you call this function under <a
|
|
385
388
|
href="GetText/Container.html">GetText::Container</a> (gettext/container,
|
|
386
389
|
gettext/erb, gettext/rails), the <a
|
|
387
|
-
href="GetText.html#
|
|
390
|
+
href="GetText.html#M000085">textdomain</a> scope becomes a Class/<a
|
|
388
391
|
href="Module.html">Module</a>.
|
|
389
392
|
</p>
|
|
390
393
|
<ul>
|
|
391
|
-
<li>domainname: the <a href="GetText.html#
|
|
394
|
+
<li>domainname: the <a href="GetText.html#M000085">textdomain</a> name.
|
|
392
395
|
|
|
393
396
|
</li>
|
|
394
397
|
<li>options: options as an Hash.
|
|
@@ -398,16 +401,16 @@ href="Module.html">Module</a>.
|
|
|
398
401
|
default paths such as /usr/share/locale, /usr/local/share/locale)
|
|
399
402
|
|
|
400
403
|
</li>
|
|
401
|
-
<li>:<a href="GetText.html#
|
|
402
|
-
href="GetText.html#
|
|
404
|
+
<li>:<a href="GetText.html#M000101">locale</a> - the <a
|
|
405
|
+
href="GetText.html#M000101">locale</a> string such as
|
|
403
406
|
"ja_JP.UTF-8". Generally, you should use <a
|
|
404
|
-
href="GetText.html#
|
|
407
|
+
href="GetText.html#M000095">GetText.set_locale</a> instead. The value is
|
|
405
408
|
searched order by: the value of this value > System default language.
|
|
406
409
|
|
|
407
410
|
</li>
|
|
408
411
|
<li>:charset - output charset. This affect the current <a
|
|
409
|
-
href="GetText.html#
|
|
410
|
-
<a href="GetText.html#
|
|
412
|
+
href="GetText.html#M000085">textdomain</a> only. Generally, you should use
|
|
413
|
+
<a href="GetText.html#M000098">GetText.set_output_charset</a> instead. The
|
|
411
414
|
value is searched order by: the value of Locale.set_output_charset >
|
|
412
415
|
ENV["OUTPUT_CHARSET"] > this value > System default
|
|
413
416
|
charset.
|
|
@@ -425,8 +428,8 @@ Note: Don‘t use locale_, charset argument(not in options). They are
|
|
|
425
428
|
remained for backward compatibility.
|
|
426
429
|
</p>
|
|
427
430
|
<p><a class="source-toggle" href="#"
|
|
428
|
-
onclick="toggleCode('
|
|
429
|
-
<div class="method-source-code" id="
|
|
431
|
+
onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
|
|
432
|
+
<div class="method-source-code" id="M000083-source">
|
|
430
433
|
<pre>
|
|
431
434
|
<span class="ruby-comment cmt"># File lib/gettext.rb, line 85</span>
|
|
432
435
|
85: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bindtextdomain</span>(<span class="ruby-identifier">domainname</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">locale_</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">charset</span> = <span class="ruby-keyword kw">nil</span>)
|
|
@@ -457,11 +460,11 @@ remained for backward compatibility.
|
|
|
457
460
|
</div>
|
|
458
461
|
</div>
|
|
459
462
|
|
|
460
|
-
<div id="method-
|
|
461
|
-
<a name="
|
|
463
|
+
<div id="method-M000084" class="method-detail">
|
|
464
|
+
<a name="M000084"></a>
|
|
462
465
|
|
|
463
466
|
<div class="method-heading">
|
|
464
|
-
<a href="#
|
|
467
|
+
<a href="#M000084" class="method-signature">
|
|
465
468
|
<span class="method-name">bindtextdomain_to</span><span class="method-args">(klass, domainname, options = {})</span>
|
|
466
469
|
</a>
|
|
467
470
|
</div>
|
|
@@ -469,23 +472,23 @@ remained for backward compatibility.
|
|
|
469
472
|
<div class="method-description">
|
|
470
473
|
<p>
|
|
471
474
|
Includes <a href="GetText.html">GetText</a> module and bind a <a
|
|
472
|
-
href="GetText.html#
|
|
475
|
+
href="GetText.html#M000085">textdomain</a> to a class.
|
|
473
476
|
</p>
|
|
474
477
|
<ul>
|
|
475
478
|
<li>klass: the target ruby class.
|
|
476
479
|
|
|
477
480
|
</li>
|
|
478
|
-
<li>domainname: the <a href="GetText.html#
|
|
481
|
+
<li>domainname: the <a href="GetText.html#M000085">textdomain</a> name.
|
|
479
482
|
|
|
480
483
|
</li>
|
|
481
484
|
<li>options: options as an Hash. See <a
|
|
482
|
-
href="GetText.html#
|
|
485
|
+
href="GetText.html#M000083">GetText.bindtextdomain</a>.
|
|
483
486
|
|
|
484
487
|
</li>
|
|
485
488
|
</ul>
|
|
486
489
|
<p><a class="source-toggle" href="#"
|
|
487
|
-
onclick="toggleCode('
|
|
488
|
-
<div class="method-source-code" id="
|
|
490
|
+
onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
|
|
491
|
+
<div class="method-source-code" id="M000084-source">
|
|
489
492
|
<pre>
|
|
490
493
|
<span class="ruby-comment cmt"># File lib/gettext.rb, line 113</span>
|
|
491
494
|
113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bindtextdomain_to</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">domainname</span>, <span class="ruby-identifier">options</span> = {})
|
|
@@ -501,11 +504,11 @@ href="GetText.html#M000030">GetText.bindtextdomain</a>.
|
|
|
501
504
|
</div>
|
|
502
505
|
</div>
|
|
503
506
|
|
|
504
|
-
<div id="method-
|
|
505
|
-
<a name="
|
|
507
|
+
<div id="method-M000080" class="method-detail">
|
|
508
|
+
<a name="M000080"></a>
|
|
506
509
|
|
|
507
510
|
<div class="method-heading">
|
|
508
|
-
<a href="#
|
|
511
|
+
<a href="#M000080" class="method-signature">
|
|
509
512
|
<span class="method-name">cached=</span><span class="method-args">(val)</span>
|
|
510
513
|
</a>
|
|
511
514
|
</div>
|
|
@@ -520,8 +523,8 @@ Default is true. If $DEBUG is false, messages are not checked even if this
|
|
|
520
523
|
value is true.
|
|
521
524
|
</p>
|
|
522
525
|
<p><a class="source-toggle" href="#"
|
|
523
|
-
onclick="toggleCode('
|
|
524
|
-
<div class="method-source-code" id="
|
|
526
|
+
onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
|
|
527
|
+
<div class="method-source-code" id="M000080-source">
|
|
525
528
|
<pre>
|
|
526
529
|
<span class="ruby-comment cmt"># File lib/gettext.rb, line 42</span>
|
|
527
530
|
42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cached=</span>(<span class="ruby-identifier">val</span>)
|
|
@@ -533,11 +536,11 @@ value is true.
|
|
|
533
536
|
</div>
|
|
534
537
|
</div>
|
|
535
538
|
|
|
536
|
-
<div id="method-
|
|
537
|
-
<a name="
|
|
539
|
+
<div id="method-M000081" class="method-detail">
|
|
540
|
+
<a name="M000081"></a>
|
|
538
541
|
|
|
539
542
|
<div class="method-heading">
|
|
540
|
-
<a href="#
|
|
543
|
+
<a href="#M000081" class="method-signature">
|
|
541
544
|
<span class="method-name">cached?</span><span class="method-args">()</span>
|
|
542
545
|
</a>
|
|
543
546
|
</div>
|
|
@@ -547,8 +550,8 @@ value is true.
|
|
|
547
550
|
Return the cached value.
|
|
548
551
|
</p>
|
|
549
552
|
<p><a class="source-toggle" href="#"
|
|
550
|
-
onclick="toggleCode('
|
|
551
|
-
<div class="method-source-code" id="
|
|
553
|
+
onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
|
|
554
|
+
<div class="method-source-code" id="M000081-source">
|
|
552
555
|
<pre>
|
|
553
556
|
<span class="ruby-comment cmt"># File lib/gettext.rb, line 48</span>
|
|
554
557
|
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cached?</span>
|
|
@@ -559,11 +562,11 @@ Return the cached value.
|
|
|
559
562
|
</div>
|
|
560
563
|
</div>
|
|
561
564
|
|
|
562
|
-
<div id="method-
|
|
563
|
-
<a name="
|
|
565
|
+
<div id="method-M000078" class="method-detail">
|
|
566
|
+
<a name="M000078"></a>
|
|
564
567
|
|
|
565
568
|
<div class="method-heading">
|
|
566
|
-
<a href="#
|
|
569
|
+
<a href="#M000078" class="method-signature">
|
|
567
570
|
<span class="method-name">cgi</span><span class="method-args">()</span>
|
|
568
571
|
</a>
|
|
569
572
|
</div>
|
|
@@ -578,8 +581,8 @@ Gets the CGI object. If it is nil, returns new CGI object.
|
|
|
578
581
|
</li>
|
|
579
582
|
</ul>
|
|
580
583
|
<p><a class="source-toggle" href="#"
|
|
581
|
-
onclick="toggleCode('
|
|
582
|
-
<div class="method-source-code" id="
|
|
584
|
+
onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
|
|
585
|
+
<div class="method-source-code" id="M000078-source">
|
|
583
586
|
<pre>
|
|
584
587
|
<span class="ruby-comment cmt"># File lib/gettext/cgi.rb, line 36</span>
|
|
585
588
|
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cgi</span>
|
|
@@ -590,18 +593,18 @@ Gets the CGI object. If it is nil, returns new CGI object.
|
|
|
590
593
|
</div>
|
|
591
594
|
</div>
|
|
592
595
|
|
|
593
|
-
<div id="method-
|
|
594
|
-
<a name="
|
|
596
|
+
<div id="method-M000077" class="method-detail">
|
|
597
|
+
<a name="M000077"></a>
|
|
595
598
|
|
|
596
599
|
<div class="method-heading">
|
|
597
|
-
<a href="#
|
|
600
|
+
<a href="#M000077" class="method-signature">
|
|
598
601
|
<span class="method-name">cgi=</span><span class="method-args">(cgi_)</span>
|
|
599
602
|
</a>
|
|
600
603
|
</div>
|
|
601
604
|
|
|
602
605
|
<div class="method-description">
|
|
603
606
|
<p>
|
|
604
|
-
Same as <a href="GetText.html#
|
|
607
|
+
Same as <a href="GetText.html#M000076">GetText.set_cgi</a>.
|
|
605
608
|
</p>
|
|
606
609
|
<ul>
|
|
607
610
|
<li>cgi_: CGI object
|
|
@@ -612,8 +615,8 @@ Same as <a href="GetText.html#M000023">GetText.set_cgi</a>.
|
|
|
612
615
|
</li>
|
|
613
616
|
</ul>
|
|
614
617
|
<p><a class="source-toggle" href="#"
|
|
615
|
-
onclick="toggleCode('
|
|
616
|
-
<div class="method-source-code" id="
|
|
618
|
+
onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
|
|
619
|
+
<div class="method-source-code" id="M000077-source">
|
|
617
620
|
<pre>
|
|
618
621
|
<span class="ruby-comment cmt"># File lib/gettext/cgi.rb, line 29</span>
|
|
619
622
|
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cgi=</span>(<span class="ruby-identifier">cgi_</span>)
|
|
@@ -625,11 +628,11 @@ Same as <a href="GetText.html#M000023">GetText.set_cgi</a>.
|
|
|
625
628
|
</div>
|
|
626
629
|
</div>
|
|
627
630
|
|
|
628
|
-
<div id="method-
|
|
629
|
-
<a name="
|
|
631
|
+
<div id="method-M000082" class="method-detail">
|
|
632
|
+
<a name="M000082"></a>
|
|
630
633
|
|
|
631
634
|
<div class="method-heading">
|
|
632
|
-
<a href="#
|
|
635
|
+
<a href="#M000082" class="method-signature">
|
|
633
636
|
<span class="method-name">clear_cache</span><span class="method-args">()</span>
|
|
634
637
|
</a>
|
|
635
638
|
</div>
|
|
@@ -639,8 +642,8 @@ Same as <a href="GetText.html#M000023">GetText.set_cgi</a>.
|
|
|
639
642
|
Clear the cached messages.
|
|
640
643
|
</p>
|
|
641
644
|
<p><a class="source-toggle" href="#"
|
|
642
|
-
onclick="toggleCode('
|
|
643
|
-
<div class="method-source-code" id="
|
|
645
|
+
onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
|
|
646
|
+
<div class="method-source-code" id="M000082-source">
|
|
644
647
|
<pre>
|
|
645
648
|
<span class="ruby-comment cmt"># File lib/gettext.rb, line 53</span>
|
|
646
649
|
53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_cache</span>
|
|
@@ -655,11 +658,11 @@ Clear the cached messages.
|
|
|
655
658
|
</div>
|
|
656
659
|
</div>
|
|
657
660
|
|
|
658
|
-
<div id="method-
|
|
659
|
-
<a name="
|
|
661
|
+
<div id="method-M000072" class="method-detail">
|
|
662
|
+
<a name="M000072"></a>
|
|
660
663
|
|
|
661
664
|
<div class="method-heading">
|
|
662
|
-
<a href="#
|
|
665
|
+
<a href="#M000072" class="method-signature">
|
|
663
666
|
<span class="method-name">create_mofiles</span><span class="method-args">(verbose = false, podir = "./po", targetdir = "./data/locale", targetpath_rule = "%s/LC_MESSAGES")</span>
|
|
664
667
|
</a>
|
|
665
668
|
</div>
|
|
@@ -671,7 +674,7 @@ Creates mo-files using #{po_root}/#{lang}/*.po an put them to
|
|
|
671
674
|
</p>
|
|
672
675
|
<p>
|
|
673
676
|
This is a convenience function of <a
|
|
674
|
-
href="GetText.html#
|
|
677
|
+
href="GetText.html#M000075">GetText.rmsgfmt</a> for plural target files.
|
|
675
678
|
</p>
|
|
676
679
|
<ul>
|
|
677
680
|
<li>verbose: true if verbose mode, otherwise false
|
|
@@ -689,8 +692,8 @@ becomes "#{lang}" under po_root.
|
|
|
689
692
|
</li>
|
|
690
693
|
</ul>
|
|
691
694
|
<p><a class="source-toggle" href="#"
|
|
692
|
-
onclick="toggleCode('
|
|
693
|
-
<div class="method-source-code" id="
|
|
695
|
+
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
|
696
|
+
<div class="method-source-code" id="M000072-source">
|
|
694
697
|
<pre>
|
|
695
698
|
<span class="ruby-comment cmt"># File lib/gettext/utils.rb, line 96</span>
|
|
696
699
|
96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_mofiles</span>(<span class="ruby-identifier">verbose</span> = <span class="ruby-keyword kw">false</span>,
|
|
@@ -702,29 +705,33 @@ becomes "#{lang}" under po_root.
|
|
|
702
705
|
102: <span class="ruby-identifier">lang</span>, <span class="ruby-identifier">basename</span> = <span class="ruby-regexp re">/\/([^\/]+?)\/(.*)\.po/</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">file</span>[<span class="ruby-identifier">podir</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]).<span class="ruby-identifier">to_a</span>[<span class="ruby-value">1</span>,<span class="ruby-value">2</span>]
|
|
703
706
|
103: <span class="ruby-identifier">outdir</span> = <span class="ruby-identifier">modir</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">lang</span>
|
|
704
707
|
104: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">outdir</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">outdir</span>)
|
|
705
|
-
105: <span class="ruby-identifier"
|
|
706
|
-
106: <span class="ruby-keyword kw">
|
|
707
|
-
107: <span class="ruby-identifier"
|
|
708
|
-
108: <span class="ruby-keyword kw">
|
|
709
|
-
109:
|
|
710
|
-
110:
|
|
708
|
+
105: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">%Q[#{file} -> #{File.join(outdir, "#{basename}.mo")} ... ]</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
|
|
709
|
+
106: <span class="ruby-keyword kw">begin</span>
|
|
710
|
+
107: <span class="ruby-identifier">rmsgfmt</span>(<span class="ruby-identifier">file</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">outdir</span>, <span class="ruby-node">"#{basename}.mo"</span>))
|
|
711
|
+
108: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
|
712
|
+
109: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Error."</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
|
|
713
|
+
110: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
|
|
714
|
+
111: <span class="ruby-keyword kw">end</span>
|
|
715
|
+
112: <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Done."</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
|
|
716
|
+
113: <span class="ruby-keyword kw">end</span>
|
|
717
|
+
114: <span class="ruby-keyword kw">end</span>
|
|
711
718
|
</pre>
|
|
712
719
|
</div>
|
|
713
720
|
</div>
|
|
714
721
|
</div>
|
|
715
722
|
|
|
716
|
-
<div id="method-
|
|
717
|
-
<a name="
|
|
723
|
+
<div id="method-M000103" class="method-detail">
|
|
724
|
+
<a name="M000103"></a>
|
|
718
725
|
|
|
719
726
|
<div class="method-heading">
|
|
720
|
-
<a href="#
|
|
727
|
+
<a href="#M000103" class="method-signature">
|
|
721
728
|
<span class="method-name">current_textdomain_info</span><span class="method-args">(options = {})</span>
|
|
722
729
|
</a>
|
|
723
730
|
</div>
|
|
724
731
|
|
|
725
732
|
<div class="method-description">
|
|
726
733
|
<p>
|
|
727
|
-
Show the current <a href="GetText.html#
|
|
734
|
+
Show the current <a href="GetText.html#M000085">textdomain</a> information.
|
|
728
735
|
This function is for debugging.
|
|
729
736
|
</p>
|
|
730
737
|
<ul>
|
|
@@ -745,41 +752,41 @@ Default is false.
|
|
|
745
752
|
</li>
|
|
746
753
|
</ul>
|
|
747
754
|
<p><a class="source-toggle" href="#"
|
|
748
|
-
onclick="toggleCode('
|
|
749
|
-
<div class="method-source-code" id="
|
|
755
|
+
onclick="toggleCode('M000103-source');return false;">[Source]</a></p>
|
|
756
|
+
<div class="method-source-code" id="M000103-source">
|
|
750
757
|
<pre>
|
|
751
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
758
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 560</span>
|
|
759
|
+
560: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_textdomain_info</span>(<span class="ruby-identifier">options</span> = {})
|
|
760
|
+
561: <span class="ruby-identifier">opts</span> = {<span class="ruby-identifier">:with_messages</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:with_paths</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:out</span> =<span class="ruby-operator">></span> <span class="ruby-constant">STDOUT</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
|
761
|
+
562: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">nil</span>
|
|
762
|
+
563: <span class="ruby-identifier">each_textdomain</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">textdomain</span><span class="ruby-operator">|</span>
|
|
763
|
+
564: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:out</span>].<span class="ruby-identifier">puts</span> <span class="ruby-node">"TextDomain name: \"#{textdomain.name}\""</span>
|
|
764
|
+
565: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:out</span>].<span class="ruby-identifier">puts</span> <span class="ruby-node">"TextDomain current locale: \"#{textdomain.current_locale}\""</span>
|
|
765
|
+
566: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:out</span>].<span class="ruby-identifier">puts</span> <span class="ruby-node">"TextDomain current mo filename: \"#{textdomain.current_mo.filename}\""</span>
|
|
766
|
+
567: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:with_paths</span>]
|
|
767
|
+
568: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:out</span>].<span class="ruby-identifier">puts</span> <span class="ruby-value str">"TextDomain locale file paths:"</span>
|
|
768
|
+
569: <span class="ruby-identifier">textdomain</span>.<span class="ruby-identifier">locale_paths</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
769
|
+
570: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:out</span>].<span class="ruby-identifier">puts</span> <span class="ruby-node">" #{v}"</span>
|
|
770
|
+
571: <span class="ruby-keyword kw">end</span>
|
|
771
|
+
572: <span class="ruby-keyword kw">end</span>
|
|
772
|
+
573: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:with_messages</span>]
|
|
773
|
+
574: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:out</span>].<span class="ruby-identifier">puts</span> <span class="ruby-value str">"The messages in the mo file:"</span>
|
|
774
|
+
575: <span class="ruby-identifier">textdomain</span>.<span class="ruby-identifier">current_mo</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
775
|
+
576: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:out</span>].<span class="ruby-identifier">puts</span> <span class="ruby-node">" \"#{k}\": \"#{v}\""</span>
|
|
776
|
+
577: }
|
|
777
|
+
578: <span class="ruby-keyword kw">end</span>
|
|
778
|
+
579: }
|
|
779
|
+
580: <span class="ruby-keyword kw">end</span>
|
|
773
780
|
</pre>
|
|
774
781
|
</div>
|
|
775
782
|
</div>
|
|
776
783
|
</div>
|
|
777
784
|
|
|
778
|
-
<div id="method-
|
|
779
|
-
<a name="
|
|
785
|
+
<div id="method-M000087" class="method-detail">
|
|
786
|
+
<a name="M000087"></a>
|
|
780
787
|
|
|
781
788
|
<div class="method-heading">
|
|
782
|
-
<a href="#
|
|
789
|
+
<a href="#M000087" class="method-signature">
|
|
783
790
|
<span class="method-name">gettext(msgid)<br />
|
|
784
791
|
_(msgid)<br />
|
|
785
792
|
</span>
|
|
@@ -796,14 +803,14 @@ You need to use String#dup if you want to modify the return value with
|
|
|
796
803
|
destructive functions.
|
|
797
804
|
</p>
|
|
798
805
|
<p>
|
|
799
|
-
(e.g.1) <a href="GetText.html#
|
|
806
|
+
(e.g.1) <a href="GetText.html#M000106">_</a>("Hello ").dup
|
|
800
807
|
<< "world"
|
|
801
808
|
</p>
|
|
802
809
|
<p>
|
|
803
810
|
But e.g.1 should be rewrite to:
|
|
804
811
|
</p>
|
|
805
812
|
<p>
|
|
806
|
-
(e.g.2) <a href="GetText.html#
|
|
813
|
+
(e.g.2) <a href="GetText.html#M000106">_</a>("Hello %{val}") %
|
|
807
814
|
{:val => "world"}
|
|
808
815
|
</p>
|
|
809
816
|
<p>
|
|
@@ -820,30 +827,30 @@ return msgid.
|
|
|
820
827
|
</li>
|
|
821
828
|
</ul>
|
|
822
829
|
<p><a class="source-toggle" href="#"
|
|
823
|
-
onclick="toggleCode('
|
|
824
|
-
<div class="method-source-code" id="
|
|
830
|
+
onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
|
|
831
|
+
<div class="method-source-code" id="M000087-source">
|
|
825
832
|
<pre>
|
|
826
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
833
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 263</span>
|
|
834
|
+
263: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gettext</span>(<span class="ruby-identifier">msgid</span>)
|
|
835
|
+
264: <span class="ruby-identifier">sgettext</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-keyword kw">nil</span>)
|
|
836
|
+
265: <span class="ruby-keyword kw">end</span>
|
|
830
837
|
</pre>
|
|
831
838
|
</div>
|
|
832
839
|
</div>
|
|
833
840
|
</div>
|
|
834
841
|
|
|
835
|
-
<div id="method-
|
|
836
|
-
<a name="
|
|
842
|
+
<div id="method-M000101" class="method-detail">
|
|
843
|
+
<a name="M000101"></a>
|
|
837
844
|
|
|
838
845
|
<div class="method-heading">
|
|
839
|
-
<a href="#
|
|
846
|
+
<a href="#M000101" class="method-signature">
|
|
840
847
|
<span class="method-name">locale</span><span class="method-args">()</span>
|
|
841
848
|
</a>
|
|
842
849
|
</div>
|
|
843
850
|
|
|
844
851
|
<div class="method-description">
|
|
845
852
|
<p>
|
|
846
|
-
Gets the current <a href="GetText.html#
|
|
853
|
+
Gets the current <a href="GetText.html#M000101">locale</a>.
|
|
847
854
|
</p>
|
|
848
855
|
<ul>
|
|
849
856
|
<li>Returns: a current <a href="Locale/Object.html">Locale::Object</a>
|
|
@@ -851,66 +858,66 @@ Gets the current <a href="GetText.html#M000046">locale</a>.
|
|
|
851
858
|
</li>
|
|
852
859
|
</ul>
|
|
853
860
|
<p><a class="source-toggle" href="#"
|
|
854
|
-
onclick="toggleCode('
|
|
855
|
-
<div class="method-source-code" id="
|
|
861
|
+
onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
|
|
862
|
+
<div class="method-source-code" id="M000101-source">
|
|
856
863
|
<pre>
|
|
857
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
864
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 543</span>
|
|
865
|
+
543: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">locale</span>
|
|
866
|
+
544: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">current</span>
|
|
867
|
+
545: <span class="ruby-keyword kw">end</span>
|
|
861
868
|
</pre>
|
|
862
869
|
</div>
|
|
863
870
|
</div>
|
|
864
871
|
</div>
|
|
865
872
|
|
|
866
|
-
<div id="method-
|
|
867
|
-
<a name="
|
|
873
|
+
<div id="method-M000097" class="method-detail">
|
|
874
|
+
<a name="M000097"></a>
|
|
868
875
|
|
|
869
876
|
<div class="method-heading">
|
|
870
|
-
<a href="#
|
|
877
|
+
<a href="#M000097" class="method-signature">
|
|
871
878
|
<span class="method-name">locale=</span><span class="method-args">(locale)</span>
|
|
872
879
|
</a>
|
|
873
880
|
</div>
|
|
874
881
|
|
|
875
882
|
<div class="method-description">
|
|
876
883
|
<p>
|
|
877
|
-
Sets the default/current <a href="GetText.html#
|
|
884
|
+
Sets the default/current <a href="GetText.html#M000101">locale</a>. This
|
|
878
885
|
method haves the strongest infulence. All of the Textdomains are set the
|
|
879
|
-
new <a href="GetText.html#
|
|
886
|
+
new <a href="GetText.html#M000101">locale</a>.
|
|
880
887
|
</p>
|
|
881
888
|
<p>
|
|
882
889
|
Note that you shouldn‘t use this for your own Libraries.
|
|
883
890
|
</p>
|
|
884
891
|
<ul>
|
|
885
|
-
<li><a href="GetText.html#
|
|
886
|
-
href="GetText.html#
|
|
892
|
+
<li><a href="GetText.html#M000101">locale</a>: a <a
|
|
893
|
+
href="GetText.html#M000101">locale</a> string or <a
|
|
887
894
|
href="Locale/Object.html">Locale::Object</a>
|
|
888
895
|
|
|
889
896
|
</li>
|
|
890
|
-
<li>Returns: a <a href="GetText.html#
|
|
897
|
+
<li>Returns: a <a href="GetText.html#M000101">locale</a> string
|
|
891
898
|
|
|
892
899
|
</li>
|
|
893
900
|
</ul>
|
|
894
901
|
<p><a class="source-toggle" href="#"
|
|
895
|
-
onclick="toggleCode('
|
|
896
|
-
<div class="method-source-code" id="
|
|
902
|
+
onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
|
|
903
|
+
<div class="method-source-code" id="M000097-source">
|
|
897
904
|
<pre>
|
|
898
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
905
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 513</span>
|
|
906
|
+
513: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">locale=</span>(<span class="ruby-identifier">locale</span>)
|
|
907
|
+
514: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">default</span> = <span class="ruby-identifier">locale</span>
|
|
908
|
+
515: <span class="ruby-identifier">set_locale_all</span>(<span class="ruby-identifier">locale</span>)
|
|
909
|
+
516: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">default</span>
|
|
910
|
+
517: <span class="ruby-keyword kw">end</span>
|
|
904
911
|
</pre>
|
|
905
912
|
</div>
|
|
906
913
|
</div>
|
|
907
914
|
</div>
|
|
908
915
|
|
|
909
|
-
<div id="method-
|
|
910
|
-
<a name="
|
|
916
|
+
<div id="method-M000071" class="method-detail">
|
|
917
|
+
<a name="M000071"></a>
|
|
911
918
|
|
|
912
919
|
<div class="method-heading">
|
|
913
|
-
<a href="#
|
|
920
|
+
<a href="#M000071" class="method-signature">
|
|
914
921
|
<span class="method-name">msgmerge</span><span class="method-args">(defpo, refpo, app_version)</span>
|
|
915
922
|
</a>
|
|
916
923
|
</div>
|
|
@@ -921,7 +928,7 @@ Merges two Uniforum style .po files together.
|
|
|
921
928
|
</p>
|
|
922
929
|
<p>
|
|
923
930
|
<b>Note</b> This function requires "<a
|
|
924
|
-
href="GetText.html#
|
|
931
|
+
href="GetText.html#M000071">msgmerge</a>" tool included in GNU <a
|
|
925
932
|
href="GetText.html">GetText</a>. So you need to install GNU <a
|
|
926
933
|
href="GetText.html">GetText</a>.
|
|
927
934
|
</p>
|
|
@@ -934,14 +941,14 @@ discarded.
|
|
|
934
941
|
<p>
|
|
935
942
|
The ref.pot file is the last created PO file with up-to-date source
|
|
936
943
|
references but old translations, or a PO Template file (generally created
|
|
937
|
-
by <a href="GetText.html#
|
|
944
|
+
by <a href="GetText.html#M000074">rgettext</a>); any translations or
|
|
938
945
|
comments in the file will be discarded, however dot comments and file
|
|
939
946
|
positions will be preserved. Where an exact match cannot be found, fuzzy
|
|
940
947
|
matching is used to produce better results.
|
|
941
948
|
</p>
|
|
942
949
|
<p>
|
|
943
950
|
Usually you don‘t need to call this function directly. Use <a
|
|
944
|
-
href="GetText.html#
|
|
951
|
+
href="GetText.html#M000073">GetText.update_pofiles</a> instead.
|
|
945
952
|
</p>
|
|
946
953
|
<ul>
|
|
947
954
|
<li>defpo: a po-file. translations referring to old sources
|
|
@@ -959,8 +966,8 @@ href="GetText.html#M000020">GetText.update_pofiles</a> instead.
|
|
|
959
966
|
</li>
|
|
960
967
|
</ul>
|
|
961
968
|
<p><a class="source-toggle" href="#"
|
|
962
|
-
onclick="toggleCode('
|
|
963
|
-
<div class="method-source-code" id="
|
|
969
|
+
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
|
970
|
+
<div class="method-source-code" id="M000071-source">
|
|
964
971
|
<pre>
|
|
965
972
|
<span class="ruby-comment cmt"># File lib/gettext/utils.rb, line 47</span>
|
|
966
973
|
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">msgmerge</span>(<span class="ruby-identifier">defpo</span>, <span class="ruby-identifier">refpo</span>, <span class="ruby-identifier">app_version</span>)
|
|
@@ -998,8 +1005,8 @@ href="GetText.html#M000020">GetText.update_pofiles</a> instead.
|
|
|
998
1005
|
</div>
|
|
999
1006
|
</div>
|
|
1000
1007
|
|
|
1001
|
-
<div id="method-
|
|
1002
|
-
<a name="
|
|
1008
|
+
<div id="method-M000107" class="method-detail">
|
|
1009
|
+
<a name="M000107"></a>
|
|
1003
1010
|
|
|
1004
1011
|
<div class="method-heading">
|
|
1005
1012
|
<span class="method-name">n_</span><span class="method-args">(arg1, arg2, arg3 = nil)</span>
|
|
@@ -1007,16 +1014,16 @@ href="GetText.html#M000020">GetText.update_pofiles</a> instead.
|
|
|
1007
1014
|
|
|
1008
1015
|
<div class="method-description">
|
|
1009
1016
|
<p>
|
|
1010
|
-
Alias for <a href="GetText.html#
|
|
1017
|
+
Alias for <a href="GetText.html#M000090">ngettext</a>
|
|
1011
1018
|
</p>
|
|
1012
1019
|
</div>
|
|
1013
1020
|
</div>
|
|
1014
1021
|
|
|
1015
|
-
<div id="method-
|
|
1016
|
-
<a name="
|
|
1022
|
+
<div id="method-M000090" class="method-detail">
|
|
1023
|
+
<a name="M000090"></a>
|
|
1017
1024
|
|
|
1018
1025
|
<div class="method-heading">
|
|
1019
|
-
<a href="#
|
|
1026
|
+
<a href="#M000090" class="method-signature">
|
|
1020
1027
|
<span class="method-name">ngettext(msgid, msgid_plural, n)<br />
|
|
1021
1028
|
ngettext(msgids, n) # msgids = [msgid, msgid_plural]<br />
|
|
1022
1029
|
n_(msgid, msgid_plural, n)<br />
|
|
@@ -1027,8 +1034,8 @@ n_(msgids, n) # msgids = [msgid, msgid_plural]<br />
|
|
|
1027
1034
|
|
|
1028
1035
|
<div class="method-description">
|
|
1029
1036
|
<p>
|
|
1030
|
-
The <a href="GetText.html#
|
|
1031
|
-
href="GetText.html#
|
|
1037
|
+
The <a href="GetText.html#M000090">ngettext</a> is similar to the <a
|
|
1038
|
+
href="GetText.html#M000087">gettext</a> function as it finds the message
|
|
1032
1039
|
catalogs in the same way. But it takes two extra arguments for plural form.
|
|
1033
1040
|
</p>
|
|
1034
1041
|
<ul>
|
|
@@ -1047,20 +1054,76 @@ plural-rule) or msgid. "plural-rule" is defined in po-file.
|
|
|
1047
1054
|
</li>
|
|
1048
1055
|
</ul>
|
|
1049
1056
|
<p><a class="source-toggle" href="#"
|
|
1050
|
-
onclick="toggleCode('
|
|
1051
|
-
<div class="method-source-code" id="
|
|
1057
|
+
onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
|
|
1058
|
+
<div class="method-source-code" id="M000090-source">
|
|
1059
|
+
<pre>
|
|
1060
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 340</span>
|
|
1061
|
+
340: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ngettext</span>(<span class="ruby-identifier">arg1</span>, <span class="ruby-identifier">arg2</span>, <span class="ruby-identifier">arg3</span> = <span class="ruby-keyword kw">nil</span>)
|
|
1062
|
+
341: <span class="ruby-identifier">nsgettext</span>(<span class="ruby-identifier">arg1</span>, <span class="ruby-identifier">arg2</span>, <span class="ruby-identifier">arg3</span>, <span class="ruby-keyword kw">nil</span>)
|
|
1063
|
+
342: <span class="ruby-keyword kw">end</span>
|
|
1064
|
+
</pre>
|
|
1065
|
+
</div>
|
|
1066
|
+
</div>
|
|
1067
|
+
</div>
|
|
1068
|
+
|
|
1069
|
+
<div id="method-M000091" class="method-detail">
|
|
1070
|
+
<a name="M000091"></a>
|
|
1071
|
+
|
|
1072
|
+
<div class="method-heading">
|
|
1073
|
+
<a href="#M000091" class="method-signature">
|
|
1074
|
+
<span class="method-name">npgettext(msgctxt, msgid, msgid_plural, n)<br />
|
|
1075
|
+
npgettext(msgctxt, msgids, n) # msgids = [msgid, msgid_plural]<br />
|
|
1076
|
+
np_(msgctxt, msgid, msgid_plural, n)<br />
|
|
1077
|
+
np_(msgctxt, msgids, n) # msgids = [msgid, msgid_plural]<br />
|
|
1078
|
+
</span>
|
|
1079
|
+
</a>
|
|
1080
|
+
</div>
|
|
1081
|
+
|
|
1082
|
+
<div class="method-description">
|
|
1083
|
+
<p>
|
|
1084
|
+
The <a href="GetText.html#M000091">npgettext</a> is similar to the <a
|
|
1085
|
+
href="GetText.html#M000094">nsgettext</a> function.
|
|
1086
|
+
</p>
|
|
1087
|
+
<pre>
|
|
1088
|
+
e.g.) np_("Special", "An apple", "%{num} Apples", num) == ns_("Special|An apple", "%{num} Apples", num)
|
|
1089
|
+
</pre>
|
|
1090
|
+
<ul>
|
|
1091
|
+
<li>msgctxt: the message context.
|
|
1092
|
+
|
|
1093
|
+
</li>
|
|
1094
|
+
<li>msgid: the singular form.
|
|
1095
|
+
|
|
1096
|
+
</li>
|
|
1097
|
+
<li>msgid_plural: the plural form.
|
|
1098
|
+
|
|
1099
|
+
</li>
|
|
1100
|
+
<li>n: a number used to determine the plural form.
|
|
1101
|
+
|
|
1102
|
+
</li>
|
|
1103
|
+
<li>Returns: the localized text which key is msgid_plural if n is plural(follow
|
|
1104
|
+
plural-rule) or msgid. "plural-rule" is defined in po-file.
|
|
1105
|
+
|
|
1106
|
+
</li>
|
|
1107
|
+
</ul>
|
|
1108
|
+
<p><a class="source-toggle" href="#"
|
|
1109
|
+
onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
|
|
1110
|
+
<div class="method-source-code" id="M000091-source">
|
|
1052
1111
|
<pre>
|
|
1053
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1112
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 358</span>
|
|
1113
|
+
358: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">npgettext</span>(<span class="ruby-identifier">msgctxt</span>, <span class="ruby-identifier">arg1</span>, <span class="ruby-identifier">arg2</span> = <span class="ruby-keyword kw">nil</span>)
|
|
1114
|
+
359: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg1</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>)
|
|
1115
|
+
360: <span class="ruby-identifier">nsgettext</span>(<span class="ruby-identifier">msgctxt</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"\004"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">arg1</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">arg1</span>[<span class="ruby-value">1</span>], <span class="ruby-identifier">arg2</span>, <span class="ruby-keyword kw">nil</span>)
|
|
1116
|
+
361: <span class="ruby-keyword kw">else</span>
|
|
1117
|
+
362: <span class="ruby-identifier">nsgettext</span>(<span class="ruby-identifier">msgctxt</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"\004"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">arg1</span>, <span class="ruby-identifier">arg2</span>, <span class="ruby-identifier">arg3</span>, <span class="ruby-keyword kw">nil</span>)
|
|
1118
|
+
363: <span class="ruby-keyword kw">end</span>
|
|
1119
|
+
364: <span class="ruby-keyword kw">end</span>
|
|
1057
1120
|
</pre>
|
|
1058
1121
|
</div>
|
|
1059
1122
|
</div>
|
|
1060
1123
|
</div>
|
|
1061
1124
|
|
|
1062
|
-
<div id="method-
|
|
1063
|
-
<a name="
|
|
1125
|
+
<div id="method-M000110" class="method-detail">
|
|
1126
|
+
<a name="M000110"></a>
|
|
1064
1127
|
|
|
1065
1128
|
<div class="method-heading">
|
|
1066
1129
|
<span class="method-name">ns_</span><span class="method-args">(arg1, arg2, arg3 = "|", arg4 = "|")</span>
|
|
@@ -1068,16 +1131,16 @@ plural-rule) or msgid. "plural-rule" is defined in po-file.
|
|
|
1068
1131
|
|
|
1069
1132
|
<div class="method-description">
|
|
1070
1133
|
<p>
|
|
1071
|
-
Alias for <a href="GetText.html#
|
|
1134
|
+
Alias for <a href="GetText.html#M000094">nsgettext</a>
|
|
1072
1135
|
</p>
|
|
1073
1136
|
</div>
|
|
1074
1137
|
</div>
|
|
1075
1138
|
|
|
1076
|
-
<div id="method-
|
|
1077
|
-
<a name="
|
|
1139
|
+
<div id="method-M000094" class="method-detail">
|
|
1140
|
+
<a name="M000094"></a>
|
|
1078
1141
|
|
|
1079
1142
|
<div class="method-heading">
|
|
1080
|
-
<a href="#
|
|
1143
|
+
<a href="#M000094" class="method-signature">
|
|
1081
1144
|
<span class="method-name">nsgettext(msgid, msgid_plural, n, div = "|")<br />
|
|
1082
1145
|
nsgettext(msgids, n, div = "|") # msgids = [msgid, msgid_plural]<br />
|
|
1083
1146
|
n_(msgid, msgid_plural, n, div = "|")<br />
|
|
@@ -1088,8 +1151,8 @@ n_(msgids, n, div = "|") # msgids = [msgid, msgid_plural]<br />
|
|
|
1088
1151
|
|
|
1089
1152
|
<div class="method-description">
|
|
1090
1153
|
<p>
|
|
1091
|
-
The <a href="GetText.html#
|
|
1092
|
-
href="GetText.html#
|
|
1154
|
+
The <a href="GetText.html#M000094">nsgettext</a> is similar to the <a
|
|
1155
|
+
href="GetText.html#M000090">ngettext</a>. But if there are no localized
|
|
1093
1156
|
text, it returns a last part of msgid separeted "div".
|
|
1094
1157
|
</p>
|
|
1095
1158
|
<ul>
|
|
@@ -1109,112 +1172,112 @@ plural-rule) or msgid. "plural-rule" is defined in po-file.
|
|
|
1109
1172
|
</li>
|
|
1110
1173
|
</ul>
|
|
1111
1174
|
<p><a class="source-toggle" href="#"
|
|
1112
|
-
onclick="toggleCode('
|
|
1113
|
-
<div class="method-source-code" id="
|
|
1175
|
+
onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
|
|
1176
|
+
<div class="method-source-code" id="M000094-source">
|
|
1114
1177
|
<pre>
|
|
1115
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1178
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 397</span>
|
|
1179
|
+
397: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nsgettext</span>(<span class="ruby-identifier">arg1</span>, <span class="ruby-identifier">arg2</span>, <span class="ruby-identifier">arg3</span> = <span class="ruby-value str">"|"</span>, <span class="ruby-identifier">arg4</span> = <span class="ruby-value str">"|"</span>)
|
|
1180
|
+
398: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg1</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>)
|
|
1181
|
+
399: <span class="ruby-identifier">msgid</span> = <span class="ruby-identifier">arg1</span>[<span class="ruby-value">0</span>]
|
|
1182
|
+
400: <span class="ruby-identifier">msgid_plural</span> = <span class="ruby-identifier">arg1</span>[<span class="ruby-value">1</span>]
|
|
1183
|
+
401: <span class="ruby-identifier">n</span> = <span class="ruby-identifier">arg2</span>
|
|
1184
|
+
402: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg3</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">arg3</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span>
|
|
1185
|
+
403: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-identifier">_</span>(<span class="ruby-value str">"3rd parmeter is wrong: value = %{number}"</span>) <span class="ruby-operator">%</span> {<span class="ruby-identifier">:number</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">arg3</span>}
|
|
1186
|
+
404: <span class="ruby-keyword kw">end</span>
|
|
1187
|
+
405: <span class="ruby-identifier">div</span> = <span class="ruby-identifier">arg3</span>
|
|
1188
|
+
406: <span class="ruby-keyword kw">else</span>
|
|
1189
|
+
407: <span class="ruby-identifier">msgid</span> = <span class="ruby-identifier">arg1</span>
|
|
1190
|
+
408: <span class="ruby-identifier">msgid_plural</span> = <span class="ruby-identifier">arg2</span>
|
|
1191
|
+
409: <span class="ruby-identifier">n</span> = <span class="ruby-identifier">arg3</span>
|
|
1192
|
+
410: <span class="ruby-identifier">div</span> = <span class="ruby-identifier">arg4</span>
|
|
1193
|
+
411: <span class="ruby-keyword kw">end</span>
|
|
1194
|
+
412:
|
|
1195
|
+
413: <span class="ruby-identifier">cached_key</span> = [<span class="ruby-identifier">bound_target</span>, <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">current</span>, <span class="ruby-identifier">msgid</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"\000"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msgid_plural</span>]
|
|
1196
|
+
414: <span class="ruby-identifier">msgs</span> = <span class="ruby-keyword kw">nil</span>
|
|
1197
|
+
415: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@__cached</span>
|
|
1198
|
+
416: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@__cache_nmsgids</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">cached_key</span>)
|
|
1199
|
+
417: <span class="ruby-identifier">msgs</span> = <span class="ruby-ivar">@@__cache_nmsgids</span>[<span class="ruby-identifier">cached_key</span>] <span class="ruby-comment cmt"># [msgstr, cond_as_string]</span>
|
|
1200
|
+
418: <span class="ruby-keyword kw">end</span>
|
|
1201
|
+
419: <span class="ruby-keyword kw">end</span>
|
|
1202
|
+
420: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">msgs</span>
|
|
1203
|
+
421: <span class="ruby-comment cmt"># Use "for"(not "each") to support JRuby 1.1.0.</span>
|
|
1204
|
+
422: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">target</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">bound_targets</span>(<span class="ruby-keyword kw">self</span>)
|
|
1205
|
+
423: <span class="ruby-identifier">manager</span> = <span class="ruby-ivar">@@__textdomainmanagers</span>[<span class="ruby-identifier">target</span>]
|
|
1206
|
+
424: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">textdomain</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">manager</span>.<span class="ruby-identifier">textdomains</span>
|
|
1207
|
+
425: <span class="ruby-identifier">msgs</span> = <span class="ruby-identifier">textdomain</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">ngettext_data</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">msgid_plural</span>)
|
|
1208
|
+
426: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msgs</span>
|
|
1209
|
+
427: <span class="ruby-keyword kw">end</span>
|
|
1210
|
+
428: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msgs</span>
|
|
1211
|
+
429: <span class="ruby-keyword kw">end</span>
|
|
1212
|
+
430: <span class="ruby-identifier">msgs</span> = [[<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">msgid_plural</span>], <span class="ruby-value str">"n != 1"</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">msgs</span>
|
|
1213
|
+
431: <span class="ruby-ivar">@@__cache_nmsgids</span>[<span class="ruby-identifier">cached_key</span>] = <span class="ruby-identifier">msgs</span>
|
|
1214
|
+
432: <span class="ruby-keyword kw">end</span>
|
|
1215
|
+
433: <span class="ruby-identifier">msgstrs</span> = <span class="ruby-identifier">msgs</span>[<span class="ruby-value">0</span>]
|
|
1216
|
+
434: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">div</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">msgstrs</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">msgid</span>
|
|
1217
|
+
435: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">index</span> = <span class="ruby-identifier">msgstrs</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">rindex</span>(<span class="ruby-identifier">div</span>)
|
|
1218
|
+
436: <span class="ruby-identifier">msgstrs</span>[<span class="ruby-value">0</span>] = <span class="ruby-identifier">msgstrs</span>[<span class="ruby-value">0</span>][(<span class="ruby-identifier">index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
1219
|
+
437: <span class="ruby-keyword kw">end</span>
|
|
1220
|
+
438: <span class="ruby-keyword kw">end</span>
|
|
1221
|
+
439: <span class="ruby-identifier">plural</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">msgs</span>[<span class="ruby-value">1</span>])
|
|
1222
|
+
440: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">plural</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Numeric</span>)
|
|
1223
|
+
441: <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">msgstrs</span>[<span class="ruby-identifier">plural</span>]
|
|
1224
|
+
442: <span class="ruby-keyword kw">else</span>
|
|
1225
|
+
443: <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">plural</span> <span class="ruby-value">? </span><span class="ruby-identifier">msgstrs</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">msgstrs</span>[<span class="ruby-value">0</span>]
|
|
1226
|
+
444: <span class="ruby-keyword kw">end</span>
|
|
1227
|
+
445: <span class="ruby-identifier">ret</span>
|
|
1228
|
+
446: <span class="ruby-keyword kw">end</span>
|
|
1166
1229
|
</pre>
|
|
1167
1230
|
</div>
|
|
1168
1231
|
</div>
|
|
1169
1232
|
</div>
|
|
1170
1233
|
|
|
1171
|
-
<div id="method-
|
|
1172
|
-
<a name="
|
|
1234
|
+
<div id="method-M000100" class="method-detail">
|
|
1235
|
+
<a name="M000100"></a>
|
|
1173
1236
|
|
|
1174
1237
|
<div class="method-heading">
|
|
1175
|
-
<a href="#
|
|
1238
|
+
<a href="#M000100" class="method-signature">
|
|
1176
1239
|
<span class="method-name">output_charset</span><span class="method-args">()</span>
|
|
1177
1240
|
</a>
|
|
1178
1241
|
</div>
|
|
1179
1242
|
|
|
1180
1243
|
<div class="method-description">
|
|
1181
1244
|
<p>
|
|
1182
|
-
Gets the current <a href="GetText.html#
|
|
1183
|
-
set using <a href="GetText.html#
|
|
1245
|
+
Gets the current <a href="GetText.html#M000100">output_charset</a> which is
|
|
1246
|
+
set using <a href="GetText.html#M000098">GetText.set_output_charset</a>.
|
|
1184
1247
|
</p>
|
|
1185
1248
|
<ul>
|
|
1186
|
-
<li>Returns: <a href="GetText.html#
|
|
1249
|
+
<li>Returns: <a href="GetText.html#M000100">output_charset</a>.
|
|
1187
1250
|
|
|
1188
1251
|
</li>
|
|
1189
1252
|
</ul>
|
|
1190
1253
|
<p><a class="source-toggle" href="#"
|
|
1191
|
-
onclick="toggleCode('
|
|
1192
|
-
<div class="method-source-code" id="
|
|
1254
|
+
onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
|
|
1255
|
+
<div class="method-source-code" id="M000100-source">
|
|
1193
1256
|
<pre>
|
|
1194
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1257
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 537</span>
|
|
1258
|
+
537: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output_charset</span>
|
|
1259
|
+
538: <span class="ruby-constant">TextDomainManager</span>.<span class="ruby-identifier">output_charset</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">locale</span>.<span class="ruby-identifier">charset</span>
|
|
1260
|
+
539: <span class="ruby-keyword kw">end</span>
|
|
1198
1261
|
</pre>
|
|
1199
1262
|
</div>
|
|
1200
1263
|
</div>
|
|
1201
1264
|
</div>
|
|
1202
1265
|
|
|
1203
|
-
<div id="method-
|
|
1204
|
-
<a name="
|
|
1266
|
+
<div id="method-M000099" class="method-detail">
|
|
1267
|
+
<a name="M000099"></a>
|
|
1205
1268
|
|
|
1206
1269
|
<div class="method-heading">
|
|
1207
|
-
<a href="#
|
|
1270
|
+
<a href="#M000099" class="method-signature">
|
|
1208
1271
|
<span class="method-name">output_charset=</span><span class="method-args">(charset)</span>
|
|
1209
1272
|
</a>
|
|
1210
1273
|
</div>
|
|
1211
1274
|
|
|
1212
1275
|
<div class="method-description">
|
|
1213
1276
|
<p>
|
|
1214
|
-
Same as <a href="GetText.html#
|
|
1277
|
+
Same as <a href="GetText.html#M000098">GetText.set_output_charset</a>
|
|
1215
1278
|
</p>
|
|
1216
1279
|
<ul>
|
|
1217
|
-
<li>charset: an <a href="GetText.html#
|
|
1280
|
+
<li>charset: an <a href="GetText.html#M000100">output_charset</a>
|
|
1218
1281
|
|
|
1219
1282
|
</li>
|
|
1220
1283
|
<li>Returns: charset
|
|
@@ -1222,23 +1285,86 @@ Same as <a href="GetText.html#M000043">GetText.set_output_charset</a>
|
|
|
1222
1285
|
</li>
|
|
1223
1286
|
</ul>
|
|
1224
1287
|
<p><a class="source-toggle" href="#"
|
|
1225
|
-
onclick="toggleCode('
|
|
1226
|
-
<div class="method-source-code" id="
|
|
1288
|
+
onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
|
|
1289
|
+
<div class="method-source-code" id="M000099-source">
|
|
1290
|
+
<pre>
|
|
1291
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 531</span>
|
|
1292
|
+
531: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output_charset=</span>(<span class="ruby-identifier">charset</span>)
|
|
1293
|
+
532: <span class="ruby-constant">TextDomainManager</span>.<span class="ruby-identifier">output_charset</span> = <span class="ruby-identifier">charset</span>
|
|
1294
|
+
533: <span class="ruby-keyword kw">end</span>
|
|
1295
|
+
</pre>
|
|
1296
|
+
</div>
|
|
1297
|
+
</div>
|
|
1298
|
+
</div>
|
|
1299
|
+
|
|
1300
|
+
<div id="method-M000109" class="method-detail">
|
|
1301
|
+
<a name="M000109"></a>
|
|
1302
|
+
|
|
1303
|
+
<div class="method-heading">
|
|
1304
|
+
<span class="method-name">p_</span><span class="method-args">(msgctxt, msgid)</span>
|
|
1305
|
+
</div>
|
|
1306
|
+
|
|
1307
|
+
<div class="method-description">
|
|
1308
|
+
<p>
|
|
1309
|
+
Alias for <a href="GetText.html#M000089">pgettext</a>
|
|
1310
|
+
</p>
|
|
1311
|
+
</div>
|
|
1312
|
+
</div>
|
|
1313
|
+
|
|
1314
|
+
<div id="method-M000089" class="method-detail">
|
|
1315
|
+
<a name="M000089"></a>
|
|
1316
|
+
|
|
1317
|
+
<div class="method-heading">
|
|
1318
|
+
<a href="#M000089" class="method-signature">
|
|
1319
|
+
<span class="method-name">pgettext(msgctxt, msgid)<br />
|
|
1320
|
+
p_(msgctxt, msgid)<br />
|
|
1321
|
+
</span>
|
|
1322
|
+
</a>
|
|
1323
|
+
</div>
|
|
1324
|
+
|
|
1325
|
+
<div class="method-description">
|
|
1326
|
+
<p>
|
|
1327
|
+
Translates msgid with msgctxt. This methods is similer with <a
|
|
1328
|
+
href="GetText.html#M000108">s_</a>().
|
|
1329
|
+
</p>
|
|
1330
|
+
<pre>
|
|
1331
|
+
e.g.) p_("File", "New") == s_("File|New")
|
|
1332
|
+
p_("File", "Open") == s_("File|Open")
|
|
1333
|
+
</pre>
|
|
1334
|
+
<ul>
|
|
1335
|
+
<li>msgctxt: the message context.
|
|
1336
|
+
|
|
1337
|
+
</li>
|
|
1338
|
+
<li>msgid: the message id.
|
|
1339
|
+
|
|
1340
|
+
</li>
|
|
1341
|
+
<li>Returns: the localized text by msgid. If there are no localized text, it
|
|
1342
|
+
returns msgid.
|
|
1343
|
+
|
|
1344
|
+
</li>
|
|
1345
|
+
</ul>
|
|
1346
|
+
<p>
|
|
1347
|
+
See: <a
|
|
1348
|
+
href="http://www.gnu.org/software/autoconf/manual/gettext/Contexts.html">www.gnu.org/software/autoconf/manual/gettext/Contexts.html</a>
|
|
1349
|
+
</p>
|
|
1350
|
+
<p><a class="source-toggle" href="#"
|
|
1351
|
+
onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
|
|
1352
|
+
<div class="method-source-code" id="M000089-source">
|
|
1227
1353
|
<pre>
|
|
1228
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1354
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 320</span>
|
|
1355
|
+
320: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pgettext</span>(<span class="ruby-identifier">msgctxt</span>, <span class="ruby-identifier">msgid</span>)
|
|
1356
|
+
321: <span class="ruby-identifier">sgettext</span>(<span class="ruby-identifier">msgctxt</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"\004"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msgid</span>, <span class="ruby-value str">"\004"</span>)
|
|
1357
|
+
322: <span class="ruby-keyword kw">end</span>
|
|
1232
1358
|
</pre>
|
|
1233
1359
|
</div>
|
|
1234
1360
|
</div>
|
|
1235
1361
|
</div>
|
|
1236
1362
|
|
|
1237
|
-
<div id="method-
|
|
1238
|
-
<a name="
|
|
1363
|
+
<div id="method-M000104" class="method-detail">
|
|
1364
|
+
<a name="M000104"></a>
|
|
1239
1365
|
|
|
1240
1366
|
<div class="method-heading">
|
|
1241
|
-
<a href="#
|
|
1367
|
+
<a href="#M000104" class="method-signature">
|
|
1242
1368
|
<span class="method-name">remove_all_textdomains</span><span class="method-args">()</span>
|
|
1243
1369
|
</a>
|
|
1244
1370
|
</div>
|
|
@@ -1248,24 +1374,24 @@ Same as <a href="GetText.html#M000043">GetText.set_output_charset</a>
|
|
|
1248
1374
|
for testing.
|
|
1249
1375
|
</p>
|
|
1250
1376
|
<p><a class="source-toggle" href="#"
|
|
1251
|
-
onclick="toggleCode('
|
|
1252
|
-
<div class="method-source-code" id="
|
|
1377
|
+
onclick="toggleCode('M000104-source');return false;">[Source]</a></p>
|
|
1378
|
+
<div class="method-source-code" id="M000104-source">
|
|
1253
1379
|
<pre>
|
|
1254
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1380
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 583</span>
|
|
1381
|
+
583: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_all_textdomains</span>
|
|
1382
|
+
584: <span class="ruby-identifier">clear_cache</span>
|
|
1383
|
+
585: <span class="ruby-ivar">@@__textdomainmanagers</span> = {}
|
|
1384
|
+
586: <span class="ruby-keyword kw">end</span>
|
|
1259
1385
|
</pre>
|
|
1260
1386
|
</div>
|
|
1261
1387
|
</div>
|
|
1262
1388
|
</div>
|
|
1263
1389
|
|
|
1264
|
-
<div id="method-
|
|
1265
|
-
<a name="
|
|
1390
|
+
<div id="method-M000074" class="method-detail">
|
|
1391
|
+
<a name="M000074"></a>
|
|
1266
1392
|
|
|
1267
1393
|
<div class="method-heading">
|
|
1268
|
-
<a href="#
|
|
1394
|
+
<a href="#M000074" class="method-signature">
|
|
1269
1395
|
<span class="method-name">rgettext</span><span class="method-args">(targetfiles = nil, out = STDOUT)</span>
|
|
1270
1396
|
</a>
|
|
1271
1397
|
</div>
|
|
@@ -1296,24 +1422,24 @@ configure the config/database.xml correctly before execute this function.
|
|
|
1296
1422
|
</li>
|
|
1297
1423
|
</ul>
|
|
1298
1424
|
<p><a class="source-toggle" href="#"
|
|
1299
|
-
onclick="toggleCode('
|
|
1300
|
-
<div class="method-source-code" id="
|
|
1425
|
+
onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
|
|
1426
|
+
<div class="method-source-code" id="M000074-source">
|
|
1301
1427
|
<pre>
|
|
1302
|
-
<span class="ruby-comment cmt"># File lib/gettext/rgettext.rb, line
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1428
|
+
<span class="ruby-comment cmt"># File lib/gettext/rgettext.rb, line 264</span>
|
|
1429
|
+
264: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rgettext</span>(<span class="ruby-identifier">targetfiles</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">out</span> = <span class="ruby-constant">STDOUT</span>)
|
|
1430
|
+
265: <span class="ruby-constant">RGetText</span>.<span class="ruby-identifier">run</span>(<span class="ruby-identifier">targetfiles</span>, <span class="ruby-identifier">out</span>)
|
|
1431
|
+
266: <span class="ruby-keyword kw">self</span>
|
|
1432
|
+
267: <span class="ruby-keyword kw">end</span>
|
|
1307
1433
|
</pre>
|
|
1308
1434
|
</div>
|
|
1309
1435
|
</div>
|
|
1310
1436
|
</div>
|
|
1311
1437
|
|
|
1312
|
-
<div id="method-
|
|
1313
|
-
<a name="
|
|
1438
|
+
<div id="method-M000075" class="method-detail">
|
|
1439
|
+
<a name="M000075"></a>
|
|
1314
1440
|
|
|
1315
1441
|
<div class="method-heading">
|
|
1316
|
-
<a href="#
|
|
1442
|
+
<a href="#M000075" class="method-signature">
|
|
1317
1443
|
<span class="method-name">rmsgfmt</span><span class="method-args">(targetfile = nil, output_path = nil)</span>
|
|
1318
1444
|
</a>
|
|
1319
1445
|
</div>
|
|
@@ -1322,7 +1448,7 @@ configure the config/database.xml correctly before execute this function.
|
|
|
1322
1448
|
<p>
|
|
1323
1449
|
Creates a mo-file from a targetfile(po-file), then output the result to
|
|
1324
1450
|
out. If no parameter is set, it behaves same as command line tools(<a
|
|
1325
|
-
href="GetText.html#
|
|
1451
|
+
href="GetText.html#M000075">rmsgfmt</a>).
|
|
1326
1452
|
</p>
|
|
1327
1453
|
<ul>
|
|
1328
1454
|
<li>targetfile: An Array of po-files or nil.
|
|
@@ -1336,8 +1462,8 @@ href="GetText.html#M000022">rmsgfmt</a>).
|
|
|
1336
1462
|
</li>
|
|
1337
1463
|
</ul>
|
|
1338
1464
|
<p><a class="source-toggle" href="#"
|
|
1339
|
-
onclick="toggleCode('
|
|
1340
|
-
<div class="method-source-code" id="
|
|
1465
|
+
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
|
|
1466
|
+
<div class="method-source-code" id="M000075-source">
|
|
1341
1467
|
<pre>
|
|
1342
1468
|
<span class="ruby-comment cmt"># File lib/gettext/rmsgfmt.rb, line 79</span>
|
|
1343
1469
|
79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rmsgfmt</span>(<span class="ruby-identifier">targetfile</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">output_path</span> = <span class="ruby-keyword kw">nil</span>)
|
|
@@ -1348,11 +1474,11 @@ href="GetText.html#M000022">rmsgfmt</a>).
|
|
|
1348
1474
|
</div>
|
|
1349
1475
|
</div>
|
|
1350
1476
|
|
|
1351
|
-
<div id="method-
|
|
1352
|
-
<a name="
|
|
1477
|
+
<div id="method-M000079" class="method-detail">
|
|
1478
|
+
<a name="M000079"></a>
|
|
1353
1479
|
|
|
1354
1480
|
<div class="method-heading">
|
|
1355
|
-
<a href="#
|
|
1481
|
+
<a href="#M000079" class="method-signature">
|
|
1356
1482
|
<span class="method-name">rmsgmerge</span><span class="method-args">(reference = nil, definition = nil, out = STDOUT)</span>
|
|
1357
1483
|
</a>
|
|
1358
1484
|
</div>
|
|
@@ -1362,8 +1488,8 @@ href="GetText.html#M000022">rmsgfmt</a>).
|
|
|
1362
1488
|
Experimental
|
|
1363
1489
|
</p>
|
|
1364
1490
|
<p><a class="source-toggle" href="#"
|
|
1365
|
-
onclick="toggleCode('
|
|
1366
|
-
<div class="method-source-code" id="
|
|
1491
|
+
onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
|
|
1492
|
+
<div class="method-source-code" id="M000079-source">
|
|
1367
1493
|
<pre>
|
|
1368
1494
|
<span class="ruby-comment cmt"># File lib/gettext/rmsgmerge.rb, line 489</span>
|
|
1369
1495
|
489: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rmsgmerge</span>(<span class="ruby-identifier">reference</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">definition</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">out</span> = <span class="ruby-constant">STDOUT</span>)
|
|
@@ -1374,8 +1500,8 @@ Experimental
|
|
|
1374
1500
|
</div>
|
|
1375
1501
|
</div>
|
|
1376
1502
|
|
|
1377
|
-
<div id="method-
|
|
1378
|
-
<a name="
|
|
1503
|
+
<div id="method-M000108" class="method-detail">
|
|
1504
|
+
<a name="M000108"></a>
|
|
1379
1505
|
|
|
1380
1506
|
<div class="method-heading">
|
|
1381
1507
|
<span class="method-name">s_</span><span class="method-args">(msgid, div = '|')</span>
|
|
@@ -1383,16 +1509,16 @@ Experimental
|
|
|
1383
1509
|
|
|
1384
1510
|
<div class="method-description">
|
|
1385
1511
|
<p>
|
|
1386
|
-
Alias for <a href="GetText.html#
|
|
1512
|
+
Alias for <a href="GetText.html#M000088">sgettext</a>
|
|
1387
1513
|
</p>
|
|
1388
1514
|
</div>
|
|
1389
1515
|
</div>
|
|
1390
1516
|
|
|
1391
|
-
<div id="method-
|
|
1392
|
-
<a name="
|
|
1517
|
+
<div id="method-M000076" class="method-detail">
|
|
1518
|
+
<a name="M000076"></a>
|
|
1393
1519
|
|
|
1394
1520
|
<div class="method-heading">
|
|
1395
|
-
<a href="#
|
|
1521
|
+
<a href="#M000076" class="method-signature">
|
|
1396
1522
|
<span class="method-name">set_cgi</span><span class="method-args">(cgi_)</span>
|
|
1397
1523
|
</a>
|
|
1398
1524
|
</div>
|
|
@@ -1410,8 +1536,8 @@ Sets a CGI object.
|
|
|
1410
1536
|
</li>
|
|
1411
1537
|
</ul>
|
|
1412
1538
|
<p><a class="source-toggle" href="#"
|
|
1413
|
-
onclick="toggleCode('
|
|
1414
|
-
<div class="method-source-code" id="
|
|
1539
|
+
onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
|
|
1540
|
+
<div class="method-source-code" id="M000076-source">
|
|
1415
1541
|
<pre>
|
|
1416
1542
|
<span class="ruby-comment cmt"># File lib/gettext/cgi.rb, line 22</span>
|
|
1417
1543
|
22: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_cgi</span>(<span class="ruby-identifier">cgi_</span>)
|
|
@@ -1422,26 +1548,26 @@ Sets a CGI object.
|
|
|
1422
1548
|
</div>
|
|
1423
1549
|
</div>
|
|
1424
1550
|
|
|
1425
|
-
<div id="method-
|
|
1426
|
-
<a name="
|
|
1551
|
+
<div id="method-M000095" class="method-detail">
|
|
1552
|
+
<a name="M000095"></a>
|
|
1427
1553
|
|
|
1428
1554
|
<div class="method-heading">
|
|
1429
|
-
<a href="#
|
|
1555
|
+
<a href="#M000095" class="method-signature">
|
|
1430
1556
|
<span class="method-name">set_locale</span><span class="method-args">(locale, this_target_only = false)</span>
|
|
1431
1557
|
</a>
|
|
1432
1558
|
</div>
|
|
1433
1559
|
|
|
1434
1560
|
<div class="method-description">
|
|
1435
1561
|
<p>
|
|
1436
|
-
Sets the current <a href="GetText.html#
|
|
1562
|
+
Sets the current <a href="GetText.html#M000101">locale</a> to the current
|
|
1437
1563
|
class/module
|
|
1438
1564
|
</p>
|
|
1439
1565
|
<p>
|
|
1440
1566
|
Notice that you shouldn‘t use this for your own Libraries.
|
|
1441
1567
|
</p>
|
|
1442
1568
|
<ul>
|
|
1443
|
-
<li><a href="GetText.html#
|
|
1444
|
-
href="GetText.html#
|
|
1569
|
+
<li><a href="GetText.html#M000101">locale</a>: a <a
|
|
1570
|
+
href="GetText.html#M000101">locale</a> string or <a
|
|
1445
1571
|
href="Locale/Object.html">Locale::Object</a>.
|
|
1446
1572
|
|
|
1447
1573
|
</li>
|
|
@@ -1450,7 +1576,7 @@ href="Locale/Object.html">Locale::Object</a>.
|
|
|
1450
1576
|
</li>
|
|
1451
1577
|
</ul>
|
|
1452
1578
|
<p>
|
|
1453
|
-
Otherwise, this changes the <a href="GetText.html#
|
|
1579
|
+
Otherwise, this changes the <a href="GetText.html#M000101">locale</a> of
|
|
1454
1580
|
the current class/module and its ancestors. Default is false.
|
|
1455
1581
|
</p>
|
|
1456
1582
|
<ul>
|
|
@@ -1459,63 +1585,63 @@ the current class/module and its ancestors. Default is false.
|
|
|
1459
1585
|
</li>
|
|
1460
1586
|
</ul>
|
|
1461
1587
|
<p><a class="source-toggle" href="#"
|
|
1462
|
-
onclick="toggleCode('
|
|
1463
|
-
<div class="method-source-code" id="
|
|
1588
|
+
onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
|
|
1589
|
+
<div class="method-source-code" id="M000095-source">
|
|
1464
1590
|
<pre>
|
|
1465
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1591
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 456</span>
|
|
1592
|
+
456: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_locale</span>(<span class="ruby-identifier">locale</span>, <span class="ruby-identifier">this_target_only</span> = <span class="ruby-keyword kw">false</span>)
|
|
1593
|
+
457: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">nil</span>
|
|
1594
|
+
458: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">locale</span>
|
|
1595
|
+
459: <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>
|
|
1596
|
+
460: <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">locale</span>
|
|
1597
|
+
461: <span class="ruby-keyword kw">else</span>
|
|
1598
|
+
462: <span class="ruby-identifier">ret</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>.<span class="ruby-identifier">to_s</span>)
|
|
1599
|
+
463: <span class="ruby-keyword kw">end</span>
|
|
1600
|
+
464: <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">charset</span> = <span class="ruby-constant">TextDomainManager</span>.<span class="ruby-identifier">output_charset</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">TextDomainManager</span>.<span class="ruby-identifier">output_charset</span>
|
|
1601
|
+
465: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">ret</span>)
|
|
1602
|
+
466: <span class="ruby-keyword kw">else</span>
|
|
1603
|
+
467: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">set</span>(<span class="ruby-keyword kw">nil</span>)
|
|
1604
|
+
468: <span class="ruby-identifier">ret</span> = <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">get</span>
|
|
1605
|
+
469: <span class="ruby-keyword kw">end</span>
|
|
1606
|
+
470: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">this_target_only</span>
|
|
1607
|
+
471: <span class="ruby-identifier">manager</span> = <span class="ruby-ivar">@@__textdomainmanagers</span>[<span class="ruby-identifier">bound_target</span>]
|
|
1608
|
+
472: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">manager</span>
|
|
1609
|
+
473: <span class="ruby-identifier">manager</span>.<span class="ruby-identifier">set_locale</span>(<span class="ruby-identifier">ret</span>, <span class="ruby-operator">!</span> <span class="ruby-identifier">cached?</span>)
|
|
1610
|
+
474: <span class="ruby-keyword kw">end</span>
|
|
1611
|
+
475: <span class="ruby-keyword kw">else</span>
|
|
1612
|
+
476: <span class="ruby-identifier">each_textdomain</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">textdomain</span><span class="ruby-operator">|</span>
|
|
1613
|
+
477: <span class="ruby-identifier">textdomain</span>.<span class="ruby-identifier">set_locale</span>(<span class="ruby-identifier">ret</span>, <span class="ruby-operator">!</span> <span class="ruby-identifier">cached?</span>)
|
|
1614
|
+
478: }
|
|
1615
|
+
479: <span class="ruby-keyword kw">end</span>
|
|
1616
|
+
480: <span class="ruby-keyword kw">self</span>
|
|
1617
|
+
481: <span class="ruby-keyword kw">end</span>
|
|
1492
1618
|
</pre>
|
|
1493
1619
|
</div>
|
|
1494
1620
|
</div>
|
|
1495
1621
|
</div>
|
|
1496
1622
|
|
|
1497
|
-
<div id="method-
|
|
1498
|
-
<a name="
|
|
1623
|
+
<div id="method-M000096" class="method-detail">
|
|
1624
|
+
<a name="M000096"></a>
|
|
1499
1625
|
|
|
1500
1626
|
<div class="method-heading">
|
|
1501
|
-
<a href="#
|
|
1627
|
+
<a href="#M000096" class="method-signature">
|
|
1502
1628
|
<span class="method-name">set_locale_all</span><span class="method-args">(locale)</span>
|
|
1503
1629
|
</a>
|
|
1504
1630
|
</div>
|
|
1505
1631
|
|
|
1506
1632
|
<div class="method-description">
|
|
1507
1633
|
<p>
|
|
1508
|
-
Sets current <a href="GetText.html#
|
|
1634
|
+
Sets current <a href="GetText.html#M000101">locale</a> to the all
|
|
1509
1635
|
textdomains.
|
|
1510
1636
|
</p>
|
|
1511
1637
|
<p>
|
|
1512
1638
|
Note that you shouldn‘t use this for your own Libraries.
|
|
1513
1639
|
</p>
|
|
1514
1640
|
<ul>
|
|
1515
|
-
<li><a href="GetText.html#
|
|
1516
|
-
href="GetText.html#
|
|
1641
|
+
<li><a href="GetText.html#M000101">locale</a>: a <a
|
|
1642
|
+
href="GetText.html#M000101">locale</a> string or <a
|
|
1517
1643
|
href="Locale/Object.html">Locale::Object</a>, otherwise nil to use default
|
|
1518
|
-
<a href="GetText.html#
|
|
1644
|
+
<a href="GetText.html#M000101">locale</a>.
|
|
1519
1645
|
|
|
1520
1646
|
</li>
|
|
1521
1647
|
<li>Returns: self
|
|
@@ -1523,38 +1649,38 @@ href="Locale/Object.html">Locale::Object</a>, otherwise nil to use default
|
|
|
1523
1649
|
</li>
|
|
1524
1650
|
</ul>
|
|
1525
1651
|
<p><a class="source-toggle" href="#"
|
|
1526
|
-
onclick="toggleCode('
|
|
1527
|
-
<div class="method-source-code" id="
|
|
1652
|
+
onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
|
|
1653
|
+
<div class="method-source-code" id="M000096-source">
|
|
1528
1654
|
<pre>
|
|
1529
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1655
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 488</span>
|
|
1656
|
+
488: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_locale_all</span>(<span class="ruby-identifier">locale</span>)
|
|
1657
|
+
489: <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">nil</span>
|
|
1658
|
+
490: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">locale</span>
|
|
1659
|
+
491: <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>
|
|
1660
|
+
492: <span class="ruby-identifier">ret</span> = <span class="ruby-identifier">locale</span>
|
|
1661
|
+
493: <span class="ruby-keyword kw">else</span>
|
|
1662
|
+
494: <span class="ruby-identifier">ret</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>.<span class="ruby-identifier">to_s</span>)
|
|
1663
|
+
495: <span class="ruby-keyword kw">end</span>
|
|
1664
|
+
496: <span class="ruby-keyword kw">else</span>
|
|
1665
|
+
497: <span class="ruby-identifier">ret</span> = <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">default</span>
|
|
1666
|
+
498: <span class="ruby-keyword kw">end</span>
|
|
1667
|
+
499: <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">charset</span> = <span class="ruby-constant">TextDomainManager</span>.<span class="ruby-identifier">output_charset</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">TextDomainManager</span>.<span class="ruby-identifier">output_charset</span>
|
|
1668
|
+
500: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">set_current</span>(<span class="ruby-identifier">ret</span>)
|
|
1669
|
+
501: <span class="ruby-constant">TextDomainManager</span>.<span class="ruby-identifier">each_all</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">textdomain</span><span class="ruby-operator">|</span>
|
|
1670
|
+
502: <span class="ruby-identifier">textdomain</span>.<span class="ruby-identifier">set_locale</span>(<span class="ruby-identifier">ret</span>, <span class="ruby-operator">!</span> <span class="ruby-identifier">cached?</span>)
|
|
1671
|
+
503: }
|
|
1672
|
+
504: <span class="ruby-keyword kw">self</span>
|
|
1673
|
+
505: <span class="ruby-keyword kw">end</span>
|
|
1548
1674
|
</pre>
|
|
1549
1675
|
</div>
|
|
1550
1676
|
</div>
|
|
1551
1677
|
</div>
|
|
1552
1678
|
|
|
1553
|
-
<div id="method-
|
|
1554
|
-
<a name="
|
|
1679
|
+
<div id="method-M000098" class="method-detail">
|
|
1680
|
+
<a name="M000098"></a>
|
|
1555
1681
|
|
|
1556
1682
|
<div class="method-heading">
|
|
1557
|
-
<a href="#
|
|
1683
|
+
<a href="#M000098" class="method-signature">
|
|
1558
1684
|
<span class="method-name">set_output_charset</span><span class="method-args">(charset)</span>
|
|
1559
1685
|
</a>
|
|
1560
1686
|
</div>
|
|
@@ -1566,7 +1692,7 @@ Sets charset(<a href="String.html">String</a>) such as "euc-jp",
|
|
|
1566
1692
|
shouldn‘t use this in your own Libraries.
|
|
1567
1693
|
</p>
|
|
1568
1694
|
<ul>
|
|
1569
|
-
<li>charset: an <a href="GetText.html#
|
|
1695
|
+
<li>charset: an <a href="GetText.html#M000100">output_charset</a>
|
|
1570
1696
|
|
|
1571
1697
|
</li>
|
|
1572
1698
|
<li>Returns: charset
|
|
@@ -1574,21 +1700,21 @@ shouldn‘t use this in your own Libraries.
|
|
|
1574
1700
|
</li>
|
|
1575
1701
|
</ul>
|
|
1576
1702
|
<p><a class="source-toggle" href="#"
|
|
1577
|
-
onclick="toggleCode('
|
|
1578
|
-
<div class="method-source-code" id="
|
|
1703
|
+
onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
|
|
1704
|
+
<div class="method-source-code" id="M000098-source">
|
|
1579
1705
|
<pre>
|
|
1580
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1706
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 523</span>
|
|
1707
|
+
523: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_output_charset</span>(<span class="ruby-identifier">charset</span>)
|
|
1708
|
+
524: <span class="ruby-constant">TextDomainManager</span>.<span class="ruby-identifier">output_charset</span> = <span class="ruby-identifier">charset</span>
|
|
1709
|
+
525: <span class="ruby-keyword kw">self</span>
|
|
1710
|
+
526: <span class="ruby-keyword kw">end</span>
|
|
1585
1711
|
</pre>
|
|
1586
1712
|
</div>
|
|
1587
1713
|
</div>
|
|
1588
1714
|
</div>
|
|
1589
1715
|
|
|
1590
|
-
<div id="method-
|
|
1591
|
-
<a name="
|
|
1716
|
+
<div id="method-M000105" class="method-detail">
|
|
1717
|
+
<a name="M000105"></a>
|
|
1592
1718
|
|
|
1593
1719
|
<div class="method-heading">
|
|
1594
1720
|
<span class="method-name">setlocale</span><span class="method-args">(locale)</span>
|
|
@@ -1596,16 +1722,16 @@ shouldn‘t use this in your own Libraries.
|
|
|
1596
1722
|
|
|
1597
1723
|
<div class="method-description">
|
|
1598
1724
|
<p>
|
|
1599
|
-
Alias for <a href="GetText.html#
|
|
1725
|
+
Alias for <a href="GetText.html#M000101">locale</a>=
|
|
1600
1726
|
</p>
|
|
1601
1727
|
</div>
|
|
1602
1728
|
</div>
|
|
1603
1729
|
|
|
1604
|
-
<div id="method-
|
|
1605
|
-
<a name="
|
|
1730
|
+
<div id="method-M000088" class="method-detail">
|
|
1731
|
+
<a name="M000088"></a>
|
|
1606
1732
|
|
|
1607
1733
|
<div class="method-heading">
|
|
1608
|
-
<a href="#
|
|
1734
|
+
<a href="#M000088" class="method-signature">
|
|
1609
1735
|
<span class="method-name">sgettext(msgid, div = '|')<br />
|
|
1610
1736
|
s_(msgid, div = '|')<br />
|
|
1611
1737
|
</span>
|
|
@@ -1634,63 +1760,63 @@ See: <a
|
|
|
1634
1760
|
href="http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC151">www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC151</a>
|
|
1635
1761
|
</p>
|
|
1636
1762
|
<p><a class="source-toggle" href="#"
|
|
1637
|
-
onclick="toggleCode('
|
|
1638
|
-
<div class="method-source-code" id="
|
|
1763
|
+
onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
|
|
1764
|
+
<div class="method-source-code" id="M000088-source">
|
|
1639
1765
|
<pre>
|
|
1640
|
-
<span class="ruby-comment cmt"># File lib/gettext.rb, line
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1766
|
+
<span class="ruby-comment cmt"># File lib/gettext.rb, line 279</span>
|
|
1767
|
+
279: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sgettext</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">div</span> = <span class="ruby-value str">'|'</span>)
|
|
1768
|
+
280: <span class="ruby-identifier">cached_key</span> = [<span class="ruby-identifier">bound_target</span>, <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">current</span>, <span class="ruby-identifier">msgid</span>]
|
|
1769
|
+
281: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cached?</span>
|
|
1770
|
+
282: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@__cache_msgids</span>[<span class="ruby-identifier">cached_key</span>]
|
|
1771
|
+
283: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@@__cache_msgids</span>[<span class="ruby-identifier">cached_key</span>]
|
|
1772
|
+
284: <span class="ruby-keyword kw">end</span>
|
|
1773
|
+
285: <span class="ruby-keyword kw">end</span>
|
|
1774
|
+
286: <span class="ruby-identifier">msg</span> = <span class="ruby-keyword kw">nil</span>
|
|
1775
|
+
287:
|
|
1776
|
+
288: <span class="ruby-comment cmt"># Use "for"(not "each") to support JRuby 1.1.0.</span>
|
|
1777
|
+
289: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">target</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">bound_targets</span>(<span class="ruby-keyword kw">self</span>)
|
|
1778
|
+
290: <span class="ruby-identifier">manager</span> = <span class="ruby-ivar">@@__textdomainmanagers</span>[<span class="ruby-identifier">target</span>]
|
|
1779
|
+
291: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">textdomain</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">manager</span>.<span class="ruby-identifier">textdomains</span>
|
|
1780
|
+
292: <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">textdomain</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">gettext</span>(<span class="ruby-identifier">msgid</span>)
|
|
1781
|
+
293: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg</span>
|
|
1782
|
+
294: <span class="ruby-keyword kw">end</span>
|
|
1783
|
+
295: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg</span>
|
|
1784
|
+
296: <span class="ruby-keyword kw">end</span>
|
|
1785
|
+
297:
|
|
1786
|
+
298: <span class="ruby-identifier">msg</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">msgid</span>
|
|
1787
|
+
299: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">div</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">msg</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">msgid</span>
|
|
1788
|
+
300: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">index</span> = <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-identifier">div</span>)
|
|
1789
|
+
301: <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">msg</span>[(<span class="ruby-identifier">index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
1790
|
+
302: <span class="ruby-keyword kw">end</span>
|
|
1791
|
+
303: <span class="ruby-keyword kw">end</span>
|
|
1792
|
+
304: <span class="ruby-ivar">@@__cache_msgids</span>[<span class="ruby-identifier">cached_key</span>] = <span class="ruby-identifier">msg</span>
|
|
1793
|
+
305: <span class="ruby-keyword kw">end</span>
|
|
1668
1794
|
</pre>
|
|
1669
1795
|
</div>
|
|
1670
1796
|
</div>
|
|
1671
1797
|
</div>
|
|
1672
1798
|
|
|
1673
|
-
<div id="method-
|
|
1674
|
-
<a name="
|
|
1799
|
+
<div id="method-M000085" class="method-detail">
|
|
1800
|
+
<a name="M000085"></a>
|
|
1675
1801
|
|
|
1676
1802
|
<div class="method-heading">
|
|
1677
|
-
<a href="#
|
|
1803
|
+
<a href="#M000085" class="method-signature">
|
|
1678
1804
|
<span class="method-name">textdomain</span><span class="method-args">(domainname)</span>
|
|
1679
1805
|
</a>
|
|
1680
1806
|
</div>
|
|
1681
1807
|
|
|
1682
1808
|
<div class="method-description">
|
|
1683
1809
|
<p>
|
|
1684
|
-
Binds a existed <a href="GetText.html#
|
|
1810
|
+
Binds a existed <a href="GetText.html#M000085">textdomain</a> to your
|
|
1685
1811
|
program. This is the same function with <a
|
|
1686
|
-
href="GetText.html#
|
|
1687
|
-
faster) than <a href="GetText.html#
|
|
1688
|
-
you need to call <a href="GetText.html#
|
|
1812
|
+
href="GetText.html#M000083">GetText.bindtextdomain</a> but simpler(and
|
|
1813
|
+
faster) than <a href="GetText.html#M000083">bindtextdomain</a>. Notice that
|
|
1814
|
+
you need to call <a href="GetText.html#M000083">GetText.bindtextdomain</a>
|
|
1689
1815
|
first. If the domainname hasn‘t bound yet, raises <a
|
|
1690
1816
|
href="GetText/NoboundTextDomainError.html">GetText::NoboundTextDomainError</a>.
|
|
1691
1817
|
</p>
|
|
1692
1818
|
<ul>
|
|
1693
|
-
<li>domainname: a <a href="GetText.html#
|
|
1819
|
+
<li>domainname: a <a href="GetText.html#M000085">textdomain</a> name.
|
|
1694
1820
|
|
|
1695
1821
|
</li>
|
|
1696
1822
|
<li>Returns: the <a
|
|
@@ -1699,8 +1825,8 @@ href="GetText/TextDomainManager.html">GetText::TextDomainManager</a>.
|
|
|
1699
1825
|
</li>
|
|
1700
1826
|
</ul>
|
|
1701
1827
|
<p><a class="source-toggle" href="#"
|
|
1702
|
-
onclick="toggleCode('
|
|
1703
|
-
<div class="method-source-code" id="
|
|
1828
|
+
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
|
|
1829
|
+
<div class="method-source-code" id="M000085-source">
|
|
1704
1830
|
<pre>
|
|
1705
1831
|
<span class="ruby-comment cmt"># File lib/gettext.rb, line 128</span>
|
|
1706
1832
|
128: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">textdomain</span>(<span class="ruby-identifier">domainname</span>)
|
|
@@ -1721,11 +1847,11 @@ href="GetText/TextDomainManager.html">GetText::TextDomainManager</a>.
|
|
|
1721
1847
|
</div>
|
|
1722
1848
|
</div>
|
|
1723
1849
|
|
|
1724
|
-
<div id="method-
|
|
1725
|
-
<a name="
|
|
1850
|
+
<div id="method-M000086" class="method-detail">
|
|
1851
|
+
<a name="M000086"></a>
|
|
1726
1852
|
|
|
1727
1853
|
<div class="method-heading">
|
|
1728
|
-
<a href="#
|
|
1854
|
+
<a href="#M000086" class="method-signature">
|
|
1729
1855
|
<span class="method-name">textdomain_to</span><span class="method-args">(klass, domainname)</span>
|
|
1730
1856
|
</a>
|
|
1731
1857
|
</div>
|
|
@@ -1733,20 +1859,20 @@ href="GetText/TextDomainManager.html">GetText::TextDomainManager</a>.
|
|
|
1733
1859
|
<div class="method-description">
|
|
1734
1860
|
<p>
|
|
1735
1861
|
Includes <a href="GetText.html">GetText</a> module and bind an exsited <a
|
|
1736
|
-
href="GetText.html#
|
|
1737
|
-
href="GetText.html#
|
|
1862
|
+
href="GetText.html#M000085">textdomain</a> to a class. See <a
|
|
1863
|
+
href="GetText.html#M000085">textdomain</a> for more detail.
|
|
1738
1864
|
</p>
|
|
1739
1865
|
<ul>
|
|
1740
1866
|
<li>klass: the target ruby class.
|
|
1741
1867
|
|
|
1742
1868
|
</li>
|
|
1743
|
-
<li>domainname: the <a href="GetText.html#
|
|
1869
|
+
<li>domainname: the <a href="GetText.html#M000085">textdomain</a> name.
|
|
1744
1870
|
|
|
1745
1871
|
</li>
|
|
1746
1872
|
</ul>
|
|
1747
1873
|
<p><a class="source-toggle" href="#"
|
|
1748
|
-
onclick="toggleCode('
|
|
1749
|
-
<div class="method-source-code" id="
|
|
1874
|
+
onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
|
|
1875
|
+
<div class="method-source-code" id="M000086-source">
|
|
1750
1876
|
<pre>
|
|
1751
1877
|
<span class="ruby-comment cmt"># File lib/gettext.rb, line 146</span>
|
|
1752
1878
|
146: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">textdomain_to</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">domainname</span>)
|
|
@@ -1762,11 +1888,11 @@ href="GetText.html#M000032">textdomain</a> for more detail.
|
|
|
1762
1888
|
</div>
|
|
1763
1889
|
</div>
|
|
1764
1890
|
|
|
1765
|
-
<div id="method-
|
|
1766
|
-
<a name="
|
|
1891
|
+
<div id="method-M000073" class="method-detail">
|
|
1892
|
+
<a name="M000073"></a>
|
|
1767
1893
|
|
|
1768
1894
|
<div class="method-heading">
|
|
1769
|
-
<a href="#
|
|
1895
|
+
<a href="#M000073" class="method-signature">
|
|
1770
1896
|
<span class="method-name">update_pofiles</span><span class="method-args">(textdomain, files, app_version, po_root = "po", refpot = "tmp.pot")</span>
|
|
1771
1897
|
</a>
|
|
1772
1898
|
</div>
|
|
@@ -1774,13 +1900,13 @@ href="GetText.html#M000032">textdomain</a> for more detail.
|
|
|
1774
1900
|
<div class="method-description">
|
|
1775
1901
|
<p>
|
|
1776
1902
|
At first, this creates the #{po_root}/#{domainname}.pot file using <a
|
|
1777
|
-
href="GetText.html#
|
|
1903
|
+
href="GetText.html#M000074">GetText.rgettext</a>. Since 2nd time, this
|
|
1778
1904
|
updates(merges) the #{po_root}/#{domainname}.pot and all of the
|
|
1779
1905
|
#{po_root}/#{lang}/#{domainname}.po files under "po_root" using
|
|
1780
|
-
"<a href="GetText.html#
|
|
1906
|
+
"<a href="GetText.html#M000071">msgmerge</a>".
|
|
1781
1907
|
</p>
|
|
1782
1908
|
<p>
|
|
1783
|
-
<b>Note</b> "<a href="GetText.html#
|
|
1909
|
+
<b>Note</b> "<a href="GetText.html#M000071">msgmerge</a>" tool is
|
|
1784
1910
|
included in GNU <a href="GetText.html">GetText</a>. So you need to install
|
|
1785
1911
|
GNU <a href="GetText.html">GetText</a>.
|
|
1786
1912
|
</p>
|
|
@@ -1790,11 +1916,11 @@ href="http://www.yotabanana.com/hiki/ruby-gettext-howto-manage.html">www.yotaban
|
|
|
1790
1916
|
for more detals.
|
|
1791
1917
|
</p>
|
|
1792
1918
|
<ul>
|
|
1793
|
-
<li>domainname: the <a href="GetText.html#
|
|
1919
|
+
<li>domainname: the <a href="GetText.html#M000085">textdomain</a> name.
|
|
1794
1920
|
|
|
1795
1921
|
</li>
|
|
1796
1922
|
<li>targetfiles: An Array of target files or nil (See <a
|
|
1797
|
-
href="GetText.html#
|
|
1923
|
+
href="GetText.html#M000074">GetText.rgettext</a> for more details).
|
|
1798
1924
|
|
|
1799
1925
|
</li>
|
|
1800
1926
|
<li>app_version: the application information which appears
|
|
@@ -1813,15 +1939,15 @@ be removed).
|
|
|
1813
1939
|
(e.g.) GetText.update_pofiles("myapp", Dir.glob("lib/*.rb"), "myapp 1.0.0")
|
|
1814
1940
|
</pre>
|
|
1815
1941
|
<p><a class="source-toggle" href="#"
|
|
1816
|
-
onclick="toggleCode('
|
|
1817
|
-
<div class="method-source-code" id="
|
|
1942
|
+
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
|
1943
|
+
<div class="method-source-code" id="M000073-source">
|
|
1818
1944
|
<pre>
|
|
1819
|
-
<span class="ruby-comment cmt"># File lib/gettext/utils.rb, line
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1945
|
+
<span class="ruby-comment cmt"># File lib/gettext/utils.rb, line 131</span>
|
|
1946
|
+
131: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_pofiles</span>(<span class="ruby-identifier">textdomain</span>, <span class="ruby-identifier">files</span>, <span class="ruby-identifier">app_version</span>, <span class="ruby-identifier">po_root</span> = <span class="ruby-value str">"po"</span>, <span class="ruby-identifier">refpot</span> = <span class="ruby-value str">"tmp.pot"</span>)
|
|
1947
|
+
132: <span class="ruby-identifier">rgettext</span>(<span class="ruby-identifier">files</span>, <span class="ruby-identifier">refpot</span>)
|
|
1948
|
+
133: <span class="ruby-identifier">msgmerge_all</span>(<span class="ruby-identifier">textdomain</span>, <span class="ruby-identifier">app_version</span>, <span class="ruby-identifier">po_root</span>, <span class="ruby-identifier">refpot</span>)
|
|
1949
|
+
134: <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">refpot</span>)
|
|
1950
|
+
135: <span class="ruby-keyword kw">end</span>
|
|
1825
1951
|
</pre>
|
|
1826
1952
|
</div>
|
|
1827
1953
|
</div>
|