We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    While we're on the subject of MIGx and MIGXdb, I had an idea last night. MIGXdb TV for handling multi-language sites.

    There would be a CMP (using MIGXdb, of course) that would have a list of existing languages, plus a "new language" button. This button would present a form with some basic stuff necessary for the language: language name (English), lang code (en), locale (en-us) and lexicon. Maybe also need to set a namespace? Anyway, on submitting the form, a new top-level resource would be created, not show in the tree, not show in menu. Its entire purpose would be to act as a container for the given language. Its alias would be the lang code value. It would then duplicate all resources not under a similar hidden resource as children to that top-level resource, thus creating a complete duplicate of the main site's tree for translating. I'm sure that there are a number of other things that can be done at this point as well, such as creating the namespace and the lexicon folder. Details. Actually, all of this could be done manually.

    Each resource would have a set of MIGXdb TVs, each in its own tab using Form Customization, that would load the corresponding resource in the appropriate tab. For the "Page" resource, there would be tabs for fr, de, he, etc., with the "Page" page from that branch of the tree. Much like the YAMS TV system for Evo, only instead of using the tmplvar_contentvalues table, it would use the site_content table. And the lexicon would be available for strings such as form field prompts, messages, etc.

    A plugin would tie it all together. Use alias path would be turned on, so there would be no rewrites needed for domain.com/en/page.html, domain.com/fr/page.com, etc. The plugin would detect which language alias path was used, and set the locale, namespace, lexicon, etc. accordingly. It would also, if the page was not found, redirect to the corresponding page in the default site, i.e. domain.com/en/page.html would be forwarded or redirected or whatever to domain.com/page.html, which would be able to return a true Not Found page if the page doesn't exist at all. Pages would not be published until they were translated, so any page in any language that isn't translated yet would default to the default language's page.

    Does this sound feasible? [ed. note: sottwell last edited this post 13 years, 7 months ago.]
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 4172
      • 5,888 Posts
      This sounds great and very feasible to me.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 18608
        • 112 Posts
        Would there be a way to tweak this into supporting multiple domains as well? (Ie. domain.de and domain.fr instead of domain.com/def and domain.com/fr/)
          Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          migxMultiLang is Bruno's solution to the original idea. As far as I know, though, at this point it does not support multiple domains. You should be able to use some htaccess rewrites, and possibly plugins to deal with that. Or you may need to use the contexts/Bable solution.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org