mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Add handle_extensions to get Spree.translations (archaic spree js translations) in handlebars templates
This is all legacy from spree that can be cleaned up at some point, we only have two handlebars templates in OFN
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
//= require css_browser_selector_dev
|
||||
//= require responsive-tables
|
||||
//= require admin/spree_paypal_express
|
||||
//= require handlebars
|
||||
//= require admin/spree/handlebar_extensions
|
||||
|
||||
// OFN specific
|
||||
//= require_tree ../templates/admin
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
//= require handlebars
|
||||
|
||||
Handlebars.registerHelper("t", function(key) {
|
||||
if (Spree.translations[key]) {
|
||||
return Spree.translations[key]
|
||||
} else {
|
||||
console.error("No translation found for " + key + ". Does it exist within spree/admin/shared/_translations.html.erb?")
|
||||
}
|
||||
});
|
||||
@@ -6,7 +6,7 @@
|
||||
:abbr_day_names => I18n.t(:abbr_day_names, :scope => :date),
|
||||
:add => Spree.t(:add),
|
||||
:are_you_sure_delete => Spree.t(:are_you_sure_delete),
|
||||
:bill_address => Spree.t(:bill_address),
|
||||
:bill_address => I18n.t(:bill_address),
|
||||
:choose_a_customer => Spree.t(:choose_a_customer),
|
||||
:confirm_delete => Spree.t(:confirm_delete),
|
||||
:cut => Spree.t(:cut),
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
//= require textAngular.min.js
|
||||
//= require moment/min/moment.min.js
|
||||
//= require i18n
|
||||
//= require handlebars
|
||||
|
||||
angular.module('templates', [])
|
||||
angular.module('uiGmapgoogle-maps', []);
|
||||
|
||||
Reference in New Issue
Block a user