Search code examples
javascriptnode.jsapostrophe-cms

How to get the current locale in apostrophecms js file


I have js file in public folder of one of my module. I want the current selected locale in same file. Where file has defination

apos.define('test-widgets', { improve: 'test-widgets', construct: function (self, options) { } }.

Inside this definition there is constructor also.

I can get the locale label using data.workflow.locales['fr'].label in html file but same thing I can't get in public js file.

Thank you for the help in advance!


Solution

  • I got the solution for this by referring

    How to access options inside apos.define?

    Thanks to @stuart-romanek for great help!