JQLocalizationTool append further strings

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 dropdown selection.

Option and methods of the plugin can be viewed below

Is the idea of calling/appending separate js string files depending on page in view possible?

Thanks for looking

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.