Results 1 to 8 of 8

Thread: Change website language content dynamically..only experts!

  1. #1
    Join Date
    May 2014

    Change website language content dynamically..only experts!

    I am dealing with a moodle website which can be html code edited,I am trying to make the site change content language from english to other 3 languages, but that should happen only when smn changes the default language, i have already added a language change button to these languages. But only the menus change when i change the language button, i want the same for the contents.

    I havent been able to achieve it so far, only thing i managed was to create hyper links on the home page, and only the contents changed. Is it possible to change both, menus and contents by the language button?

  2. #2
    Join Date
    Nov 2010

    have you considered a google translation widget?

    without seeing your page it's hard to go into any more detail, but that would be the easiest way

  3. #3
    Join Date
    May 2014
    I tried that but its not what I want.

    Im thinking of doing this with switch or if/else, I will use a language variable and depending on the language button the browser will show the appropriate content.

    Problem is, how do I tell java how to define the language button?Whats the keyword for that and how can I connect the button to javascript?

  4. #4
    Join Date
    May 2014
    I ve already added the language packs i want, 4 languages particularly, and there is a button on the site that changes the menus' language

  5. #5
    Join Date
    Nov 2010
    the button is the least of your worries, and having decided to use an if/else or switch gets you about 1% of the way to where you want to go.

    the more important question would be where does the translated content come from? Do you have three separate files, with the content of the page in their respective languages? Or do you use some other automatic translation service (like google, but I guess different? And while we're on that, what is it that you want that the google widgets do not provide?)

    I wouldn't put a whole lot of faith in the language packs, either, btw - if you change the language on moodle's home page you will see that only little snippets of unimportant text get translated.
    Last edited by xelawho; 05-15-2014 at 09:46 PM.

  6. #6
    Join Date
    May 2014
    It's like that, an english company created the webpage, co-operating with companies from Spain and Italy.
    Now the companies from Spain and Italy want to read the page in their own language everytime they use the language button..they ve already given us the translation, not from google.its a 3-paragraph text for each.

    Can you please help me with connecting the language button to the Javascript code?
    Is there a more efficient way to achieve this?

  7. #7
    Join Date
    Nov 2010
    well if it's only three paragraphs for each language, I wouldn't bother with any of that other stuff - just hardcode the text into the page, hide the translations with css and show them with js...

    <style type="text/css">
    <select id="chooser">
    <option value="en">English</option>
    <option value="sp">Spanish</option>
    <option value="it">Italian</option>
    <div id="en">This is the English content</div>
    <div id="sp">Este es el contenido en espaņol</div>
    <div id="it">Questo č il contenuto Italiana</div>
    (function () {
    var chosen ="en";
    document.getElementById("chooser").onchange = function(){

  8. #8
    Join Date
    Oct 2010
    Versailles, France
    Read something like this for localisation (l10n) or internationalisation (l18n).
    Last edited by 007Julien; 05-18-2014 at 09:33 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center