fast_gettext 0.9.1 → 0.9.2
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/lib/fast_gettext/vendor/README.rdoc +236 -0
- data/lib/fast_gettext/vendor/empty.mo +0 -0
- data/lib/fast_gettext/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8223fdf6163640df93d9bf2d85845b2472f43da
|
4
|
+
data.tar.gz: dd4ca7c177c493a96fc48b9d84e9393a9a42511b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4d473de9847b436a691ffeb37a0a684f0bd890a7ef863d1d6e8a879283ab0b4b3acaa4215ee7c52ca50dcc819dddb2e2654b347078cb872c820e6300d92712c
|
7
|
+
data.tar.gz: 17380612d276740536201c724d6360940b0cb51f12b9f67bfae570438c0ec9704c2b1fe81bafc360bdb0973b3a5775a54fedb95857257592badd84ed5261d91e
|
@@ -0,0 +1,236 @@
|
|
1
|
+
= Ruby-GetText-Package
|
2
|
+
|
3
|
+
Ruby-GetText-Package is a Localization(L10n) library and tool
|
4
|
+
which is modeled after the GNU gettext package.
|
5
|
+
|
6
|
+
This library translates original messages to localized
|
7
|
+
messages using client-side locale information(environment
|
8
|
+
variable or CGI variable).
|
9
|
+
|
10
|
+
The tools for developers support creating, useing, and modifying
|
11
|
+
localized message files(message catalogs).
|
12
|
+
|
13
|
+
((*Rails*))
|
14
|
+
Rails support has been removed.
|
15
|
+
Rails / ActiveRecord specific code now lives in gettext_rails and gettext_activerecord.
|
16
|
+
|
17
|
+
== Website
|
18
|
+
* homepage[http://www.yotabanana.com/hiki/ruby-gettext.html]
|
19
|
+
* on rubyforge[http://gettext/rubyforge.org/]
|
20
|
+
* on github[http://github.com/gettext/]
|
21
|
+
|
22
|
+
== Features
|
23
|
+
* Simple APIs(similar to GNU gettext)
|
24
|
+
|
25
|
+
* rgettext creates po-files from
|
26
|
+
* ruby scripts
|
27
|
+
* glade-2 XML file(.glade)
|
28
|
+
* ERB file(.rhtml, .erb)
|
29
|
+
* Anything (with your own parsers)
|
30
|
+
* The po-files are compatible to GNU gettext.
|
31
|
+
|
32
|
+
* rmsgfmt creates a mo-file from a po-file.
|
33
|
+
The mo-file is compatible to GNU gettext(msgfmt).
|
34
|
+
|
35
|
+
* textdomain's scope is adapt to ruby class/module mechanism.
|
36
|
+
* A class/module can have plural textdomains.
|
37
|
+
* a message is looked up in its class/module and ancestors.
|
38
|
+
|
39
|
+
* CGI support (gettext/cgi)
|
40
|
+
* Locale is retrieved from client informations
|
41
|
+
(HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT_CHARSET, QUERY_STRING(lang), Cookies(lang)).
|
42
|
+
|
43
|
+
* String%() is extended to use named argument such as <tt>%{foo}" %{:foo => 1}</tt>.
|
44
|
+
Notes that Ruby-1.9.x supports this format by itself.
|
45
|
+
|
46
|
+
== Requirements
|
47
|
+
* {Ruby 1.8.3 or later}[http://www.ruby-lang.org]
|
48
|
+
* {Rubygems}[http://www.rubygems.org/]
|
49
|
+
* {locale gem}[http://rubyforge.org/projects/locale/]
|
50
|
+
* $ gem install locale
|
51
|
+
* (for development only)
|
52
|
+
* {GNU gettext 0.10.35 or later}[http://www.gnu.org/software/gettext/gettext.html]
|
53
|
+
* {Racc-1.4.3 or later}[http://www.ruby-lang.org/raa/list.rhtml?name=racc]
|
54
|
+
* (for compiling src/rmsgfmt.ry only)
|
55
|
+
|
56
|
+
== Install
|
57
|
+
* Uninstall old gettext if exists.
|
58
|
+
(sudo/su on POSIX system)
|
59
|
+
gem uninstall gettext
|
60
|
+
|
61
|
+
* gem
|
62
|
+
#from github (edge/unstable)
|
63
|
+
(sudo/su on POSIX system)
|
64
|
+
gem install locale
|
65
|
+
gem install mutoh-gettext -s http://gems.github.com/
|
66
|
+
|
67
|
+
#from rubyforge (stable)
|
68
|
+
(sudo/su on POSIX system)
|
69
|
+
gem install locale
|
70
|
+
gem install gettext
|
71
|
+
|
72
|
+
* download tar-ball
|
73
|
+
# De-Compress archive and enter its top directory.
|
74
|
+
(sudo/su on POSIX system)
|
75
|
+
ruby setup.rb
|
76
|
+
|
77
|
+
You can also install files in your favorite directory by
|
78
|
+
supplying setup.rb some options. Try <tt>ruby setup.rb --help</tt>.
|
79
|
+
|
80
|
+
== Usage
|
81
|
+
===Translation
|
82
|
+
- _: Basic translation method
|
83
|
+
Translates the message.
|
84
|
+
_("Hello")
|
85
|
+
|
86
|
+
The gettext methods comes in 3 combinable flavors
|
87
|
+
- n: Pluralized
|
88
|
+
Returns singular or plural form, depending on how many you have.
|
89
|
+
n_("Apple", "%{num} Apples", 3)
|
90
|
+
n_(["Apple", "%{num} Apples"], 3)
|
91
|
+
|
92
|
+
- p: context aware
|
93
|
+
A context is a prefix to your translation, usefull when one word has different meanings, depending on its context.
|
94
|
+
p_("Printer","Open") <=> p_("File","Open")
|
95
|
+
is the same as s_("Printer|Open") <=> s_("File|Open")
|
96
|
+
|
97
|
+
- s: without context
|
98
|
+
If a translation could not be found, return the msgid without context.
|
99
|
+
s_("Printer|Open") => "Öffnen" #translation found
|
100
|
+
s_("Printer|Open") => "Open" #translation not found
|
101
|
+
|
102
|
+
- combinations
|
103
|
+
np_("Fruit", "Apple", "%{num} Apples", 3)
|
104
|
+
ns_("Fruit|Apple","%{num} Apples", 3)
|
105
|
+
|
106
|
+
np_(["Fruit","Apple","%{num} Apples"], 3)
|
107
|
+
ns_(["Fruit|Apple","%{num} Apples"], 3)
|
108
|
+
|
109
|
+
- N_, Nn_: Makes dynamic translation messages readable for the gettext parser.
|
110
|
+
<tt>_(fruit)</tt> cannot be understood by the gettext parser. To help the parser find all your translations,
|
111
|
+
you can add <tt>fruit = N_("Apple")</tt> which does not translate, but tells the parser: "Apple" needs translation.
|
112
|
+
|
113
|
+
fruit = N_("Apple") # same as fruit = "Apple"
|
114
|
+
_(fruit) # does a normal translation
|
115
|
+
|
116
|
+
fruits = Nn_("Apple", "%{num} Apples")
|
117
|
+
n_(fruits, 3)
|
118
|
+
|
119
|
+
=== Locale / Domain
|
120
|
+
GetText stores the locale your are using
|
121
|
+
GetText.locale = "en_US" # translate into english from now on
|
122
|
+
GetText.locale # => en_US
|
123
|
+
Or
|
124
|
+
include GetText
|
125
|
+
set_locale "en_US"
|
126
|
+
|
127
|
+
Each locale can have different sets of translations (text domains) (e.g. Financial terms + Human-resource terms)
|
128
|
+
GetText.bindtextdomain('financial')
|
129
|
+
Or
|
130
|
+
include GetText
|
131
|
+
bindtextdomain('financial')
|
132
|
+
|
133
|
+
For more details and options, have a look at the samples folder or
|
134
|
+
consult the tutorial[http://www.yotabanana.com/hiki/ruby-gettext-howto.html].
|
135
|
+
|
136
|
+
|
137
|
+
== License
|
138
|
+
This program is licenced under the same licence as Ruby.
|
139
|
+
(See the file 'COPYING'.)
|
140
|
+
|
141
|
+
* mofile.rb
|
142
|
+
* Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
|
143
|
+
* Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
|
144
|
+
|
145
|
+
* gettext.rb
|
146
|
+
* Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
|
147
|
+
* Copyright (C) 2001,2002 Masahiro Sakai <s01397ms at sfc.keio.ac.jp>
|
148
|
+
|
149
|
+
* rgettext
|
150
|
+
* Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
|
151
|
+
* Copyright (C) 2001,2002 Yasushi Shoji <yashi at atmark-techno.com>
|
152
|
+
|
153
|
+
* setup.rb
|
154
|
+
* Copyright (C) 2000-2005 Minero Aoki <aamine at loveruby.net>
|
155
|
+
* This file is released under LGPL. See the top of the install.rb.
|
156
|
+
|
157
|
+
* Others
|
158
|
+
* Copyright (C) 2001-2009 Masao Mutoh <mutoh at highwhay.ne.jp>
|
159
|
+
|
160
|
+
|
161
|
+
== Translators
|
162
|
+
* Bosnian(bs) - Sanjin Sehic <saserr at gmail.com>
|
163
|
+
* Bulgarian(bg) - Sava Chankov <sava.chankov at gmail.com>
|
164
|
+
* Catalan(ca) - Ramon Salvadó <rsalvado at gnuine.com>
|
165
|
+
* Chinese(Simplified)(zh_CN)
|
166
|
+
* Yang Bob <bob.yang.dev at gmail.com> (current)
|
167
|
+
* Yingfeng <blogyingfeng at gmail.com>
|
168
|
+
* Chinese(Traditional)(zh_TW)
|
169
|
+
* Yang Bob <bob.yang.dev at gmail.com> (current)
|
170
|
+
* LIN CHUNG-YI <xmarsh at gmail.com>
|
171
|
+
* Croatian(hr) - Sanjin Sehic <saserr at gmail.com>
|
172
|
+
* Czech(cs) - Karel Miarka <kajism at yahoo.com>
|
173
|
+
* Dutch(nl) - Menno Jonkers <ruby-gettext at jonkers.com>
|
174
|
+
* Esperanto(eo) - Malte Milatz <malte at gmx-topmail.de>
|
175
|
+
* Estonian(et) - Erkki Eilonen <erkki at itech.ee>
|
176
|
+
* French(fr)
|
177
|
+
* Vincent Isambart <vincent.isambart at gmail.com> (current)
|
178
|
+
* David Sulc <davidsulc at gmail.com>
|
179
|
+
* Laurent Sansonetti <laurent.sansonetti at gmail.com>
|
180
|
+
* German(de)
|
181
|
+
* Patrick Lenz <patrick at limited-overload.de> (current)
|
182
|
+
* Detlef Reichl <detlef.reichl at gmx.org>
|
183
|
+
* Sven Herzberg <herzi at abi02.de>
|
184
|
+
* Sascha Ebach <se at digitale-wertschoepfung.de>
|
185
|
+
* Greek(el) - Vassilis Rizopoulos <damphyr at gmx.net>
|
186
|
+
* Hungarian(hu) - Tamás Tompa <tompata at gmail.com>
|
187
|
+
* Italian(it)
|
188
|
+
* Marco Lazzeri <marco.lazzeri at gmail.com>
|
189
|
+
* Gabriele Renzi <surrender_it at yahoo.it>
|
190
|
+
* Japanese(ja) - Masao Mutoh <mutoh at highway.ne.jp>
|
191
|
+
* Korean(ko) - Gyoung-Yoon Noh <nohmad at gmail.com>
|
192
|
+
* Latvian(lv) - Aivars Akots <aivars.akots at gmail.com>
|
193
|
+
* Norwegian(nb) - Runar Ingebrigtsen <runar at mopo.no>
|
194
|
+
* Portuguese(Brazil)(pt_BR)
|
195
|
+
* Antonio S. de A. Terceiro <terceiro at softwarelivre.org> (current)
|
196
|
+
* Joao Pedrosa <joaopedrosa at gmail.com>
|
197
|
+
* Russian(ru) - Yuri Kozlov <kozlov.y at gmail.com>
|
198
|
+
* Serbian(sr) - Slobodan Paunović" <slobodan.paunovic at gmail.com>
|
199
|
+
* Spanish(es)
|
200
|
+
* David Espada <davinci at escomposlinux.org> (current)
|
201
|
+
* David Moreno Garza <damog at damog.net>
|
202
|
+
* Swedish(sv) - Nikolai Weibull <mailing-lists.ruby-talk at rawuncut.elitemail.org>
|
203
|
+
* Ukrainian(ua) - Alex Rootoff <rootoff at pisem.net>
|
204
|
+
* Vietnamese(vi) - Ngoc Dao Thanh <ngocdaothanh at gmail.com>
|
205
|
+
|
206
|
+
== Status of translations
|
207
|
+
* Bosnian(bs) - 1.90.0 (old)
|
208
|
+
* Bulgarian(bg) - 2.0.0pre1 (new)
|
209
|
+
* Catalan(ca) - 2.0.0pre1
|
210
|
+
* Croatian(hr) - 1.90.0 (old)
|
211
|
+
* Chinese(zh_CN) - 2.0.0pre1
|
212
|
+
* Chinese(zh_TW) - 2.0.0pre1
|
213
|
+
* Czech(cs) - 1.9.0 (old)
|
214
|
+
* Dutch(nl) - 1.90.0 (old)
|
215
|
+
* English(default) - 1.90.0 (old)
|
216
|
+
* Esperanto(eo) - 2.0.0pre1
|
217
|
+
* Estonian(et) - 2.0.0pre1
|
218
|
+
* French(fr) - 2.0.0pre1
|
219
|
+
* German(de) - 2.0.0pre1
|
220
|
+
* Greek(el) - 2.0.0pre1
|
221
|
+
* Hungarian(hu) - 2.0.0pre1
|
222
|
+
* Italian(it) - 1.6.0 (old)
|
223
|
+
* Japanese(ja) - 2.0.0pre1
|
224
|
+
* Korean(ko) - 1.9.0 (old)
|
225
|
+
* Latvian(lv) - 2.0.0pre1 (new)
|
226
|
+
* Norwegian(nb) - 2.0.0pre1
|
227
|
+
* Portuguese(Brazil)(pt_BR) - 2.0.0pre1
|
228
|
+
* Russian(ru) - 2.0.0pre1
|
229
|
+
* Serbian(sr) - 1.91.0 (old)
|
230
|
+
* Spanish(es) - 2.0.0pre1
|
231
|
+
* Swedish(sv) - 0.8.0 (too much old)
|
232
|
+
* Ukrainian(ua) - 2.0.0pre1
|
233
|
+
* Vietnamese(vi) - 2.0.0pre1
|
234
|
+
|
235
|
+
== Maintainer
|
236
|
+
Masao Mutoh <mutoh at highway.ne.jp>
|
Binary file
|
data/lib/fast_gettext/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_gettext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -132,6 +132,8 @@ files:
|
|
132
132
|
- lib/fast_gettext/translation_repository/mo.rb
|
133
133
|
- lib/fast_gettext/translation_repository/po.rb
|
134
134
|
- lib/fast_gettext/translation_repository/yaml.rb
|
135
|
+
- lib/fast_gettext/vendor/README.rdoc
|
136
|
+
- lib/fast_gettext/vendor/empty.mo
|
135
137
|
- lib/fast_gettext/vendor/iconv.rb
|
136
138
|
- lib/fast_gettext/vendor/mofile.rb
|
137
139
|
- lib/fast_gettext/vendor/poparser.rb
|