twine 1.1.1 → 1.1.2

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: 2f4d5f35555d309af477e468d170c086657eafb79659040f23d9a3803c0b59f2
4
- data.tar.gz: 6d6858513e345694beb1c031b5a1753a45d31e1038023794a7315b7953df90bd
3
+ metadata.gz: 381bd0d84850220b7ef1f8071a7398eb6c61e1f7c5bc057e5d96cd259f0f4578
4
+ data.tar.gz: 04a94d58790f88c95cf3ae000986f7f0df62165e2749cdc22e409fef391e2760
5
5
  SHA512:
6
- metadata.gz: ae57c2695b90b0c641b10c54f851543870bf4d2025197c634a5ad7bb0405befa7c29b2b5dff0430e5d6015e8346c202e036298032fb4d2b65fd95d267a797e16
7
- data.tar.gz: a71413208993949abca200308296790e8f3a163430b7aa1d8381f2961437e2049480086521835f2c8920b5eb95a03cfc1736063d81f1bd6df570da9472231679
6
+ metadata.gz: f14b9de69dcd4a533fa5b769dc42a2601caec06d41e04470188fa3a59a3e418d53e2d2994bce2c119fec6fee8252a7d7e421b58cd90316e98a527422c6a19551
7
+ data.tar.gz: 60bc8c8c800d1f4b3e3b1664504052bf4dc561fe97f1e62b361943de6567e5a5d22902c98f485e03f1e651f76765a7951142c915576ee80dfc6ae933df12139c
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Twine
2
2
 
3
- [![Continuous Integration by CircleCI](https://circleci.com/gh/scelis/twine.svg?style=shield)](https://circleci.com/gh/scelis/twine)
4
-
5
3
  Twine is a command line tool for managing your strings and their translations. These are all stored in a single text file and then Twine uses this file to import and export localization files in a variety of types, including iOS and Mac OS X `.strings` files, Android `.xml` files, gettext `.po` files, and [jquery-localize][jquerylocalize] `.json` files. This allows individuals and companies to easily share translations across multiple projects, as well as export localization files in any format the user wants.
6
4
 
7
5
  ## Install
@@ -24,7 +22,7 @@ Twine supports [`printf` style placeholders][printf] with one peculiarity: `@` i
24
22
 
25
23
  Tags are used by Twine as a way to only work with a subset of your definitions at any given point in time. Each definition can be assigned zero or more tags which are separated by commas. Tags are optional, though highly recommended. You can get a list of all definitions currently missing tags by executing the [`validate-twine-file`](#validate-twine-file) command with the `--pedantic` option.
26
24
 
27
- When generating a localization file, you can specify which definitions should be included using the `--tags` option. Provide a comma separated list of tags to match all definitions that contain any of the tags (`--tags tag1,tag2` matches all definitions tagged with `tag1` _or_ `tag2`). Provide multiple `--tags` options to match defintions containing all specified tags (`--tags tag1 --tags tag2` matches all definitions tagged with `tag1` _and_ `tag2`). You can match definitions _not_ containing a tag by prefixing the tag with a tilde (`--tags ~tag1` matches all definitions _not_ tagged with `tag1`). All three options are combinable.
25
+ When generating a localization file, you can specify which definitions should be included using the `--tags` option. Provide a comma separated list of tags to match all definitions that contain any of the tags (`--tags tag1,tag2` matches all definitions tagged with `tag1` _or_ `tag2`). Provide multiple `--tags` options to match definitions containing all specified tags (`--tags tag1 --tags tag2` matches all definitions tagged with `tag1` _and_ `tag2`). You can match definitions _not_ containing a tag by prefixing the tag with a tilde (`--tags ~tag1` matches all definitions _not_ tagged with `tag1`). All three options are combinable.
28
26
 
29
27
  ### Whitespace
30
28
 
@@ -81,7 +79,7 @@ Twine currently supports the following output formats:
81
79
  * HTML tags will be escaped by replacing `<` with `&lt`
82
80
  * Tags inside `<![CDATA[` won't be escaped.
83
81
  * Supports [basic styling][androidstyling] according to [Android documentation](https://developer.android.com/guide/topics/resources/string-resource.html#StylingWithHTML). All of the documented tags are supported, in addition to `<a>` links.
84
- * These tags will *not* be escaped if the string doesn't contain placeholders. You can reference them directly in your layouts or by using [`getText()`](https://developer.android.com/reference/android/content/res/Resources.html#getText(int)) to read them programatically.
82
+ * These tags will *not* be escaped if the string doesn't contain placeholders. You can reference them directly in your layouts or by using [`getText()`](https://developer.android.com/reference/android/content/res/Resources.html#getText(int)) to read them programmatically.
85
83
  * These tags *will* be escaped if the string contains placeholders. You can use [`getString()`](https://developer.android.com/reference/android/content/res/Resources.html#getString(int,%20java.lang.Object...)) combined with [`fromHtml`](https://developer.android.com/reference/android/text/Html.html#fromHtml(java.lang.String)) as shown in the [documentation][androidstyling] to display them.
86
84
  * See [\#212](https://github.com/scelis/twine/issues/212) for details.
87
85
  * [Gettext PO Files][gettextpo] (format: gettext)
@@ -203,7 +201,7 @@ buildscript {
203
201
  repositories { jcenter() }
204
202
 
205
203
  dependencies {
206
- /* NOTE: Set your prefered version of jruby here. */
204
+ /* NOTE: Set your preferred version of jruby here. */
207
205
  classpath "com.github.jruby-gradle:jruby-gradle-plugin:1.5.0"
208
206
  }
209
207
  }
@@ -211,7 +209,7 @@ buildscript {
211
209
  apply plugin: 'com.github.jruby-gradle.base'
212
210
 
213
211
  dependencies {
214
- /* NOTE: Set your prefered version of twine here. */
212
+ /* NOTE: Set your preferred version of twine here. */
215
213
  jrubyExec 'rubygems:twine:1.1'
216
214
  }
217
215
 
@@ -13,6 +13,7 @@ module Twine
13
13
 
14
14
  def fallback_languages(language)
15
15
  fallback_mapping = {
16
+ 'zh-CN' => 'zh-Hans', # if we don't have a zh-CN translation, try zh-Hans before en
16
17
  'zh-TW' => 'zh-Hant' # if we don't have a zh-TW translation, try zh-Hant before en
17
18
  }
18
19
 
@@ -44,7 +44,7 @@ module Twine
44
44
  end
45
45
 
46
46
  def translation_for_lang(lang)
47
- translation = [lang].flatten.map { |l| @translations[l] }.first
47
+ translation = [lang].flatten.map { |l| @translations[l] }.compact.first
48
48
 
49
49
  translation = reference.translation_for_lang(lang) if translation.nil? && reference
50
50
 
data/lib/twine/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Twine
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Celis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-28 00:00:00.000000000 Z
11
+ date: 2022-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rexml
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.2'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rubyzip
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -170,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - ">="
172
186
  - !ruby/object:Gem::Version
173
- version: '2.4'
187
+ version: '2.6'
174
188
  required_rubygems_version: !ruby/object:Gem::Requirement
175
189
  requirements:
176
190
  - - ">="