PoParser 3.1.0 → 3.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 529c54e8854a295bac23c8873ecb6111d85b421f
4
- data.tar.gz: 76dfc88f971f62fc0f469835ab70e8730d8d4fbc
3
+ metadata.gz: 8018502bc7916464ebfb10b8c921f0f598f1df84
4
+ data.tar.gz: 68ff2631dd26b8b483e15a4fa74973dbc4036a77
5
5
  SHA512:
6
- metadata.gz: 1cbf07f2d14cddf89616a40028c73bc4cb828b3f1b74500477fc351b1852a1612b0fcca17410335201db1a514d2aa24ab7711ff30f1d38859b31457cf1802c1a
7
- data.tar.gz: 9c873d0bf1c394b5d0e1806938770a5c0ec494ec624f226673076890884a0cf60a7ed342ffd5b5011fab64bbb55558e3943d45d22de66c8090cd1c0bf7e8b7f0
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, to the [issue tracker](https://github.com/arashm/PoParser/issues).
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 yourself as:
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
- Adding plural string is the same:
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
- Note: currently `PoParser` won't warn you if you add a `msgstr[0]` without `msgid_plural`, any `msgid` at all or even if index numbers in `msgstr[0]` are not in any logical order.
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 the `Entry`:
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
- But be careful with plural messages, there msgstr is an array
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
@@ -7,7 +7,7 @@ module PoParser
7
7
 
8
8
  def extract_entries(path)
9
9
  @po.path = path
10
- File.open(path, 'r').each_line("\n\n") do |block|
10
+ File.open(path, 'r:utf-8').each_line("\n\n") do |block|
11
11
  block.strip!
12
12
  @po << parse_block(block) if block != ''
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module PoParser
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
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.0
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-04 00:00:00.000000000 Z
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