diff --git a/app/controllers/weeler/static_sections_controller.rb b/app/controllers/weeler/static_sections_controller.rb
index ecd8206..e72a852 100644
--- a/app/controllers/weeler/static_sections_controller.rb
+++ b/app/controllers/weeler/static_sections_controller.rb
@@ -15,5 +15,9 @@ def update
Settings.i18n_updated_at = Time.now
redirect_to({action: :show, id: params[:id]}, {flash: {success: "Section updated."}})
end
+ protected
+ def set_current_menu_item
+ @current_menu_item = "content"
+ end
end
end
diff --git a/lib/i18n/backend/weeler.rb b/lib/i18n/backend/weeler.rb
index cc55c65..072eeb5 100644
--- a/lib/i18n/backend/weeler.rb
+++ b/lib/i18n/backend/weeler.rb
@@ -103,6 +103,7 @@ def lookup_in_database locale, key, scope = [], options = {}
# For a key :'foo.bar.baz' return ['foo', 'foo.bar', 'foo.bar.baz']
def expand_keys(key)
+ # TODO: fixme. warning: shadowing outer local variable - key
key.to_s.split(FLATTEN_SEPARATOR).inject([]) do |keys, key|
keys << [keys.last, key].compact.join(FLATTEN_SEPARATOR)
end
@@ -112,7 +113,11 @@ def expand_keys(key)
def store_empty_translation locale, key, options
return_value = nil
interpolations = options.keys - I18n::RESERVED_KEYS
+
+ # TODO: fixme. warning: shadowing outer local variable - key
keys = options[:count] ? PLURAL_KEYS.map { |k| [key, k].join(FLATTEN_SEPARATOR) } : [key]
+
+
keys.each do |key|
translation = Weeler::Translation.find_or_initialize_by locale: locale.to_s, key: key
translation.interpolations = interpolations
diff --git a/rspec.html b/rspec.html
index 6d1921a..81d602a 100644
--- a/rspec.html
+++ b/rspec.html
@@ -281,142 +281,142 @@
RSpec Code Examples
- - I18n::Backend::Weeler::Importer
+ - Weeler::TranslationsController
- - import
+ - GET #index
+
+ - list translations0.11785s
-
- - empty db
-
- - translation stores all translation in each locale0.24314s
+
+ - #create
- - returns value if value is in file0.11083s
-
- - returns nil if value is not file0.15657s
+ - creates translation in DB0.09799s
-
- - full db
-
- - file import overrides value0.11005s
+
+ - I18n::Backend::Weeler::Dedupe
-
- - Weeler::TranslationsController
+
+ - #dedupe
-
- - GET #index
-
- - list translations0.05152s
+
+ - empty db
+
+ - translation stores all translation in each locale0.01809s
-
- - #create
-
- - creates translation in DB0.04089s
+
+ - Weeler::ActionController::Acts::Restful
-
- - I18n::Backend::Weeler::Dedupe
+
+ - acts_as_restful
-
- - #dedupe
+
+ - model
+
+ - returns current controller model0.02040s
- - empty db
-
- - translation stores all translation in each locale0.01575s
+ - actions
+
+ - POST #order0.02717s
-
- - #<ActionDispatch::Routing::RouteSet:0x000001036c4e50>
+
+ - GET #index
+
+ - returns success0.02082s
+
+ - assigns posts0.01880s
-
- - #mount Weeler::Engine
+
+ - POST #create
- - /weeler returns home0.03295s
+ - redirects to edit path0.02085s
+
+ - sets only permited attributes0.02315s
-
- - #add_menu_item
-
- - adds resource to weeler menu item0.02891s
+
+ - GET #edit
+
+ - returns success status0.02157s
-
- - #weeler_resources
-
- - mounts resource show route0.03883s
+
+ - GET #new
- - mounts resources index route0.03561s
-
- - mounts resource edit route0.07418s
-
- - mounts resource destroy route0.04261s
-
- - mounts resource create route0.05371s
-
- - mounts resource update route0.03972s
-
- - mounts resource new route0.03914s
+ - returns success status0.02117s
-
- - when destroy route is skiped within with only: option
-
- - does not mount destroy confirm route0.06441s
+
+ - PUT #update
+
+ - sets only permited attributes0.02220s
-
- - when custom block given
-
- - calls it within resources method0.05505s
+
+ - DELETE #destroy
+
+ - destroys item0.02120s
- - I18n::HumanizeMissingTranslations
+ - I18n::Backend::Weeler::Exporter
- - .call
+ - as_xlsx_package
- - when exception is I18n::MissingTranslation
-
- - humanizes missing translations0.00993s
+ - all translations
+
+ - should have 3 rows0.00760s
+
+ - other row with one translation0.00561s
+
+ - other row with two translation0.00554s
+
+ - first row should be title0.00486s
- - when exception is not I18n::MissingTranslation
+ - selected translations
+
+ - should have 2 rows0.00729s
+
+ - other row with one translation0.00536s
- - does not intercept it0.01044s
+ - first row should be title0.00580s
@@ -426,247 +426,247 @@
RSpec Code Examples
- - #reload_cache
+ - #html?
- - clears translations cache0.00631s
+ - is true if key is html0.00572s
- - writes last translations update timestamp to cache0.01020s
+ - is false if value not contains html0.02330s
- - loads all translated data to cache0.01186s
+ - is true if value contains html0.00594s
- - #html?
+ - #value
- - is true if key is html0.00722s
+ - returns boolean if translation boolean0.01080s
- - is true if value contains html0.01235s
-
- - is false if value not contains html0.00545s
+ - runs kernel if translation is_proc0.00870s
- - groups
-
- - returns 2 groups0.00636s
-
- - returns ordered list0.00541s
+ - #available_locales
+
+ - finds one locale0.00536s
- - #interpolations
-
- - can persist0.00827s
+ - groups
+
+ - returns 2 groups0.00617s
+
+ - returns ordered list0.00571s
- - #value
+ - #lookup
+
+ - show warning0.00600s
- - returns boolean if translation boolean0.01015s
-
- - runs kernel if translation is_proc0.01711s
+ - returns translation0.01091s
-
- - #available_locales
-
- - finds one locale0.00589s
+
+ - cache
-
- - #store_translations
-
- - store_translations does not allow ambiguous keys (1)0.02116s
-
- - store_translations does not allow ambiguous keys (2)0.01782s
-
- - can store translations with keys that are translations containing special chars0.01043s
+
+ - differs from settings timestamp
+
+ - reloads cache0.01512s
-
- - #lookup
-
- - show warning0.00603s
-
- - returns translation0.01050s
+
+ - is same as updates timestamp
+
+ - does not reload cache0.01897s
- - cache
+ - missing translations
+
+ - persists the key0.01387s
+
+ - creates one stub per pluralization0.01672s
+
+ - lookup persists interpolation keys when looked up directly0.01272s
+
+ - creates no stub for base key in pluralization0.01573s
+
+ - creates a stub per pluralization when a custom separator is used0.01576s
+
+ - creates a stub when a custom separator is used and the key contains the flatten separator (a dot character)0.01515s
+
+ - creates a stub when a custom separator is used0.01544s
+
+ - lookup does not persist the key twice0.01099s
- - differs from settings timestamp
-
- - reloads cache0.01667s
+ - exist in yml
-
- - is same as updates timestamp
-
- - does not reload cache0.01006s
+
+ - new translation
+
+ - persist it0.01387s
-
- - missing translations
-
- - creates a stub when a custom separator is used0.01427s
-
- - persists the key0.01638s
+
+ - already stored
- - creates one stub per pluralization0.01525s
-
- - lookup does not persist the key twice0.01102s
-
- - creates a stub when a custom separator is used and the key contains the flatten separator (a dot character)0.01341s
-
- - creates a stub per pluralization when a custom separator is used0.01467s
-
- - lookup persists interpolation keys when looked up directly0.01060s
-
- - creates no stub for base key in pluralization0.03236s
+ - saves the fallback backend value0.01118s
-
- - exist in yml
+
+ - #store_translations
+
+ - store_translations does not allow ambiguous keys (1)0.02144s
+
+ - can store translations with keys that are translations containing special chars0.01061s
+
+ - store_translations does not allow ambiguous keys (2)0.01799s
-
- - new translation
+
+ - #reload_cache
+
+ - clears translations cache0.00707s
+
+ - loads all translated data to cache0.01541s
- - persist it0.01272s
+ - writes last translations update timestamp to cache0.01280s
-
- - already stored
+
+ - #interpolations
- - saves the fallback backend value0.01078s
+ - can persist0.00923s
- - Weeler::ActionController::Acts::Restful
+ - I18n::HumanizeMissingTranslations
- - acts_as_restful
+ - .call
- - model
+ - when exception is I18n::MissingTranslation
- - returns current controller model0.01917s
+ - humanizes missing translations0.01042s
- - actions
+ - when exception is not I18n::MissingTranslation
- - POST #order0.02281s
+ - does not intercept it0.00942s
-
- - GET #new
-
- - returns success status0.01930s
+
+ - I18n::Backend::Weeler::Importer
-
- - GET #index
-
- - returns success0.01860s
-
- - assigns posts0.01779s
+
+ - import
-
- - GET #edit
-
- - returns success status0.02011s
+
+ - empty db
+
+ - translation stores all translation in each locale0.20564s
+
+ - returns nil if value is not file0.11116s
+
+ - returns value if value is in file0.11343s
-
- - POST #create
-
- - redirects to edit path0.02086s
-
- - sets only permited attributes0.02056s
+
+ - full db
+
+ - file import overrides value0.11656s
-
- - DELETE #destroy
-
- - destroys item0.01884s
+
+ - #<ActionDispatch::Routing::RouteSet:0x00000101cef8b8>
-
- - PUT #update
-
- - sets only permited attributes0.02047s
+
+ - #mount Weeler::Engine
+
+ - /weeler returns home0.04571s
-
- - I18n::Backend::Weeler::Exporter
-
-
-
-
-
- - all translations
+ - #weeler_resources
+
+ - mounts resources index route0.04719s
+
+ - mounts resource show route0.04237s
+
+ - mounts resource new route0.04266s
- - should have 3 rows0.00637s
+ - mounts resource edit route0.05215s
- - other row with two translation0.00550s
+ - mounts resource destroy route0.04231s
- - other row with one translation0.00563s
+ - mounts resource update route0.04061s
- - first row should be title0.00572s
+ - mounts resource create route0.04152s
-
+
- - selected translations
+ - when destroy route is skiped within with only: option
- - should have 2 rows0.00625s
+ - does not mount destroy confirm route0.06617s
+
+
+
+
+ - when custom block given
- - first row should be title0.00566s
+ - calls it within resources method0.05914s
+
+
+
+
+ - #add_menu_item
- - other row with one translation0.00546s
+ - adds resource to weeler menu item0.03043s
-
+