pr0c3ss Posted April 27, 2015 Share Posted April 27, 2015 Been working with JQueryLocalizationTool (translation method) http://darksmo.github.io/jquery-localization-tool/ The plugin explicitly says it's meant to translate single pages. But if we fill the call to the plugin with the appropriate strings, we can translate other pages no problem. The problem is that the call to the plugin that holds the strings will become way too large. We want to separate the translation for each page and append the strings to the call of the plugin (if possible). At the moment we are calling the plugin like below... $(document).ready(function(){ $('#selectLanguageDropdown').localizationTool({ 'defaultLanguage' : 'en_GB', /* (optional) although must be defined if you don't want en_GB */ 'showFlag': true, /* (optional) show/hide the flag */ 'showCountry': false, /* (optional) show/hide the country name */ 'showLanguage': true, /* (optional) show/hide the country language */ 'languages' : { /* (optional) define **ADDITIONAL** custom languages */ 'ar_SA' : { 'country': 'Middle East', 'language': 'عربي', 'countryTranslated': 'عربي', 'languageTranslated' : 'عربي', 'flag': { 'class' : 'flag flag-sa' } } }, /* * Translate your strings below */ 'strings' : { /* * You can specify the text string to translate directly... */ 'About Us' : { ar_SA : 'تعرف علينا' }, We could have an exhaustive list of strings, but this is going to be very unorganised and slow the site down. We are using the MVC framework and hope to be able to place a language.js string file in each html content js folder where it can then be called/appended to the initial plugin call/language dropdown selection. Options and methods of the plugin can be viewed belowhttps://github.com/darksmo/jquery-localization-tool Is the idea of calling/appending separate js string files depending on page in view possible? If not, any suggestions on how we can separate the strings? Thanks for looking Quote Link to comment https://forums.phpfreaks.com/topic/295898-append-further-strings-to-jqlocalizationtool/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.