Welcome to TalkGraphics.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,822

    Lightbulb Designing a Multi-Language Site

    The OP of https://www.talkgraphics.com/showthr...-on-SOME-pages got me thinking.
    How to best deliver a multi-language site?

    These are my ideas.

    1. Don't use Country Flags as icons.
      1. Not all are recognisable.
      2. Not all indicate which language will be shown (Switzerland / Canada / The Netherlands).
      3. A right mess for Accessibility - how many would add Alt text?

    2. Better to use ISO 639-1 Language Name as labels (English | German | French | Italian) or even (better) (English | Deutsch | français | Italiano).
    3. Have all sites at the same folder level.
    4. Use ISO 639-1: two-letter codes for sub-folders - (en | de | fr | it).
    5. Code so a click on a language link, jumps to the identical page in that language.


    The Website > HTML Code (Head) for this is simply:
    Code:
    <script>function changeto(lang) {
      addr = document.location.href;
      addr = addr.replace('/en/', '/' + lang + '/');
      addr = addr.replace('/fr/', '/' + lang + '/');
      addr = addr.replace('/de/', '/' + lang + '/');
      addr = addr.replace('/it/', '/' + lang + '/');
      document.location.href = addr;
    }
    </script>
    For the français website, you add links:
    • English - javascript: changeto('en');
    • Deutsch - javascript: changeto('de');
    • français - javascript: ; [or leave as - javascript: changeto('fr') as I might code to change the session variable (see below) for a match to not then jump; all language bars on all pages and sites would then be identical]
    • Italiano - javascript: changeto('it');

    You just set the language bar to Repeat on all pages: English | Deutsch | français | Italiano

    You will need a launch page for visitors arriving without a picked language.
    I personally would use localStorage.setItem("language", lang); in the changeto() above and an onLoad check if this variable was set and redirect to the right sub-site so the launch page is thereafter bypassed.

    You would also need to plan for errors:
    • Sub-site page not found - code to jump to its index page.
    • Sub-site not found - server 404 page to offer other sub-sites or unset language variable and jump to the launch page.


    Overall, a richer experience for the international visitor.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  2. #2
    Join Date
    Jul 2022
    Posts
    24

    Default Re: Designing a Multi-Language Site

    Hi - I'm a newbie that has been tasked to create a site for our small Town here in Crete and look for all advice about making multi lingual site...your advice look solid and will have to give it a go. Would I have to duplicate all pages and then translate with google and then point to them or will this script handle the language as well..TIA

  3. #3
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,822

    Default Re: Designing a Multi-Language Site

    StewKriti, each language site has its own pages in a sub-folder/sub-site.

    There is no way an enterprise would rely on Google translate alone. Most time the text length will be different and so the result would be a mess.
    It's all hand-crafting. If you want different, you buy a product to do it for you at a great cost.

    The sub-site page filenames will have to remain the same throughout all-sub-sites.
    Coding is possible to overcome this limitation.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  4. #4
    Join Date
    Jul 2022
    Posts
    24

    Default Re: Designing a Multi-Language Site

    Hi Acorn - not sure if I will be able to do this for them then...our budget is zero and I'm giving my time. So I will have to make the translation into Greek - a friend is helping with this and replace all text in site and save as Greek version and then could link to this?
    Thanks again

 

 

Tags for this Thread

Bookmarks

Posting Permissions

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