singleton-client-test 0.7.0.35 → 0.7.0.36

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: f3e8238d56c7bd59283a05c0f30ee88385677bfd197c1f7320e82e6108f63d59
4
- data.tar.gz: a3ff43a0f21730f0fda7e4862f2f523cdd35df110e541566bd267c08e1f3ed3d
3
+ metadata.gz: bf77c54658953532871e1efcaeefdd2eeafe82d79d45de57341bc1f36faef8c7
4
+ data.tar.gz: '031790359ed9af74295e1679aae41a486da96104ae3a02421494c1a6a3593fd4'
5
5
  SHA512:
6
- metadata.gz: 8209bba95fb8302ef10c6a09814b293ddfa5dd247fbb89061f4cf728ba29d0aa472834c5a5557cc65cff6a9d9020bcbe90c1204d8cd2a1698186e90496fb131e
7
- data.tar.gz: 31ffc43ebb7ef7be54bee69b557f2e141ee7e8ad220588a707cb78c8972cfae8fcd3edafe0ceffc18f9ecbc61f77b73b9af319d3fbdecaf4712a1f6b581b524f
6
+ metadata.gz: 48113ab44d513f63789e7821340fc2de03e8f0c2a73063354ea7fc35b378b8d1f48b22ac3fc4d444c95a810e95a80cee02d8a44866153c82fa39300c1cf142ca
7
+ data.tar.gz: 05ba491346a1079a8d4b793d3d7d727aaec7ced066d7410df3b11e8a602700ba46a2fee5504649877db567ee5adaa492ab0bc0702925bad230bd6771b4aeb002
data/README.md CHANGED
@@ -14,40 +14,40 @@ Basic Usage:
14
14
  ```ruby
15
15
  require 'singleton-client'
16
16
 
17
- Singleton.load_config(file, env)
18
- result = Singleton.translate(key, component, locale)
17
+ Sgtn.load_config(file, env)
18
+ result = Sgtn.translate(key, component, locale)
19
19
  ```
20
20
  ## API Usage
21
21
 
22
22
  ### Get a string's translation
23
- `result = Singleton.translate(key, component, locale)`
23
+ `result = Sgtn.translate(key, component, locale)`
24
24
 
25
25
  ### Get a string's translation with default value when no translation
26
- `result = Singleton.translate(key, component, locale) { 'default value' }`
26
+ `result = Sgtn.translate(key, component, locale) { 'default value' }`
27
27
 
28
28
  ### Get a string's translation and format it with placeholders
29
- `result = Singleton.translate(key, component, locale, **args)`
29
+ `result = Sgtn.translate(key, component, locale, **args)`
30
30
 
31
31
  ### Get pluralized translation
32
- `result = Singleton.translate(key, component, locale, **args)`
32
+ `result = Sgtn.translate(key, component, locale, **args)`
33
33
 
34
34
  ### Get translations of a bundle
35
- `result = Singleton.get_translations(component, locale)`
35
+ `result = Sgtn.get_translations(component, locale)`
36
36
 
37
37
  ### Set locale for a request
38
- `Singleton.locale = 'en'`
38
+ `Sgtn.locale = 'en'`
39
39
 
40
40
  ### Get locale of the request
41
- `result = Singleton.locale`
41
+ `result = Sgtn.locale`
42
42
 
43
43
  ### Get a string's translation with locale set
44
44
  ```ruby
45
- Singleton.locale = 'en'
46
- result = Singleton.translate(key, component)
45
+ Sgtn.locale = 'en'
46
+ result = Sgtn.translate(key, component)
47
47
  ```
48
48
 
49
49
  ### Get translations of a bundle with locale set
50
50
  ```ruby
51
- Singleton.locale = 'en'
52
- result = Singleton.get_translations(component)
51
+ Sgtn.locale = 'en'
52
+ result = Sgtn.get_translations(component)
53
53
  ```
@@ -6,19 +6,19 @@ require 'request_store'
6
6
  module SgtnClient
7
7
  module Translation
8
8
  module Implementation
9
- # <b>DEPRECATED:</b> Please use <tt>Singleton:translate</tt> instead.
9
+ # <b>DEPRECATED:</b> Please use <tt>Sgtn:translate</tt> instead.
10
10
  def getString(component, key, locale)
11
11
  SgtnClient.logger.debug "[Translation.getString]component: #{component}, key: #{key}, locale: #{locale}"
12
12
  translate(key, component, locale) { nil }
13
13
  end
14
14
 
15
- # <b>DEPRECATED:</b> Please use <tt>Singleton:translate</tt> instead.
15
+ # <b>DEPRECATED:</b> Please use <tt>Sgtn:translate</tt> instead.
16
16
  def getString_p(component, key, plural_args, locale)
17
17
  SgtnClient.logger.debug "[Translation][getString_p]component=#{component}, key=#{key}, locale=#{locale}"
18
18
  translate(key, component, locale, **plural_args) { nil }
19
19
  end
20
20
 
21
- # <b>DEPRECATED:</b> Please use <tt>Singleton:translate</tt> instead.
21
+ # <b>DEPRECATED:</b> Please use <tt>Sgtn:translate</tt> instead.
22
22
  def getString_f(component, key, args, locale, *_optionals)
23
23
  SgtnClient.logger.debug "[Translation][getString_f]component=#{component}, key=#{key}, locale=#{locale}"
24
24
  s = translate(key, component, locale) { nil }
@@ -34,7 +34,7 @@ module SgtnClient
34
34
  s
35
35
  end
36
36
 
37
- # <b>DEPRECATED:</b> Please use <tt>Singleton:get_translations</tt> instead.
37
+ # <b>DEPRECATED:</b> Please use <tt>Sgtn:get_translations</tt> instead.
38
38
  def getStrings(component, locale)
39
39
  get_translations(component, locale)
40
40
  end
@@ -2,6 +2,7 @@
2
2
  # SPDX-License-Identifier: EPL-2.0
3
3
 
4
4
  String.class_eval <<-LOCALIZE, __FILE__, __LINE__ + 1
5
+ # <b>DEPRECATED:</b> Please use <tt>Sgtn:translate</tt> instead.
5
6
  def to_plural_s(locale, arg)
6
7
  num_str = SgtnClient::Formatters::PluralFormatter.new(locale).num_s(self, arg)
7
8
  if num_str.nil? || num_str.empty?
@@ -2,6 +2,7 @@
2
2
  # SPDX-License-Identifier: EPL-2.0
3
3
 
4
4
  require 'json'
5
+ require 'pathname'
5
6
 
6
7
  module SgtnClient
7
8
  module Common
@@ -1,6 +1,8 @@
1
1
  # Copyright 2022 VMware, Inc.
2
2
  # SPDX-License-Identifier: EPL-2.0
3
3
 
4
+ require 'pathname'
5
+
4
6
  module SgtnClient
5
7
  module Common
6
8
  autoload :BundleID, 'sgtn-client/common/data'
@@ -3,7 +3,7 @@
3
3
 
4
4
  require_relative 'singleton-ruby'
5
5
 
6
- module Singleton # :nodoc:
6
+ module Sgtn # :nodoc:
7
7
  # load configuration from a file
8
8
  def self.load_config(*args)
9
9
  SgtnClient.load(*args)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: singleton-client-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.35
4
+ version: 0.7.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware G11n Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-09 00:00:00.000000000 Z
11
+ date: 2022-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc