fast_gettext 3.0.0 → 4.0.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 +4 -4
- data/CHANGELOG +2 -0
- data/lib/fast_gettext/vendor/mofile.rb +2 -2
- data/lib/fast_gettext/vendor/string.rb +0 -16
- data/lib/fast_gettext/version.rb +1 -1
- data/lib/fast_gettext.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20e208d22e9a3e7d486f620c2c134e4e602c4d31411d737a07a4fc700a5cb50d
|
4
|
+
data.tar.gz: '09d8b2bc909e0163e1120dc61d9e87dc23604dce84829f20ddf4fe19c8433ff1'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9746937a00829ef51350812f51207941014bb7f354417e585c7f2f5b19415ea83abd762e7d6cf679ec56c595b509b36a523decc187fec5c185819bfb003f54cd
|
7
|
+
data.tar.gz: 4779c2456eaab59d6012eb6a00009cbf5869c5db46fab4cf52d1717062141e10b9b4341d4ffc524d63403f85d6fc79af9019482b15ab3866115a2ce06ccd3b68
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
4.0.0 -- Remove String#% hack that would make it not blow up when using invalid keys, can temporarily restore with `FastGettext.allow_invalid_keys!`
|
2
|
+
3.1.0 -- Work with frozen strings
|
1
3
|
3.0.0 -- Drop ruby 2.x support
|
2
4
|
2.4.0 -- Depend on prime gem
|
3
5
|
2.3.0 -- Load empty mo file only once
|
@@ -47,8 +47,8 @@ module FastGettext
|
|
47
47
|
:trans_sysdep_tab_offset
|
48
48
|
end
|
49
49
|
|
50
|
-
MAGIC_BIG_ENDIAN = "\x95\x04\x12\xde"
|
51
|
-
MAGIC_LITTLE_ENDIAN = "\xde\x12\x04\x95"
|
50
|
+
MAGIC_BIG_ENDIAN = +"\x95\x04\x12\xde"
|
51
|
+
MAGIC_LITTLE_ENDIAN = +"\xde\x12\x04\x95"
|
52
52
|
if "".respond_to?(:force_encoding)
|
53
53
|
MAGIC_BIG_ENDIAN.force_encoding("ASCII-8BIT")
|
54
54
|
MAGIC_LITTLE_ENDIAN.force_encoding("ASCII-8BIT")
|
@@ -58,19 +58,3 @@ rescue ArgumentError
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
61
|
-
|
62
|
-
# 1.9.1 if you misspell a %{key} your whole page would blow up, no thanks...
|
63
|
-
begin
|
64
|
-
("%{b}" % {:a=>'b'})
|
65
|
-
rescue KeyError
|
66
|
-
class String
|
67
|
-
alias :_fast_gettext_old_format_m :%
|
68
|
-
def %(*args)
|
69
|
-
begin
|
70
|
-
_fast_gettext_old_format_m(*args)
|
71
|
-
rescue KeyError
|
72
|
-
self
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
data/lib/fast_gettext/version.rb
CHANGED
data/lib/fast_gettext.rb
CHANGED
@@ -28,6 +28,22 @@ module FastGettext
|
|
28
28
|
translation_repositories[name] = TranslationRepository.build(name, options)
|
29
29
|
end
|
30
30
|
|
31
|
+
# deprecated, just a crutch to migrate to new api
|
32
|
+
def self.allow_invalid_keys!
|
33
|
+
eval(<<~CODE)
|
34
|
+
class ::String
|
35
|
+
alias :_fast_gettext_old_format_m :%
|
36
|
+
def %(*args)
|
37
|
+
begin
|
38
|
+
_fast_gettext_old_format_m(*args)
|
39
|
+
rescue KeyError
|
40
|
+
self
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
CODE
|
45
|
+
end
|
46
|
+
|
31
47
|
# some repositories know where to store their locales
|
32
48
|
def self.locale_path
|
33
49
|
translation_repositories[text_domain].instance_variable_get(:@options)[:path]
|
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:
|
4
|
+
version: 4.0.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:
|
11
|
+
date: 2025-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prime
|