mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Adapt karma js tests for i18n-js
This commit is contained in:
committed by
Maikel Linke
parent
5166a3d958
commit
c6f6f5bc55
@@ -39,11 +39,9 @@ namespace :karma do
|
||||
end
|
||||
|
||||
def i18n_file
|
||||
I18n.backend.send(:init_translations) unless I18n.backend.initialized?
|
||||
f = Tempfile.open('i18n.js', Rails.root.join('tmp') )
|
||||
f.write 'window.I18n = '
|
||||
f.write I18n.backend.send(:translations)[I18n.locale].with_indifferent_access.to_json.html_safe
|
||||
f.flush
|
||||
f.path
|
||||
raise "I18n::JS module is missing" unless defined?(I18n::JS)
|
||||
I18n::JS::DEFAULT_EXPORT_DIR_PATH.replace('tmp/javascripts')
|
||||
I18n::JS.export
|
||||
"#{Rails.root.join(I18n::JS::DEFAULT_EXPORT_DIR_PATH)}/translations.js"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
//= require textAngular-sanitize.min.js
|
||||
//= require textAngular.min.js
|
||||
//= require moment
|
||||
//= require i18n
|
||||
|
||||
angular.module('templates', [])
|
||||
angular.module('google-maps', []);
|
||||
|
||||
Reference in New Issue
Block a user