fast_gettext 1.7.0 → 1.8.0

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
  SHA256:
3
- metadata.gz: c9a6fd429b84982391cfe86946711c30917ebe18f16ab3ddc46451c6be82bebf
4
- data.tar.gz: 2bfe28224366ece306f0f1e59c7f3110b5ad32543c44936a48821d958e04d0f3
3
+ metadata.gz: af7af45d00211da2791e03bf1f4f7c611d8c557a10f339189ebdf2a72008ff05
4
+ data.tar.gz: 23040ab7524d7eb95b0e11fcc22a05a1ddf54eeeb88babade01c9876620447c5
5
5
  SHA512:
6
- metadata.gz: 04cec4fcfe53564b22bd7ae6a033b22e10748f5b2bf62adf9ca0f0b47def05639ddbec58436de080c04b5438a09fe5767718396f01c54543b014d72636c67aba
7
- data.tar.gz: d08d5673cec61679b142147449d95374788925ef60e608e1bb89dcfce3f665ab8ffe9fe5e3d5771cba3b064ec18ae5997af98c7a4c25df303f364e79f85db214
6
+ metadata.gz: c9152caffa285a723a4681e23db5d0710465a5b47f2c2251f863026cf91da316cdd36155097038896d77cb1c5562af619e73cf29f69be70bebec28ac8bf6d272
7
+ data.tar.gz: c59623e1c15a293922cfcdd457634a2cb5f082900ee0948d14d7d37c4ddac5533f1fa6437f8e9bc200cc391e9be4a8c6d416e72568017905f0be930fbd65bb00
@@ -42,6 +42,14 @@ module FastGettext
42
42
  end
43
43
  end
44
44
 
45
+ #translate with namespace, use namespect to find key
46
+ # 'Car','Tire' -> Tire if no translation could be found
47
+ # p_('Car','Tire') <=> s_('Car|Tire')
48
+ def p_(namespace, key, separator=nil, &block)
49
+ msgid = "#{namespace}#{separator||NAMESPACE_SEPARATOR}#{key}"
50
+ FastGettext.cached_find(msgid) or (block ? block.call : key)
51
+ end
52
+
45
53
  #translate, but discard namespace if nothing was found
46
54
  # Car|Tire -> Tire if no translation could be found
47
55
  def s_(key, separator=nil, &block)
@@ -1,3 +1,3 @@
1
1
  module FastGettext
2
- VERSION = Version = '1.7.0'
2
+ VERSION = Version = '1.8.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_gettext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-22 00:00:00.000000000 Z
11
+ date: 2018-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake