gettext-setup 0.31 → 0.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12e71aa5e0dfcabd81f9815b7288de5edea56295600b5b82fce740614374b948
4
- data.tar.gz: c42ce6ef320c3999fcfa6895d9c2d7ceaab93980459cfd8985a19a389eb6a08a
3
+ metadata.gz: 315986eb565027255b74f20b6280ac61bfc4fbde16f6a8834514479896d836ef
4
+ data.tar.gz: cf2cf5d708d1d9feec66908f939d512ed5b4e6cac31017c88bc0f5a7139e3ad2
5
5
  SHA512:
6
- metadata.gz: 1ee5e91fd99697e94de0f11bf162c5353e32cb86d273da51e6188e821a95065674d68aaad626c0c21a3f6e2c1ef10999c74228b62e2eb18c87b84ef97e55148a
7
- data.tar.gz: 5b384a1a0ef825e3d591fba2ce46a6356a0fb2cdfe6b03b0de89b1863db66ccc3666bb1aa79643f64974ba2f911fd81c1ba83fb26152ed390eef710c392c0302
6
+ metadata.gz: 92e1b0585eeec020a0d3cbb49c1b100cec89fa055af98c6a9f58edef7676e56f4dc29ca6704e60ab617b0e7de4c0ad2c28c2734ed49c84048a529188efc200cb
7
+ data.tar.gz: 39adfeed57383872989cce413967662f9a72cde9ebf768a261d6867d84a55fcf0055d1956064e5a4fdb72f2f4cc6ca4795a2210b5387f1754b11a40e7f973318
data/README.md CHANGED
@@ -67,7 +67,7 @@ E.g. `n_("There is %{count} bicycle in %{city}", "There are %{count} bicycles in
67
67
 
68
68
  Pluralization rules vary across languages. The pluralization rules are specified in the PO file and look something like this `Plural-Forms: nplurals=2; plural=(n > 1);`. This is the pluralization rule for German. It means that German has two pluralization rules. The first rule is `plural=n > 1)` and the second rule is all other counts.
69
69
 
70
- Plurals are selected from the PO file by index.
70
+ Plurals are selected from the PO file by index.
71
71
 
72
72
  Here's an example of how a pluralized string is handled in a PO file:
73
73
 
@@ -84,7 +84,7 @@ The `msgid_plural` is the plural version of the English source string.
84
84
 
85
85
  The two `msgstr` lines show that German has two rules for pluralization. The indices map to the `Plural-Forms: nplurals=2; plural=(n > 1);` rule that we specified in the PO file. The `[0]` index represents `plural=(n > 1)` and the `[1]` index represents all other pluralization cases (in other words, when the count equals 0 or 1).
86
86
 
87
- When Transifex generates a PO file for a specific language, it automatically adds the appropriate pluralization rules in the PO file.
87
+ When Transifex generates a PO file for a specific language, it automatically adds the appropriate pluralization rules in the PO file.
88
88
 
89
89
  ### Comments
90
90
  To provide translators with some contextual information or instructions about a string, precede the string with a comment using `#. `. The comment gets pulled in to the POT file and will show up as a comment in Transifex.
@@ -99,7 +99,7 @@ E.g. `#. The placeholder in this string represents the name of a parameter.`
99
99
 
