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 ?

View Replies: View Best Answer
mnakalay replied on at Permalink Best Answer Reply
in javascript you use

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:
MrKDilkington replied on at Permalink Reply

Thank you, I've wondered how to do this.
mnakalay replied on at Permalink Reply
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