The ember-i18n readme file says:
If you have not precompiled your translations, you need to include full descriptors, not just handlebars-runtime.js in your application.
The problem is that even with pre-compiled templates, when we use the Em.I18n.t function , as shown below, it still calls the Handlebars compilation function, which requires full handles.
Does anyone know a solution for this? Maybe there is a better experience for precompiling translations even for function calls?
, , :
/* Customized version of translation compiler */ Em.I18n.compile = function(template) { // Full Handlebars completely disabled //if (typeof window.Handlebars.compile === 'function') // return window.Handlebars.compile(template); return function(context, options){ var ret = template; if (context !== undefined) { $.each(context, function(key, value){ ret = ret.replace("{{"+key+"}}", value); }); } return ret; } }
, 100%, .
ember-i18n (2.2.1 ) :
Ember.I18n Handlebars ; . Ember.ENV.I18N_COMPILE_WITHOUT_HANDLEBARS true .
, Handlebars, . , , , , , .
Source: https://habr.com/ru/post/1542627/More articles:Урегулировать зависимость в cocoapods, когда библиотека не имеет опубликованного podspec - iosHow to insert MergeField into a specific table cell using VBA? - vbaWhat is the difference between spring-shell and CRaSH? - javaGet "Show How" to meet at EWS - c #Swap String values without a temporary variable - javaInstall OCI8 php extension on Windows server - phpjQuery UI Datepicker after selecting / changing month / year - javascriptThe regex control accepts a number with decimal numbers 0 or 5 in the range 0-5 - regexUpdating All UITabBarController View Controllers - iosHibernate could not catch ResultSet exception - javaAll Articles