Closed dispbd closed 3 years ago
Hi @dispbd. This isn't possible because all static files are cached by the browser (with except html files). I recommend to localize text in the HTML files/views and transform them to the JavaScript.
j-Resource
, tab HTML
If you want to localize static files anyway then you need to create a custom file handler, but there won't work e.g. merging.
Thanks. Let's create my own handler.
Hello. Is it possible to localize script files? Some of the content for the user is drawn by javascript. It is important to use the built-in localization mechanism, as it is extremely simple and convenient.
DEF.onCompileScript
cannot be rewritten, since it is only suitable for code inside the view. I could put the code inside the script tag, but that causes a number of other difficulties.The method can be modified. For example:
@{js (url, [localize])};
This, of course, will affect the cache, since different languages need different files. But I think the problem can be easily solved by binding the prefix to the file path, to the example _ru, _en, etc. Or is there some other way?