i18n-message_format 0.1.0 → 0.1.1
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.md +4 -0
- data/lib/i18n/message_format/backend.rb +27 -1
- data/lib/i18n/message_format/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1bd4491b3b0b03ebc25a91cc9581996b4114a28a14b194966fde4d8654cdff01
|
|
4
|
+
data.tar.gz: ba58ce43068a42e00bda2a49b496fbe5a1b3854a6d1496c89b571903e7a663f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a285715d8b3ba8ebfd001b642df6359860502a6c3c235e7c886b3d7b9416388428a6bd77d6dcf520f41d4fb8ea85f4d2e83741dd4e5540ab55d9bf20db50e18
|
|
7
|
+
data.tar.gz: c7b09b75dbe855db184942fcfcb68cf3b9b65f1fa27a68a9a7db9a6a4bda6e7c8490ec28c23634c0373210d98b98be7da70666e4f7e81229b57197da697d7d70
|
data/CHANGELOG.md
CHANGED
|
@@ -110,7 +110,7 @@ module I18n
|
|
|
110
110
|
#
|
|
111
111
|
# @return [Array<Symbol>]
|
|
112
112
|
def available_locales
|
|
113
|
-
|
|
113
|
+
translations.keys
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
# Returns +true+ if any translations have been loaded into the backend.
|
|
@@ -120,8 +120,34 @@ module I18n
|
|
|
120
120
|
!@translations.empty?
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
+
# Eagerly loads all translations and calls +super+ to trigger any
|
|
124
|
+
# eager-loading behaviour defined by +I18n::Backend::Base+.
|
|
125
|
+
#
|
|
126
|
+
# @return [void]
|
|
127
|
+
def eager_load!
|
|
128
|
+
init_translations unless initialized?
|
|
129
|
+
super
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Returns the full in-memory translation store, loading translations first
|
|
133
|
+
# if they have not yet been initialized.
|
|
134
|
+
#
|
|
135
|
+
# @return [Hash{Symbol => Hash}] a hash keyed by locale symbol, each value
|
|
136
|
+
# being a flat hash of dot-separated translation keys to their values
|
|
137
|
+
def translations
|
|
138
|
+
init_translations unless initialized?
|
|
139
|
+
@translations
|
|
140
|
+
end
|
|
141
|
+
|
|
123
142
|
protected
|
|
124
143
|
|
|
144
|
+
# Initializes the translation store by delegating to {#load_translations}.
|
|
145
|
+
#
|
|
146
|
+
# @return [void]
|
|
147
|
+
def init_translations
|
|
148
|
+
load_translations
|
|
149
|
+
end
|
|
150
|
+
|
|
125
151
|
# Looks up a translation value by locale and key.
|
|
126
152
|
#
|
|
127
153
|
# @param locale [Symbol, String] the locale to look up
|