We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I'm working with a client who had requested we take his existing site ( http://primerevenue.com/ ) and convert it with several languages, the site's fully functional now, and I've taken the first steps on a duplicate version to understand how to build the international version. I actually have it up and running and it'll be using a structure similar to http://primerevenue.com/fr or http://primerevenue.com/es for the french and spanish translations.

    I'm using babel, and on our test site it's set up and working this way but have a few questions on what is the best practice on things. The chuck for the footer (some of it has been removed for brevity):

    <footer>
      <div>
        <p><a href="[[~1]]">Home</a><span>|</span><a href="[[~6]]">Contact Us</a><span>|</span><a href="[[~11]]">Login SCF</a></p>
        <p>© PrimeRevenue, Inc. All Rights Reserved.<span>|</span><a href="[[~7]]">Privacy</a><span>|</span><a href="[[~8]]">Site Map</a></p>
         </div>
    </footer>
    


    The contact us for example, would go to contactus.html. It works fine if all the same translations as long as the Resource alias is the same in all three languages, but will not work if the contact us page alias in the spanish context is contactES.html for example.

    I'm looking for some insight as to how others deal with this issue. The solutions I've found seem a bit unwieldy:


    • Create an alternate template for the home/inside pages for each language, creating new nav and other chunks in the process, or
    • [li]add the following to every link in a section like this:
    [[~[[++cultureKey:is=`fr`:then=`2`]]]][[~[[++cultureKey:is=`es`:then=`2`]]]][[~[[++cultureKey:is=`en`:then=`2`]]]][/code
      ][/li]

    Thanks in advance everyone!

    Charles/Jalterixnar
      Senior Designer at Arketi Group - http://www.arketi.com
      Twitter - @jalterixnar - https://twitter.com/jalterixnar

      “There is no dishonor in failing, only in the failure to try.” – Elder fire dragon Kaernyth
    • Mark Hamstra Reply #2, 12 years ago
      If you have those different translations in different contexts, you might as well use context settings.

      Eg, creating a setting with key: resource.home

      would be used as:
      <a href="[[~[[++resource.home]]]]">Home</a>

      And then you could go further, and translate "Home" too. Either as a context setting, or as a Lexicon tag: http://rtfm.modx.com/display/revolution20/Internationalization

      Could also, though that depends on your set up, use Wayfinder or a similar addon to build that footer menu.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.