We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25483
    • 741 Posts
    Quote from: PMS at Aug 11, 2009, 02:03 PM

    Okay. I think I have fixed it. At the same time, I have made it so that any template variables ending in _{langId} where {langId} is a language group id are tabbed - not just the standard tvs managed by YAMS as was previously the case.

    I have checked that this works for a Pre-Evolution install, but I am looking for a volunteer to test it on Evolution. Just rename the file to remove the .txt extension, and replace your current assets/modules/yams/yams.mm_rules.inc.php file with it. Then reload a multilingual document to see if it works.

    Thanks.



    Thank you for the fast fix! It works like a charm smiley
    Keep up the great work!!!!
      with regards,

      Ronald Lokers
      'Front-end developer' @ h2o Media

      • 22851
      • 805 Posts
      Glad the fix worked. I’ll role that into the next version.

      mgbowman. Here’s my action plan for the implementation of multilingual aliases:

      1. Tidy up the documentation and make an official release of YAMS this week. This will be 1.0.4 beta, will incorporate all of the bug fixes so far and will include an new extension I wrote yesterday that makes YAMS work with jot. It wont include a translatable interface like I had originally wanted. That will have to come later.

      2. Next I’ll implement the functions that belong in YAMS from your code, test them and start using them within my existing URL generating methods.

      3. Next it’s time to integrate and test your onPageNotFound plugin.
      This combined package can be then be released for testing as YAMS 1.1 alpha RC 1.

      I can’t pin myself down to specific deadlines for 2 and 3, but I’m quite motivated at the moment - so hopefully those steps will take days rather than weeks.
        YAMS: Yet Another Multilingual Solution for MODx
        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
        • 30497
        • 245 Posts
        Quote from: PMS at Aug 11, 2009, 08:00 AM


        I have just tried my first install of YAMS on a site in production.
        Have you had this working on a non-production site?


        You’ll notice that unlike most examples I have seen so far, I am not putting my default language in a virtual /lang/ directory, I rather English to be on the root.
        Please can you show me a screen-shot of the top part of the same screen, with the monolingual settings and currently active mode?

        The set-up you are trying to use is not normally allowed. Each URL for each language must be unique. Currently your English URL probably conflicts with your monolingual URL. If you need to avoid the use of a root folder name for English, then I think you might be able to do that by explicitly specifying www.quitsmokingin10days.com as the server name for all the multilingual documents, and something like mono.www.quitsmokingin10days.com for your monolingual pages.


        but do you have any idea why I’d be getting 404 errors ?
        Not at the moment. I hope that it is because of a configuration error and not something else.

        With regards to the tabbed document view, have you edited your ManagerManager plugin to tell it to look in the mm_rules chunk? Have you placed the the YAMS ManagerManager rules in the mm_rules chunk?



        I tried you updates the the manager rules, that worked with my evo 1.

        Now, about the 404 issues. I tried changing my english to /en/ just to get rid of the conflict you mention, but it still doesn’t work - this time I get a browser error about a redirect loop that will never end - yes, I have updated my .htaccess file with the new rules.

        I am not sure where to go from here.

        Also the whole monolingual / same language as multi-lingual issue seems a bit unintuitive to me. I realize it may reflect some programmatic logic, but from a usability POV, it seems counter intuitive (unless I totally miss the point).

        In most cases, a website will have a "dominant" language, and that brings the majority of traffic. In all my previous experience, for instance, we always use / for english, and then either a subdomain or a subdirectory for additional languages.

        With YAMS, this "conflict" between, in my case, the "monolingual English" and the "multilingual English" seems really unnecessary. If I already have an existing site in English, isn’t it more user friendly to use THAT as the English version, exactly as it currently functions, and YAMS to ADD to it with additional languages in the root of the user’s choosing?

        maybe I am missing something here.
          • 22851
          • 805 Posts
          Quote from: towerofbabel at Aug 12, 2009, 01:20 AM

          Now, about the 404 issues. I tried changing my english to /en/ just to get rid of the conflict you mention, but it still doesn’t work - this time I get a browser error about a redirect loop that will never end - yes, I have updated my .htaccess file with the new rules.
          The configuration looks fine. I can’t see any reason why we shouldn’t be able work to get this working since it has been working fine on other sites. Please can you post up your .htaccess? Also, are you using any other plugins that might interfere with the URLs in any way? Have you tried clearing your cache, btw?

          Quote from: towerofbabel at Aug 12, 2009, 01:20 AM

          Also the whole monolingual / same language as multi-lingual issue seems a bit unintuitive to me. I realize it may reflect some programmatic logic, but from a usability POV, it seems counter intuitive (unless I totally miss the point).

          In most cases, a website will have a "dominant" language, and that brings the majority of traffic. In all my previous experience, for instance, we always use / for english, and then either a subdomain or a subdirectory for additional languages.

          With YAMS, this "conflict" between, in my case, the "monolingual English" and the "multilingual English" seems really unnecessary. If I already have an existing site in English, isn’t it more user friendly to use THAT as the English version, exactly as it currently functions, and YAMS to ADD to it with additional languages in the root of the user’s choosing?

          maybe I am missing something here.

          Just a note on monolingual documents and why I treat them as distinct from multilingual ones. Some people like myself use MODx to manage non-html resources, like CSS, javascript, RSS and XML files as well as HTML content. It is not always appropriate to tie them into a particular language or view them via a tabbed language interface. I wanted a way of treating them like normal MODx documents.

          I agree with you on several points.
          1. YAMS isn’t very intuitive at the moment. Better documentation and simplified module interface could help here I think.
          2. From the point of view of migrating an existing site it is better if existing URLs don’t have to change. It is possible to achieve that currently, but only if the server name for monolingual pages is different - which I admit is not very nice.

          So, I need to look at several things:

          1. Is it really necessary to be able to identify whether a page is mono- or multi- lingual from the URL from a programmatic point of view? What problems would it cause if monolingual and default language versions of multilingual documents shared the same URL.
          2. If it is necessary to identify monolingual documents via the URL, then would it be nicer if monolingual pages could be specified under a subdirectory, like mysite.com/mono?

          I can’t answer these off the top of my head. I’ll need to stare at the code a bit, think carefully and post back here in the near future.

          In the meantime, we should be able to get you up and running with some sort of working install - perhaps even with the default language installed at the root. Just need to figure out what’s causing those redirection problems.
            YAMS: Yet Another Multilingual Solution for MODx
            YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
            Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
            • 30497
            • 245 Posts
            Quote from: PMS at Aug 12, 2009, 07:57 AM

            Just a note on monolingual documents and why I treat them as distinct from multilingual ones. Some people like myself use MODx to manage non-html resources, like CSS, javascript, RSS and XML files as well as HTML content. It is not always appropriate to tie them into a particular language or view them via a tabbed language interface. I wanted a way of treating them like normal MODx documents.

            Hi,

            I see. I also use MODx to manage css, javascript, rss, etc., so yes, I do see you point. Maybe you could base this on content type - then the issue would only extend beyond normal HTML to javascript documents, but it wouldn’t affect css, plain text and xml formats.

            Quote from: PMS at Aug 12, 2009, 07:57 AM

            I agree with you on several points.
            1. YAMS isn’t very intuitive at the moment. Better documentation and simplified module interface could help here I think.
            2. From the point of view of migrating an existing site it is better if existing URLs don’t have to change. It is possible to achieve that currently, but only if the server name for monolingual pages is different - which I admit is not very nice.

            Yes, there is also the fact that we are introducing a huge duplicate content hole here.think about it on large sites, and then someone uses YAMS and doesn’t consider the / > /en/ issue - in that case, YAMS just duplicated his entire site in a new directory which is crawlable, and than can potentially have very negative consequences for site rankings. At least, with you current method, it would be an imporovment to be able to permanently redirect the mono to the new multi of the same language.

            Quote from: PMS at Aug 12, 2009, 07:57 AM

            So, I need to look at several things:

            1. Is it really necessary to be able to identify whether a page is mono- or multi- lingual from the URL from a programmatic point of view? What problems would it cause if monolingual and default language versions of multilingual documents shared the same URL.
            2. If it is necessary to identify monolingual documents via the URL, then would it be nicer if monolingual pages could be specified under a subdirectory, like mysite.com/mono?
            I hope that the goal with be what you hint at in point one - to get rid of this distinction between the monolingual, and the multi-lingual of the same language - it is too messy for a tight solution (I don’t mean programmatically - I mean in terms of usability and potential crawling problems that can be introduced to the site).

            If it has to be what you outline in point 2, there needs to be a way to 301 redirect one of the two lang versions (the mono and the same lang multi) to the other. The sub directory solution is only good if the user knows he has to exclude this new sub in robots.txt or some other solution.

            Quote from: PMS at Aug 12, 2009, 07:57 AM

            In the meantime, we should be able to get you up and running with some sort of working install - perhaps even with the default language installed at the root. Just need to figure out what’s causing those redirection problems.

            Ok, thanks for your help. Let’s look at this now.

            First, I am clearing cache (MODx and Browser) regularly.

            Second, I found the main cause of my problems with YAMS not working at all - the plugin SEO Strict URLs. This is a very good plugin that I use regularly - it 100% prevent duplicate content issues in MODx. Grab the source here:

            http://www.stanback.net/code/modx/seo-strict-urls.html

            By disabling SEO Strict URLs and by making /en/ my root for multilingual English, I now have YAMS working!

            This is great progress for me. Now to move on from there, there are two issues...

            1. Can YAMS work with SEO Strict URLs in the future? (Only you can tell me that smiley.)

            2. I need to try and get my multilingual English running in host root.

            I’ll tell you that my ideal solution (once again, mostly based on my desires for SEO) would be to run each (non-dominant) language on its own subdomain, rather than sub-directory. So, in my specific case here, I’d like this:
            English - www.domain.com
            Russian - ru.domain.com
            Spanish - es.domain.com

            And based on your previous suggestion to me, I uess I’d then choose to put the monolingual on mono.domain.com (But from the way you wrote this I guess this is untested and might not work...)

            Can I use YAMS with subdomains like this???

            If not, I’ll try to acheive English at / and the others at /lang/. I’m going to go create some subdomains now and do some other things ... maybe I’ll hear back from you before I get to my testing of these scenarios, so I’ll check back...

            Thanks for your help and for YAMS!
              • 22851
              • 805 Posts
              Okay. We’re on the right track now.

              First of all, lets clear up some misunderstandings.

              1. YAMS doesn’t introduce ANY duplicate content. Monolingual documents are available at one URL only. Multilingual documents are available in several languages - each with their own unique URL. Translated content doesn’t count as duplicate content as far as search engines are concerned.

              2. YAMS does allow existing standard websites to be made multilingual in a search engine friendly way. When YAMS is set up, existing default language pages may change their location and new language variants are created. On the ’Other Params’ tab you can configure the http status codes that will be used to redirect from old pages to new ones. You can set

              - one http status code that will be used when redirecting from an old page to a default language multilingual page, and
              - one http status code that will be used when redirecting from an old page to a non-default language multilingual page.

              It is recommended to set the http status of the former to 301, permanent redirect, and the http status of the latter to 303, see other.

              I see. I also use MODx to manage css, javascript, rss, etc., so yes, I do see you point. Maybe you could base this on content type - then the issue would only extend beyond normal HTML to javascript documents, but it wouldn’t affect css, plain text and xml formats.

              I like the idea, but I think that reality is likely to be less clear cut than that. For example, some people will want one xml sitemap per language as if they are managing multiple websites in different languages - and others will want a single xml sitemap for the whole site. Likewise with RSS feeds. So, while the current system is slightly more complicated and difficult to get your head around at first, it’s ultimately more flexible.


              Can YAMS work with SEO Strict URLs in the future? (Only you can tell me that Smiley.)
              It is highly likely that this plugin will have to be customised or re-written to work with YAMS, since it will need to be taught about multilingual URLs. I’ll have a look. So far I have been able to make YAMS work with Wayfinder, Ditto, Jot and eForm without having to hack any of the core code of those snippets - so if we’re lucky I’ll be able to do the same here. If we’re unlucky, we’ll need to re-write the whole thing using YAMS api calls...


              Monolingual
               mono.domain.com
              Multilingual
               English - www.domain.com
               Russian - ru.domain.com
               Spanish - es.domain.com
              

              Yes. That should work. Just use the server names above, set the root names to empty, and update your .htaccess. You’ll probably also need something like:
              ServerName www.domain.com
              ServerAlias ru.domain.com
              ServerAlias es.domain.com
              ServerAlias mono.domain.com
              

              in your virtual host block, if you are using that approach.

              Let me know how you get on.
                YAMS: Yet Another Multilingual Solution for MODx
                YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                • 30497
                • 245 Posts
                Quote from: PMS at Aug 12, 2009, 03:21 PM

                Okay. We’re on the right track now.

                First of all, lets clear up some misunderstandings.

                1. YAMS doesn’t introduce ANY duplicate content. Monolingual documents are available at one URL only. Multilingual documents are available in several languages - each with their own unique URL. Translated content doesn’t count as duplicate content as far as search engines are concerned.

                Of course translated content is not dup. content.

                But yes, now I see that the mono documents redirect to the multilingual default, so there is no dup. content at all.

                I can live without SEO Strict URLs for the moment if I get this running as I like smiley.

                  • 30497
                  • 245 Posts


                  Ok, so I changed mono to mono.domain.com, and English is my default multilingual language location at / ....


                  And that works!

                  But now, with the mono and / changes introduced, I get 404 errors for /ru/ and /es/.

                  I haven’t tried the ru and es as subdomains yet - I am just trying to introduce a change at a time to see what breaks and where.

                  here is my full .htaccess for www.domain.com, including the updated rules from YAMS after I made the server root changes:

                  # For full documentation and other suggested options, please see
                  # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
                  # including for unexpected logouts in multi-server/cloud environments
                  
                  Options +FollowSymlinks
                  RewriteEngine On
                  RewriteBase /
                  
                  # Fix Apache internal dummy connections from breaking [(site_url)] cache
                  RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
                  RewriteRule .* - [F,L]
                  
                  # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
                  #RewriteCond %{HTTP_HOST} .
                  #RewriteCond %{HTTP_HOST} !^example\.com [NC]
                  #RewriteRule (.*) http://example.com/$1 [R=301,L]
                  
                  # Exclude /assets and /manager directories from rewrite rules
                  RewriteRule ^(manager|assets) - [L]
                  
                  # For Friendly URLs
                  # RewriteCond %{REQUEST_FILENAME} !-f
                  # RewriteCond %{REQUEST_FILENAME} !-d
                  # RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                  
                  
                  # The Friendly URLs part from YAMS
                  RewriteCond ${REQUEST_FILENAME} !-f
                  RewriteCond ${REQUEST_FILENAME} !-d
                  RewriteRule ^(.*)$ index.php?q=$1&yams_lang=en [L,QSA]
                  RewriteCond ${REQUEST_FILENAME} !-f
                  RewriteCond ${REQUEST_FILENAME} !-d
                  RewriteRule ^ru/(.*)$ index.php?q=$1&yams_lang=ru [L,QSA]
                  RewriteCond ${REQUEST_FILENAME} !-f
                  RewriteCond ${REQUEST_FILENAME} !-d
                  RewriteRule ^es/(.*)$ index.php?q=$1&yams_lang=es [L,QSA]
                  RewriteCond ${REQUEST_FILENAME} !-f
                  RewriteCond ${REQUEST_FILENAME} !-d
                  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                  # end YAMS
                  
                  # Reduce server overhead by enabling output compression if supported.
                  #php_flag zlib.output_compression On
                  #php_value zlib.output_compression_level 5
                    • 22851
                    • 805 Posts
                    Quote from: towerofbabel at Aug 12, 2009, 04:00 PM

                    But yes, now I see that the mono documents redirect to the multilingual default, so there is no dup. content at all.

                    Hmm. That’s not supposed to be how it works. The mono documents are not supposed to redirect anywhere. In your case, if you go to http://mono.quitsmokingin10days.com/somemonolingualdocumentalias, you should just stay there.

                    Your .htaccess doesn’t look quite right. You’re missing a line like
                    RewriteCond %{HTTP_HOST} ^mono\.quitsmokingin10days\.com$
                    

                    Ahh. That’s because server name mode is not active. To activate it you need to specify all the server names explicitly. I don’t know if that’s documented correctly. I’ll check.

                    So please try setting all your multilingual server names all to www.quitsmokingin10days.com (leaving the mono one as mono.quitsmokingin10days.com), then update your .htaccess (the rules will have changed) and try again.
                      YAMS: Yet Another Multilingual Solution for MODx
                      YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                      Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                      • 30497
                      • 245 Posts
                      Quote from: PMS at Aug 12, 2009, 04:32 PM

                      Quote from: towerofbabel at Aug 12, 2009, 04:00 PM

                      But yes, now I see that the mono documents redirect to the multilingual default, so there is no dup. content at all.

                      Hmm. That’s not supposed to be how it works. The mono documents are not supposed to redirect anywhere. In your case, if you go to http://mono.quitsmokingin10days.com/somemonolingualdocumentalias, you should just stay there.

                      Your .htaccess doesn’t look quite right. You’re missing a line like
                      RewriteCond %{HTTP_HOST} ^mono\.quitsmokingin10days\.com$
                      

                      Ahh. That’s because server name mode is not active. To activate it you need to specify all the server names explicitly. I don’t know if that’s documented correctly. I’ll check.

                      So please try setting all your multilingual server names all to www.quitsmokingin10days.com (leaving the mono one as mono.quitsmokingin10days.com), then update your .htaccess (the rules will have changed) and try again.

                      Ok. Now, /ru/ and /es/ redirect to mono.domain.com

                      www.domain.com works but all base paths in modx are now mono.domain.com, so, my stylesheets aren’t loading, for instance.

                      Unfortunately (or fortunately), I am going on holidays for a week in a few hours, so I’m going to have to roll back shortly and leave it for now. I’ll drop back in and try to finish solving this in a week. I’ll be looking for your reply.

                      Thanks.