100
100
  3. When a POT file is updated, the Transifex webhook pushes the new POT file to Transifex ready for translation. (If your POT file hasn't been added to the Transifex integration yet, you will need to get it added.)
101
101
 
102
- 4. When a PO file reaches 100% translated and reviewed, a webhook pushes it back to the source repo ready to be consumed by your app.
102
+ 4. When a PO file reaches 100% translated and reviewed, a webhook pushes it back to the source repo ready to be consumed by your app.
103
103
 
104
104
  5. Your app checks the user's locale settings (the browser settings for web apps, or the system settings for the CLI). If we support the user's preferred locale, the app will display strings in the user's language. Otherwise, it defaults to English.
105
105
 
@@ -113,3 +113,7 @@ This task will run within the gettext setup locales_path provided by GettextSetu
113
113
  By default, the merged pot file is locales_path/project_name.pot. This can be overridden when calling the method by providing a chosen path.
114
114
 
115
115
  Please note: Since the default merged file name is project_name.pot, it will override anything of that name within the locales directory.
116
+
117
+ ## Making releases
118
+
119
+ Add the tag you wish to release (via the bot in the release channel is preferred) and then `gem build gettext-setup.gemspec` and then `gem push gettext-setup-<version>.gem`. (you will need to be an owner to push).
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'metadata_pot/metadata_pot'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'gettext-setup/gettext_setup'
2
4
  require 'gettext-setup/metadata_pot'
3
5
  require 'gettext-setup/pot'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fast_gettext'
2
4
  require 'yaml'
3
5
  require 'locale'
@@ -23,7 +25,7 @@ module GettextSetup
23
25
  GettextSetup.initialize_config(locales_path)
24
26
 
25
27
  # Make the translation methods available everywhere
26
- Object.send(:include, FastGettext::Translation)
28
+ Object.include FastGettext::Translation
27
29
 
28
30
  # Define our text domain, and set the path into our root. I would prefer to
29
31
  # have something smarter, but we really want this up earlier even than our
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'erb'
2
4
  require 'json'
3
5
  require 'date'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'open3'
2
4
  require 'English'
3
5
  require 'tempfile'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../gettext-setup/gettext_setup'
2
4
  require_relative '../gettext-setup/pot'
3
5
  require_relative '../gettext-setup/metadata_pot'
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  _('Hello, world!')
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'rspec/expectations'
4
5
  require_relative '../../spec_helper'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/expectations'
2
4
  require 'tmpdir'
3
5
  require_relative '../../spec_helper'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/expectations'
2
4
  require 'tmpdir'
3
5
  require_relative '../../spec_helper.rb'
@@ -60,7 +62,7 @@ describe GettextSetup::Pot do
60
62
  expect(contents).to match(/Fixture locales/)
61
63
  expect(contents).to match(/docs@puppetlabs.com/)
62
64
  expect(contents).to match(/Puppet, LLC/)
63
- expect(contents).to match(/test_strings.rb:1/)
65
+ expect(contents).to match(/test_strings.rb:3/)
64
66
  end
65
67
  it 'builds a POT file with :header_only' do
66
68
  path = File.join(Dir.mktmpdir, 'new.pot')
@@ -82,6 +84,8 @@ describe GettextSetup::Pot do
82
84
  expect { GettextSetup::Pot.generate_new_po('ja', Dir.mktmpdir, path, po_path) }.to raise_error(NoConfigFoundError)
83
85
  end
84
86
  it 'complains when no language is supplied' do
87
+ allow(ENV).to receive(:[]).and_call_original
88
+ allow(ENV).to receive(:[]).with('LANGUAGE').and_return(nil)
85
89
  result = "You need to specify the language to add. Either 'LANGUAGE=eo rake gettext:po' or 'rake gettext:po[LANGUAGE]'\n"
86
90
  expect do
87
91
  GettextSetup::Pot.generate_new_po(nil, fixture_locales_path, Dir.mktmpdir, Dir.mktmpdir)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/expectations'
2
4
  require 'rake'
3
5
  require_relative '../../spec_helper.rb'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'simplecov'
2
4
  require_relative '../lib/gettext-setup'
3
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext-setup
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.31'
4
+ version: '0.32'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2020-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_gettext
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.0.2
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 3.3.0
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@ dependencies:
38
41
  - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: 3.0.2
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: 3.3.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: locale
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +62,16 @@ dependencies:
56
62
  name: bundler
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
- - - "~>"
65
+ - - ">="
60
66
  - !ruby/object:Gem::Version
61
- version: '1.3'
67
+ version: '0'
62
68
  type: :development
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - "~>"
72
+ - - ">="
67
73
  - !ruby/object:Gem::Version
68
- version: '1.3'
74
+ version: '0'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: rake
71
77
  requirement: !ruby/object:Gem::Requirement