Translation in javascript

Permalink 1 user found helpful
Which is the best way to work with internationalization in javascript ? in PHP we work with t('sample') but in javascript ?

sebastienj
View Replies: View Best Answer
mnakalay replied on at Permalink Best Answer Reply
mnakalay
in javascript you use
ccm_t('my-string');

[EDIT]
My understanding is that is only usable in block's controllers and you have to define the strings in the controller.

Read this to have all the details:http://www.concrete5.org/documentation/recorded-trainings/advanced-...
MrKDilkington replied on at Permalink Reply
MrKDilkington
@mnakalay

Thank you, I've wondered how to do this.
mnakalay replied on at Permalink Reply
mnakalay
Still I'd love to know how to do it outside of blocks. I have a package with a js file loading on every page through the package's controller. I couldn't figure out how to deal with strings in that js file so I didn't make them translatable