Nico Knoll Posted February 13, 2014 Posted February 13, 2014 Hey, what is the best practice for making a string in a .js file translatable? Greets, Nico
teppo Posted February 13, 2014 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
ryan Posted February 16, 2014 Posted February 16, 2014 I agree with Teppo and this is the same method the core uses.
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