Nico Knoll Posted February 13, 2014 Share Posted February 13, 2014 Hey, what is the best practice for making a string in a .js file translatable? Greets, Nico Link to comment Share on other sites More sharing options...
teppo Posted February 13, 2014 Share Posted February 13, 2014 Depends a bit on context, but especially for modules I prefer translating strings in module file, storing them in $config->js and then in JS file fetching from config var. Simple example: PageListPermissions.module => PageListPermissions.js (though I'd also suggest "namespacing" JS config content, i.e. instead of using config.i18n.*, use config.YourModuleName.* and/or config.YourModuleName.i18n.* etc.) 7 Link to comment Share on other sites More sharing options...
ryan Posted February 16, 2014 Share Posted February 16, 2014 I agree with Teppo and this is the same method the core uses. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now