Jump to content

append further strings to JQLocalizationTool


pr0c3ss

Recommended Posts

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 below
https://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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.