Internationalisation optimize propositions
Internationalisation optimize propositions
I have a proposal to optimize work with language files.
Store the language files in JavaScript format and rename them in the name of the locale like "dataTables-en.js". This will help to automate the adding language files.
Make the language files set default language setting automatically when you add them. Here is an example of such a file:
$.extend($.fn.dataTable.defaults, {
language: {
search: "Search:"
}
})
Of course, it is necessary to take into account the dependencies for AMD.
I converted to this format, some important files and now I am very happy. It is very convenient to use.
Replies
Allan
To be honest, I spied the idea from jQuery UI Datepicker http://jqueryui.com/datepicker/#localization. You can see them myself implementation of language files on https://github.com/jquery/jquery-ui/tree/master/ui/i18n.