gettext 3.2.9 → 3.3.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.
- checksums.yaml +4 -4
- data/README.md +276 -198
- data/Rakefile +2 -1
- data/doc/text/news.md +43 -0
- data/gettext.gemspec +3 -2
- data/lib/gettext/locale_path.rb +5 -1
- data/lib/gettext/po.rb +4 -4
- data/lib/gettext/po_entry.rb +17 -7
- data/lib/gettext/text_domain.rb +1 -1
- data/lib/gettext/tools/parser/ruby.rb +238 -224
- data/lib/gettext/version.rb +2 -2
- data/po/bg/gettext.edit.po +10 -4
- data/po/bg/gettext.po +5 -0
- data/po/bs/gettext.edit.po +10 -4
- data/po/bs/gettext.po +5 -0
- data/po/ca/gettext.edit.po +10 -4
- data/po/ca/gettext.po +5 -0
- data/po/cs/gettext.edit.po +10 -4
- data/po/cs/gettext.po +5 -0
- data/po/de/gettext.edit.po +10 -4
- data/po/de/gettext.po +5 -0
- data/po/el/gettext.edit.po +10 -4
- data/po/el/gettext.po +5 -0
- data/po/eo/gettext.edit.po +10 -4
- data/po/eo/gettext.po +5 -0
- data/po/es/gettext.edit.po +10 -4
- data/po/es/gettext.po +5 -0
- data/po/et/gettext.edit.po +10 -4
- data/po/et/gettext.po +5 -0
- data/po/fr/gettext.edit.po +10 -4
- data/po/fr/gettext.po +5 -0
- data/po/gettext.pot +32 -25
- data/po/hr/gettext.edit.po +10 -4
- data/po/hr/gettext.po +5 -0
- data/po/hu/gettext.edit.po +10 -4
- data/po/hu/gettext.po +5 -0
- data/po/it/gettext.edit.po +10 -4
- data/po/it/gettext.po +5 -0
- data/po/ja/gettext.edit.po +10 -4
- data/po/ja/gettext.po +5 -0
- data/po/ko/gettext.edit.po +10 -4
- data/po/ko/gettext.po +5 -0
- data/po/lv/gettext.edit.po +10 -4
- data/po/lv/gettext.po +5 -0
- data/po/nb/gettext.edit.po +10 -4
- data/po/nb/gettext.po +5 -0
- data/po/nl/gettext.edit.po +10 -4
- data/po/nl/gettext.po +5 -0
- data/po/pt_BR/gettext.edit.po +10 -4
- data/po/pt_BR/gettext.po +5 -0
- data/po/ru/gettext.edit.po +10 -4
- data/po/ru/gettext.po +5 -0
- data/po/sr/gettext.edit.po +10 -4
- data/po/sr/gettext.po +5 -0
- data/po/sv/gettext.edit.po +10 -4
- data/po/sv/gettext.po +5 -0
- data/po/uk/gettext.edit.po +10 -4
- data/po/uk/gettext.po +5 -0
- data/po/vi/gettext.edit.po +10 -4
- data/po/vi/gettext.po +5 -0
- data/po/zh/gettext.edit.po +10 -4
- data/po/zh/gettext.po +5 -0
- data/po/zh_TW/gettext.edit.po +10 -4
- data/po/zh_TW/gettext.po +5 -0
- data/samples/cgi/po/helloerb1.pot +3 -3
- data/samples/cgi/po/helloerb2.pot +3 -3
- data/samples/cgi/po/hellolib.pot +3 -3
- data/samples/cgi/po/main.pot +3 -3
- data/samples/po/hello.pot +3 -3
- data/samples/po/hello2.pot +4 -4
- data/samples/po/hello_glade2.pot +4 -4
- data/samples/po/hello_gtk2.pot +4 -4
- data/samples/po/hello_gtk_builder.pot +4 -5
- data/samples/po/hello_noop.pot +4 -4
- data/samples/po/hello_plural.pot +4 -4
- data/samples/po/hello_tk.pot +4 -4
- data/test/fixtures/_.rb +9 -0
- data/test/fixtures/erb/non_ascii.rhtml +1 -0
- data/test/gettext-test-utils.rb +10 -3
- data/test/locale/fr/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/ja/LC_MESSAGES/_.mo +0 -0
- data/test/po/_.pot +8 -4
- data/test/po/backslash.pot +6 -4
- data/test/po/fr/plural_error.po +7 -0
- data/test/po/hello.pot +3 -3
- data/test/po/ja/_.edit.po +6 -2
- data/test/po/ja/_.po +5 -2
- data/test/po/ja/hello.edit.po +0 -1
- data/test/po/non_ascii.pot +4 -4
- data/test/po/np_.pot +8 -5
- data/test/po/ns_.pot +6 -4
- data/test/po/p_.pot +3 -3
- data/test/po/s_.pot +6 -4
- data/test/po/untranslated.pot +4 -4
- data/test/test_class_info.rb +8 -9
- data/test/test_gettext.rb +7 -1
- data/test/test_parser.rb +1 -1
- data/test/test_po_entry.rb +1 -13
- data/test/test_po_parser.rb +6 -4
- data/test/test_string.rb +9 -5
- data/test/tools/test_msgmerge.rb +5 -2
- data/test/tools/test_xgettext.rb +5 -1
- metadata +17 -18
- data/lib/gettext/tools/parser/haml.rb +0 -61
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7f90846d2f7fec5d336b6867dbaef56d739cb0917ccf8d9579e3342d2b281aa
|
|
4
|
+
data.tar.gz: 5ea3cd94fb22f166310ca120ad9164d73ac0c04c29b6fc74814e6e72bf593d5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3545417d8a7348df2cc46a38cd791cc366c6b7a8eaeb2a82eb8570d98f80afa9fbe9b046a4bfe2e28e09f9f4f2211702a261fb97382aa73876aacb030aa9255
|
|
7
|
+
data.tar.gz: 3bca29b8aa87ee03734c691d1006fabb9831f3f43017a83ec4e449adcedcf7db0b165790b42c6a2dcc23b9fe363a5aec01cf9fabcf4c551f3f6eea9b631aa07c
|
data/README.md
CHANGED
|
@@ -1,285 +1,363 @@
|
|
|
1
|
-
# gettext
|
|
1
|
+
# gettext
|
|
2
|
+
*gettext for Ruby*
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
[](https://badge.fury.io/rb/gettext)
|
|
5
|
+
[](https://travis-ci.org/ruby-gettext/gettext)
|
|
5
6
|
|
|
6
|
-
NOTE
|
|
7
|
-
|
|
8
|
-
possible but some existing codes may be broken by gettext gem API
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
> **NOTE:**
|
|
8
|
+
> Gettext gem 3.0.0 removed many deprecated APIs and improves internal APIs.
|
|
9
|
+
> We want to keep backward compatibility as much as possible but some existing codes may be broken by gettext gem API change.
|
|
10
|
+
> If your code breaks by gettext gem 3.0.0, please report your problem.
|
|
11
|
+
> We will fix the problem and release a new version.
|
|
11
12
|
|
|
12
|
-
https://github.com/ruby-gettext/gettext is the official gettext gem
|
|
13
|
-
|
|
14
|
-
agreed with the move.
|
|
13
|
+
> https://github.com/ruby-gettext/gettext is the official gettext gem repository.
|
|
14
|
+
> It is moved from https://github.com/mutoh/gettext .
|
|
15
|
+
> Mutoh agreed with the move.
|
|
15
16
|
|
|
16
|
-
Gettext gem is a pure Ruby Localization(L10n) library and tool
|
|
17
|
-
which is modeled after the GNU gettext package.
|
|
17
|
+
Gettext gem is a pure Ruby Localization(L10n) library and tool which is modeled after the GNU gettext package.
|
|
18
18
|
|
|
19
|
-
This library was called as "Ruby-GetText-Package".
|
|
20
|
-
library is called just "gettext".
|
|
21
|
-
"gettext gem" or "Ruby gettext" to distinguish from GNU gettext.
|
|
19
|
+
This library was called as "Ruby-GetText-Package".
|
|
20
|
+
Since 2.3.0, this library is called just "gettext".
|
|
21
|
+
You can call this library as "gettext gem" or "Ruby gettext" to distinguish from GNU gettext.
|
|
22
22
|
|
|
23
|
-
This library translates original messages to localized
|
|
24
|
-
messages using client-side locale information(environment
|
|
25
|
-
variable or CGI variable).
|
|
23
|
+
This library translates original messages to localized messages using client-side locale information(environment variable or CGI variable).
|
|
26
24
|
|
|
27
|
-
The tools for developers support creating, useing, and modifying
|
|
28
|
-
localized message files(message catalogs).
|
|
25
|
+
The tools for developers support creating, useing, and modifying localized message files(message catalogs).
|
|
29
26
|
|
|
30
|
-
((**Rails**))
|
|
31
27
|
Rails support has been removed.
|
|
32
28
|
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
* [
|
|
36
|
-
*
|
|
29
|
+
## Table of Contents
|
|
30
|
+
|
|
31
|
+
* [Features](#features)
|
|
32
|
+
* [Requirements](#requirements)
|
|
33
|
+
* [Installation](#installation)
|
|
34
|
+
* [Usage](#usage)
|
|
35
|
+
* [Translation](#translation)
|
|
36
|
+
* [`_()`](#_-basic-translation-method)
|
|
37
|
+
* [`n_()`](#n_-pluralized)
|
|
38
|
+
* [`p_()`](#p_-context-aware)
|
|
39
|
+
* [`s_()`](#s_-without-context)
|
|
40
|
+
* [Combinations](#combinations)
|
|
41
|
+
* [`N_()`, `Nn_()`](#n_-nn_-makes-dynamic-translation-messages-readable-for-the-gettext-parser)
|
|
42
|
+
* [Bind textdomains to the classes](#bind-textdomains-to-the-classes)
|
|
43
|
+
* [Locale](#locale)
|
|
44
|
+
* [License](#license)
|
|
45
|
+
* [Translators](#translators)
|
|
46
|
+
* [Maintainer](#maintainer)
|
|
47
|
+
* [Links](#links)
|
|
37
48
|
|
|
38
49
|
## Features
|
|
39
50
|
|
|
40
|
-
* Translate singular/plural messages with simple APIs(similar to GNU gettext)
|
|
41
|
-
|
|
42
|
-
* Thread safety. Message resources are shared from all threads, but
|
|
43
|
-
returns translated messages of the current thread's locale.
|
|
44
|
-
|
|
51
|
+
* Translate singular/plural messages with simple APIs (similar to GNU gettext)
|
|
52
|
+
* Thread safety. Message resources are shared from all threads, but returns translated messages of the current thread's locale.
|
|
45
53
|
* Tools to find message IDs
|
|
46
|
-
* Extract message IDs to po
|
|
54
|
+
* Extract message IDs to `po`-files using `rxgettext` from
|
|
47
55
|
* ruby scripts
|
|
48
|
-
* glade-2 XML file(
|
|
49
|
-
* ERB file(
|
|
56
|
+
* glade-2 XML file (`.glade`)
|
|
57
|
+
* ERB file (`.rhtml`, `.erb`)
|
|
50
58
|
* Anything (with your own parsers)
|
|
51
|
-
* The po
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* Using rxgettext/rmsgfmt as Rake tasks
|
|
57
|
-
|
|
59
|
+
* The `po`-files are compatible with GNU gettext.
|
|
60
|
+
* `rmsgfmt` creates a `mo`-file from a `po`-file.
|
|
61
|
+
The `mo`-file is compatible with GNU gettext (`msgfmt`).
|
|
62
|
+
* Using `rxgettext`/`rmsgfmt` as Rake tasks
|
|
58
63
|
* textdomain's scope is adapt to ruby class/module mechanism.
|
|
59
64
|
* A class/module can have plural textdomains.
|
|
60
65
|
* a message is looked up in its class/module and ancestors.
|
|
61
|
-
|
|
62
66
|
* CGI support (gettext/cgi)
|
|
63
67
|
* Locale is retrieved from client informations using Ruby-Locale.
|
|
64
|
-
(HTTP_ACCEPT_LANGUAGE
|
|
68
|
+
(`HTTP_ACCEPT_LANGUAGE`, `HTTP_ACCEPT_CHARSET`, `QUERY_STRING` (lang), Cookies (lang)).
|
|
65
69
|
|
|
66
70
|
## Requirements
|
|
67
71
|
|
|
68
|
-
* [Ruby
|
|
72
|
+
* [Ruby](http://www.ruby-lang.org) 1.9.3 or later
|
|
69
73
|
* [RubyGems](http://www.rubygems.org/)
|
|
70
|
-
* [locale
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
* [locale](http://ruby-gettext.github.io/) gem
|
|
75
|
+
```shell
|
|
76
|
+
gem install locale
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For development:
|
|
80
|
+
|
|
81
|
+
* [Racc](http://rubygems.org/gems/racc) 1.4.3 or later (for compiling `src/rmsgfmt.ry` only)
|
|
75
82
|
|
|
76
|
-
##
|
|
83
|
+
## Installation
|
|
77
84
|
|
|
78
|
-
|
|
85
|
+
Uninstall old gettext if exists. (You need to do this when updating 1.93.0 -> 2.0.1)
|
|
79
86
|
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
```shell
|
|
88
|
+
# sudo/su on POSIX system
|
|
89
|
+
gem uninstall gettext
|
|
90
|
+
```
|
|
82
91
|
|
|
83
|
-
|
|
92
|
+
### RubyGems
|
|
84
93
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
```shell
|
|
95
|
+
# sudo/su on POSIX system
|
|
96
|
+
gem install gettext
|
|
97
|
+
```
|
|
88
98
|
|
|
89
|
-
|
|
99
|
+
### Download tar-ball
|
|
90
100
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
101
|
+
```shell
|
|
102
|
+
# De-Compress archive and enter its top directory.
|
|
103
|
+
# sudo/su on POSIX system
|
|
104
|
+
ruby setup.rb
|
|
105
|
+
```
|
|
94
106
|
|
|
95
|
-
You can also install files in your favorite directory by
|
|
96
|
-
|
|
107
|
+
You can also install files in your favorite directory by supplying setup.rb some options.
|
|
108
|
+
Try `ruby setup.rb --help`.
|
|
97
109
|
|
|
98
110
|
## Usage
|
|
99
111
|
|
|
100
112
|
### Translation
|
|
101
113
|
|
|
102
|
-
|
|
114
|
+
#### `_()` or `gettext()`: basic translation method
|
|
103
115
|
|
|
104
|
-
|
|
116
|
+
Translates the message, using the `msgid` if a translation is not found.
|
|
105
117
|
|
|
106
|
-
|
|
118
|
+
```ruby
|
|
119
|
+
_("Hello") => "Bonjour" # Found
|
|
120
|
+
```
|
|
107
121
|
|
|
108
|
-
|
|
122
|
+
This translation will appear in the po or pot file as:
|
|
109
123
|
|
|
110
|
-
|
|
124
|
+
```
|
|
125
|
+
msgid: "Hello"
|
|
126
|
+
msgstr: "Bonjour"
|
|
127
|
+
```
|
|
111
128
|
|
|
112
|
-
|
|
129
|
+
When a translation is not found it, it will return the `msgid`. This is a core
|
|
130
|
+
benefit of gettext and applies to all its translation methods.
|
|
113
131
|
|
|
114
|
-
|
|
115
|
-
|
|
132
|
+
```ruby
|
|
133
|
+
_("Hello") => "Hello" # Not Found
|
|
134
|
+
```
|
|
116
135
|
|
|
117
|
-
|
|
136
|
+
Additional gettext methods come in 3 combinable flavors:
|
|
118
137
|
|
|
119
|
-
|
|
138
|
+
#### `n_()` or `ngettext()`: pluralized
|
|
120
139
|
|
|
121
|
-
|
|
122
|
-
is the same as s_("Printer|Open") <=> s_("File|Open")
|
|
140
|
+
Returns singular or plural form, depending on how many you have.
|
|
123
141
|
|
|
124
|
-
|
|
142
|
+
```ruby
|
|
143
|
+
n_("Apple", "%{num} Apples", n) => "3 Pommes" # When n = 3
|
|
144
|
+
n_("Apple", "%{num} Apple", n) => "Pomme" # When n = 1
|
|
145
|
+
n_(["Apple", "%{num} Apple"], n) => "Pomme" # 2 arg variation
|
|
146
|
+
```
|
|
125
147
|
|
|
126
|
-
|
|
148
|
+
This translation will appear in the po or pot file as:
|
|
127
149
|
|
|
128
|
-
|
|
129
|
-
|
|
150
|
+
```
|
|
151
|
+
msgid "Apple"
|
|
152
|
+
msgid_plural "%{num} Apples"
|
|
153
|
+
msgstr[0] "Pomme"
|
|
154
|
+
msgstr[1] "#{num} Pommes"
|
|
155
|
+
```
|
|
130
156
|
|
|
131
|
-
|
|
157
|
+
#### `p_()` or `pgettext()`: context aware
|
|
132
158
|
|
|
133
|
-
|
|
134
|
-
ns_("Fruit|Apple","%{num} Apples", 3)
|
|
159
|
+
A context is a prefix to your translation, useful when one word has different meanings, depending on its context.
|
|
135
160
|
|
|
136
|
-
|
|
137
|
-
|
|
161
|
+
```ruby
|
|
162
|
+
p_("Printer","Open") => "Öffnen" #translation found
|
|
163
|
+
p_("Printer","Open") => "Open" #translation not found
|
|
164
|
+
```
|
|
138
165
|
|
|
139
|
-
|
|
166
|
+
This translation will appear in the po or pot file as:
|
|
140
167
|
|
|
141
|
-
|
|
142
|
-
|
|
168
|
+
```
|
|
169
|
+
msgctxt "Printer"
|
|
170
|
+
msgid "Open"
|
|
171
|
+
msgstr "Öffnen"
|
|
172
|
+
```
|
|
143
173
|
|
|
144
|
-
|
|
145
|
-
|
|
174
|
+
Note that the parser when sorting by `msgid` will strictly sort by the `msgid` ignoring
|
|
175
|
+
the `msgctxt`. If you prefer to sort with the `msgctxt` you should consider the
|
|
176
|
+
`s_()` method.
|
|
146
177
|
|
|
147
|
-
|
|
148
|
-
n_(fruits, 3)
|
|
178
|
+
#### `s_()` or `sgettext()`: without context
|
|
149
179
|
|
|
150
|
-
|
|
180
|
+
The `s_()` method is very similar to the `p_()` method except that the context is
|
|
181
|
+
inside the msgid.
|
|
151
182
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
183
|
+
```ruby
|
|
184
|
+
s_("Printer|Open") => "Öffnen" #translation found
|
|
185
|
+
s_("Printer|Open") => "Open" #translation not found
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
msgid "Printer|Open"
|
|
190
|
+
msgstr "Öffnen"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Note the the parser when sorting by `msgid` will take the context into consideration
|
|
194
|
+
as it is part of the `msgid` unlike the `p_()` method.
|
|
195
|
+
|
|
196
|
+
Your preference of using `s_()` or `p_()` will depend on your translation workflow and process.
|
|
197
|
+
|
|
198
|
+
#### Combinations
|
|
199
|
+
|
|
200
|
+
You can combine `n_()` with either `p_()` or `s_()`.
|
|
201
|
+
|
|
202
|
+
#### `np_()` or `npgettext()`: context aware pluralized
|
|
203
|
+
|
|
204
|
+
```ruby
|
|
205
|
+
np_("Fruit", "Apple", "%{num} Apples", 3)
|
|
206
|
+
np_(["Fruit","Apple","%{num} Apples"], 3) # 2 arg variation
|
|
207
|
+
```
|
|
155
208
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
209
|
+
```
|
|
210
|
+
msgctxt "Fruit"
|
|
211
|
+
msgid "Apple"
|
|
212
|
+
msgid_plural "%{num} Apples"
|
|
213
|
+
msgstr[0] ""
|
|
214
|
+
msgstr[1] ""
|
|
215
|
+
```
|
|
160
216
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
217
|
+
#### `sp_()` or `spgettext()`: context aware pluralized
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
```ruby
|
|
221
|
+
ns_("Fruit|Apple","%{num} Apples", 3)
|
|
222
|
+
ns_(["Fruit|Apple","%{num} Apples"], 3) # 2 arg variation
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
msgid "Fruit|Apple"
|
|
227
|
+
msgid_plural "%{num} Apples"
|
|
228
|
+
msgstr[0] ""
|
|
229
|
+
msgstr[1] ""
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### `N_()` and `Nn_()`: makes dynamic translation messages readable for the gettext parser
|
|
233
|
+
|
|
234
|
+
`_(fruit)` cannot be understood by the gettext parser.
|
|
235
|
+
To help the parser find all your translations, you can add `fruit = N_("Apple")` which does not translate, but tells the parser: "Apple" needs translation.
|
|
236
|
+
|
|
237
|
+
```ruby
|
|
238
|
+
fruit = N_("Apple") # same as fruit = "Apple"
|
|
239
|
+
_(fruit) # does a normal translation
|
|
240
|
+
|
|
241
|
+
fruits = Nn_("Apple", "%{num} Apples")
|
|
242
|
+
n_(fruits, 3)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Interpolating translations
|
|
246
|
+
|
|
247
|
+
This is not a feature of gettext but worth noting. You can interpolate translated strings without the ruby String `%` operator.
|
|
248
|
+
|
|
249
|
+
```ruby
|
|
250
|
+
N_("active"); N_("inactive"); N_("paused") # possible value of status for parser to find.
|
|
251
|
+
_("Your account is #{account_state}.") % { account_state: _(status) }
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
### Bind textdomains to the classes
|
|
256
|
+
|
|
257
|
+
A textdomain has a translation file in each language.
|
|
258
|
+
A module/class can have multiple textdomains.
|
|
259
|
+
This means the libraries/applications can have their own textdomains.
|
|
260
|
+
|
|
261
|
+
```ruby
|
|
262
|
+
class Foo
|
|
263
|
+
include GetText
|
|
264
|
+
bindtextdomain "your_app_domain_name"
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
class Book
|
|
268
|
+
include GetText
|
|
269
|
+
bindtextdomain "general"
|
|
270
|
+
bindtextdomain "book"
|
|
271
|
+
end
|
|
272
|
+
```
|
|
166
273
|
|
|
167
274
|
### Locale
|
|
168
275
|
|
|
169
276
|
If you need to set the locale by yourself, then use:
|
|
170
277
|
|
|
171
|
-
|
|
172
|
-
|
|
278
|
+
```ruby
|
|
279
|
+
GetText.locale = "en_US" # translate into english from now on
|
|
280
|
+
GetText.locale # => en_US
|
|
281
|
+
```
|
|
173
282
|
|
|
174
283
|
Or
|
|
175
284
|
|
|
176
|
-
|
|
177
|
-
|
|
285
|
+
```ruby
|
|
286
|
+
include GetText
|
|
287
|
+
set_locale "en_US"
|
|
288
|
+
```
|
|
178
289
|
|
|
179
|
-
For more details and options, have a look at the samples folder
|
|
180
|
-
consult the [tutorial](http://www.yotabanana.com/hiki/ruby-gettext-howto.html).
|
|
290
|
+
For more details and options, have a look at the samples folder.
|
|
181
291
|
|
|
182
292
|
## License
|
|
183
293
|
|
|
184
|
-
This program is licenced under the same licence as Ruby(See doc/text/ruby-license.txt) or
|
|
185
|
-
LGPL(Lesser General Public License: doc/text/lgpl-3.0.txt or http://www.gnu.org/licenses/lgpl-3.0.txt).
|
|
186
|
-
|
|
187
|
-
* mofile.rb
|
|
188
|
-
* Copyright (C) 2001-2009 Masao Mutoh `<mutoh at highwhay.ne.jp>`
|
|
189
|
-
* Copyright (C) 2001,2002 Masahiro Sakai `<s01397ms at sfc.keio.ac.jp>`
|
|
294
|
+
This program is licenced under the same licence as Ruby (See `doc/text/ruby-license.txt`) or
|
|
295
|
+
LGPL (Lesser General Public License: `doc/text/lgpl-3.0.txt` or http://www.gnu.org/licenses/lgpl-3.0.txt).
|
|
190
296
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
297
|
+
`mofile.rb`
|
|
298
|
+
```
|
|
299
|
+
Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
|
|
300
|
+
Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
|
|
301
|
+
```
|
|
194
302
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
303
|
+
`gettext.rb`
|
|
304
|
+
```
|
|
305
|
+
Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
|
|
306
|
+
Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
|
|
307
|
+
```
|
|
198
308
|
|
|
199
|
-
|
|
200
|
-
|
|
309
|
+
`rxgettext`
|
|
310
|
+
```
|
|
311
|
+
Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
|
|
312
|
+
Copyright (C) 2001,2002 Yasushi Shoji <yashi at atmark-techno.com>
|
|
313
|
+
```
|
|
201
314
|
|
|
315
|
+
Others
|
|
316
|
+
```
|
|
317
|
+
Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
|
|
318
|
+
```
|
|
202
319
|
|
|
203
320
|
## Translators
|
|
204
321
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
* Korean(ko) - Gyoung-Yoon Noh `<nohmad at gmail.com>`
|
|
235
|
-
* Latvian(lv) - Aivars Akots `<aivars.akots at gmail.com>`
|
|
236
|
-
* Norwegian(nb) - Runar Ingebrigtsen `<runar at mopo.no>`
|
|
237
|
-
* Portuguese(Brazil)(pt_BR)
|
|
238
|
-
* Antonio S. de A. Terceiro `<terceiro at softwarelivre.org>` (current)
|
|
239
|
-
* Joao Pedrosa `<joaopedrosa at gmail.com>`
|
|
240
|
-
* Russian(ru) - Yuri Kozlov `<kozlov.y at gmail.com>`
|
|
241
|
-
* Serbian(sr) - Slobodan Paunović" `<slobodan.paunovic at gmail.com>`
|
|
242
|
-
* Spanish(es)
|
|
243
|
-
* David Espada `<davinci at escomposlinux.org>` (current)
|
|
244
|
-
* David Moreno Garza `<damog at damog.net>`
|
|
245
|
-
* Swedish(sv) - Nikolai Weibull `<mailing-lists.ruby-talk at rawuncut.elitemail.org>`
|
|
246
|
-
* Ukrainian(uk) - Alex Rootoff `<rootoff at pisem.net>`
|
|
247
|
-
* Vietnamese(vi) - Ngoc Dao Thanh `<ngocdaothanh at gmail.com>`
|
|
248
|
-
|
|
249
|
-
## Status of translations
|
|
250
|
-
|
|
251
|
-
* Bosnian(bs) - 1.90.0 (old)
|
|
252
|
-
* Bulgarian(bg) - 2.0.1
|
|
253
|
-
* Catalan(ca) - 2.0.1
|
|
254
|
-
* Croatian(hr) - 1.90.0 (old)
|
|
255
|
-
* Chinese(zh_CN) - 2.0.1
|
|
256
|
-
* Chinese(zh_TW) - 2.0.1
|
|
257
|
-
* Czech(cs) - 1.9.0 (old)
|
|
258
|
-
* Dutch(nl) - 1.90.0 (old)
|
|
259
|
-
* English(default) - 2.1.0
|
|
260
|
-
* Esperanto(eo) - 2.0.1
|
|
261
|
-
* Estonian(et) - 2.0.1
|
|
262
|
-
* French(fr) - 2.0.1
|
|
263
|
-
* German(de) - 2.0.1
|
|
264
|
-
* Greek(el) - 2.0.1
|
|
265
|
-
* Hungarian(hu) - 2.0.1
|
|
266
|
-
* Italian(it) - 1.6.0 (old)
|
|
267
|
-
* Japanese(ja) - 2.1.0
|
|
268
|
-
* Korean(ko) - 1.9.0 (old)
|
|
269
|
-
* Latvian(lv) - 2.0.1
|
|
270
|
-
* Norwegian(nb) - 2.0.1
|
|
271
|
-
* Portuguese(Brazil)(pt_BR) - 2.0.1
|
|
272
|
-
* Russian(ru) - 2.0.1
|
|
273
|
-
* Serbian(sr) - 2.0.1
|
|
274
|
-
* Spanish(es) - 2.0.1
|
|
275
|
-
* Swedish(sv) - 0.8.0 (too much old)
|
|
276
|
-
* Ukrainian(uk) - 2.0.1
|
|
277
|
-
* Vietnamese(vi) - 2.0.1
|
|
322
|
+
| Language | Translator | Status |
|
|
323
|
+
| --- | --- | --- |
|
|
324
|
+
| Bosnian (bs) | Sanjin Sehic `<saserr at gmail.com>` | 1.90.0 (old) |
|
|
325
|
+
| Bulgarian (bg) | Sava Chankov `<sava.chankov at gmail.com>` | 2.0.1 |
|
|
326
|
+
| Catalan (ca) | Ramon Salvadó `<rsalvado at gnuine.com>` | 2.0.1 |
|
|
327
|
+
| Chinese (Simplified)(zh_CN) | Yang Bob `<bob.yang.dev at gmail.com>` *(current)* <br> Yingfeng `<blogyingfeng at gmail.com>` | 2.0.1 |
|
|
328
|
+
| Chinese (Traditional)(zh_TW) | Yang Bob `<bob.yang.dev at gmail.com>` *(current)* <br> Lin Chung-Yi `<xmarsh at gmail.com>` | 2.0.1 |
|
|
329
|
+
| Croatian (hr) | Sanjin Sehic `<saserr at gmail.com>` | 1.90.0 (old) |
|
|
330
|
+
| Czech (cs) | Karel Miarka `<kajism at yahoo.com>` | 1.9.0 (old) |
|
|
331
|
+
| Dutch (nl) | Menno Jonkers `<ruby-gettext at jonkers.com>` | 1.90.0 (old) |
|
|
332
|
+
| English (default) | | 2.1.0 |
|
|
333
|
+
| Esperanto (eo) | Malte Milatz `<malte at gmx-topmail.de>` | 2.0.1 |
|
|
334
|
+
| Estonian (et) | Erkki Eilonen `<erkki at itech.ee>` | 2.0.1 |
|
|
335
|
+
| French (fr) | Vincent Isambart `<vincent.isambart at gmail.com>` *(current)* <br> David Sulc `<davidsulc at gmail.com>` <br> Laurent Sansonetti `<laurent.sansonetti at gmail.com>` | 2.0.1 |
|
|
336
|
+
| German (de) | Patrick Lenz `<patrick at limited-overload.de>` *(current)* <br> Detlef Reichl `<detlef.reichl at gmx.org>` <br> Sven Herzberg `<herzi at abi02.de>` <br> Sascha Ebach `<se at digitale-wertschoepfung.de>` | 2.0.1 |
|
|
337
|
+
| Greek (el) | Vassilis Rizopoulos `<damphyr at gmx.net>` | 2.0.1 |
|
|
338
|
+
| Hungarian (hu) | Tamás Tompa `<tompata at gmail.com>` | 2.0.1 |
|
|
339
|
+
| Italian (it) | Marco Lazzeri `<marco.lazzeri at gmail.com>` <br> Gabriele Renzi `<surrender_it at yahoo.it>` | 1.6.0 (old) |
|
|
340
|
+
| Japanese (ja) | Masao Mutoh `<mutomasa at gmail.com>` | 2.1.0 |
|
|
341
|
+
| Korean (ko) | Gyoung-Yoon Noh `<nohmad at gmail.com>` | 1.9.0 (old)|
|
|
342
|
+
| Latvian (lv) | Aivars Akots `<aivars.akots at gmail.com>` | 2.0.1 |
|
|
343
|
+
| Norwegian (nb) | Runar Ingebrigtsen `<runar at mopo.no>` | 2.0.1 |
|
|
344
|
+
| Portuguese (Brazil)(pt_BR) | Antonio S. de A. Terceiro `<terceiro at softwarelivre.org>` *(current)* <br> Joao Pedrosa `<joaopedrosa at gmail.com>` | 2.0.1 |
|
|
345
|
+
| Russian (ru) | Yuri Kozlov `<kozlov.y at gmail.com>` | 2.0.1 |
|
|
346
|
+
| Serbian (sr) | Slobodan Paunović `<slobodan.paunovic at gmail.com>` | 2.0.1 |
|
|
347
|
+
| Spanish (es) | David Espada `<davinci at escomposlinux.org>` *(current)* <br> David Moreno Garza `<damog at damog.net>` | 2.0.1 |
|
|
348
|
+
| Swedish (sv) | Nikolai Weibull `<mailing-lists.ruby-talk at rawuncut.elitemail.org>` | 0.8.0 (very old) |
|
|
349
|
+
| Ukrainian (uk) | Alex Rootoff `<rootoff at pisem.net>` | 2.0.1 |
|
|
350
|
+
| Vietnamese (vi) | Ngoc Dao Thanh `<ngocdaothanh at gmail.com>` | 2.0.1 |
|
|
278
351
|
|
|
279
352
|
## Maintainer
|
|
280
353
|
|
|
281
354
|
* Kouhei Sutou `<kou@clear-code.com>`
|
|
282
355
|
|
|
283
|
-
|
|
356
|
+
Old maintainer
|
|
284
357
|
|
|
285
358
|
* Masao Mutoh `<mutomasa at gmail.com>`
|
|
359
|
+
|
|
360
|
+
## Links
|
|
361
|
+
|
|
362
|
+
* [Homepage](https://ruby-gettext.github.io/)
|
|
363
|
+
* [GitHub](https://github.com/ruby-gettext/gettext)
|