PoParser 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +10 -8
- data/lib/poparser/tokenizer.rb +1 -1
- data/lib/poparser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8018502bc7916464ebfb10b8c921f0f598f1df84
|
4
|
+
data.tar.gz: 68ff2631dd26b8b483e15a4fa74973dbc4036a77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5901356040586719f2f8e976902673bbc7e9c700fee986969779ef530f4abee445df61cd47648d3e952173f4d6d98abb77e4f683ee4549013f6ff6681c64ba19
|
7
|
+
data.tar.gz: '02183e6e633d9218dd15c10318401470517e788e57808f12212a48b024d3985230b38024cfbe56ff8a75a0e5b340e6cfcfaf00899e7a4090c4ede6a6c93f09bf'
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
|
2
|
+
3.1.1 / 2017-06-22
|
3
|
+
==================
|
4
|
+
|
5
|
+
* force the tokenizer to load files in utf-8 (#20)
|
6
|
+
This will fix the issue with the lib not working correctly on Windows.
|
7
|
+
Courtesy of @damphyr
|
8
|
+
* Review readme
|
9
|
+
|
1
10
|
3.1.0 / 2017-06-04
|
2
11
|
==================
|
3
12
|
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[![Code Climate](https://codeclimate.com/github/arashm/PoParser.png)](https://codeclimate.com/github/arashm/PoParser)
|
6
6
|
[![Gem Version](https://badge.fury.io/rb/PoParser.svg)](http://badge.fury.io/rb/PoParser)
|
7
7
|
|
8
|
-
A Ruby PO file parser, editor and generator. PO files are translation files generated by GNU/Gettext tool. This GEM is compatible with [GNU PO file specification](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html). report misbehaviours and bugs
|
8
|
+
A Ruby PO file parser, editor and generator. PO files are translation files generated by GNU/Gettext tool. This GEM is compatible with [GNU PO file specification](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html). report misbehaviours and bugs to the [issue tracker](https://github.com/arashm/PoParser/issues).
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
@@ -17,7 +17,7 @@ And then execute:
|
|
17
17
|
|
18
18
|
$ bundle install
|
19
19
|
|
20
|
-
Or install it
|
20
|
+
Or globally install it:
|
21
21
|
|
22
22
|
$ gem install PoParser
|
23
23
|
|
@@ -79,7 +79,7 @@ po << new_entry
|
|
79
79
|
|
80
80
|
You can pass an array of hashes to `new_entry` and it will be added to `PO` file.
|
81
81
|
|
82
|
-
|
82
|
+
Similarly you can add plural strings:
|
83
83
|
|
84
84
|
```ruby
|
85
85
|
new_entry = {
|
@@ -92,7 +92,7 @@ new_entry = {
|
|
92
92
|
|
93
93
|
```
|
94
94
|
|
95
|
-
|
95
|
+
_Note_: currently `PoParser` won't warn you if you add a `msgstr[0]` without `msgid_plural`, any `msgid` at all or even if the index numbers in `msgstr[0]` are not in any logical order.
|
96
96
|
|
97
97
|
### Entry
|
98
98
|
|
@@ -115,7 +115,7 @@ msgctxt
|
|
115
115
|
|
116
116
|
#### Working with entries
|
117
117
|
|
118
|
-
The `PO` object contains many `Entry` objects. Number of methods are available to check state of
|
118
|
+
The `PO` object contains many `Entry` objects. Number of methods are available to check state of an `Entry`:
|
119
119
|
|
120
120
|
```ruby
|
121
121
|
entry = po.entries[1]
|
@@ -142,14 +142,15 @@ entry.msgstr.to_s
|
|
142
142
|
#=> "This entry is translated"
|
143
143
|
```
|
144
144
|
|
145
|
-
|
145
|
+
Note that msgstr for plural entries are returned as Array:
|
146
|
+
|
146
147
|
```ruby
|
147
148
|
if entry.plural?
|
148
149
|
entry.msgstr.each do |msgstr|
|
149
150
|
msgstr.to_s
|
150
151
|
#=> This is one of the plural translations
|
151
|
-
end
|
152
|
-
end
|
152
|
+
end
|
153
|
+
end
|
153
154
|
```
|
154
155
|
|
155
156
|
You can mark an entry as fuzzy:
|
@@ -186,6 +187,7 @@ po.search_in(:msgstr, 'some string to search')
|
|
186
187
|
This method returns an array of matched entries.
|
187
188
|
|
188
189
|
### Saving
|
190
|
+
|
189
191
|
You can simply save the PO file using the `PO` object:
|
190
192
|
|
191
193
|
```ruby
|
data/lib/poparser/tokenizer.rb
CHANGED
data/lib/poparser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: PoParser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arash Mousavi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_po_parser
|