We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22851
    • 805 Posts
    Quote from: mikefluff at Oct 18, 2009, 11:46 PM

    Thats ok! WebloginPE solution working for me. Another thing I can’t resolve for using with YAMS is AjaxSearch. When I’m making search with jquery mode of snippet in common template - everything ok, but if I trying to make the same search on the multilingual enabled template - it’s searching but finds nothing. Any issues?
    Hi @mikefluff

    Unfortunately I appear to have overlooked this post. I just found it when searching for information AjaxSearch for someone else. AjaxSearch searches in the standard document variables by default, but you will want to configure it to search in the multilingual template variables. Please see this thread on YAMS + AjaxSearch.
      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.
      • 14404
      • 84 Posts
      Quote from: ysera at Oct 09, 2009, 11:31 AM

      All right. I’m an OX!

      I’ve created a .htaccess file (instead of ht.access) copied into my root folder of the localhost, and...
      Working as intended!!!

      I’m happy! grin

      Thank you for your time PMS!


      First of all,

      Hello guys, i’m Joey and new here cool

      Im trying to make a site with multiple languages using YAMS and i kindoff have the same problem
      as ysera had. Only his solution isn’t mine solution. The problem is that i dont get to the page i want like in example:

      When im going to ’localhost/modx/’ it automatically redirects me to ’http://localhost/modx/en/index.php?id=1
      Then i get the error Object not found 404

      When i put a * at the Modules/YAMS/MODx URLs field, ’localhost/modx’ redirects me to the right page but then it seems like other languages except for the ’main pages’ aren’t working.

      I think i already read all threads about this but i couldn’t find it, excuse me if i didnt look good enough..

      I also added those things from this tutorial: http://modxcms.com/forums/index.php/topic,42405.0.html
      Output is just a list with - English , no language selection or w/e

      can anyone help me?

      Kinds Regards,

      Joey

        • 22851
        • 805 Posts
        Hi Joey.

        Welcome to MODx and to YAMS.

        To start off with, please could you tell me which versions of MODx, YAMS (Modules>YAMS>Documentation>About) and ManagerManager you have installed.

        Then please could you explain a bit about how you have chosen to configure YAMS (root name mode, multilingual aliases,...)? (It might be easiest to take screenshots of the module interface or to provide the contents of the yams.config.inc.php file from your assets\modules\yams sub-directory.)

        Cheers.
          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.
          • 14404
          • 84 Posts
          Hi PMS,

          Thank you, ok here is some information:

          Versions:

          ModX 1.0.2
          YAMS 1.1.7 Alpha RC7
          ManagerManager 0.3.6

          yams.config.inc.php:
          <?php
            // The ids of the active languages
            $this->itsActiveLangIds = array(
              'en'
              , 'fr'
              , 'de'
              , 'nl'
            );
            // The ids of the inactive languages
            $this->itsInactiveLangIds = array(
            );
            // The language direction (ltr or rtl)
            $this->itsIsLTR = array(
              'en' => TRUE
              , 'fr' => TRUE
              , 'de' => TRUE
              , 'nl' => TRUE
            );
            // The default language id
            $this->itsDefaultLangId = 'en';
            // The name of the root folder
            $this->itsRootName = array(
              'en' => 'en'
              , 'fr' => 'fr'
              , 'de' => 'de'
              , 'nl' => 'nl'
            );
            // The monolingual page server name
            $this->itsMonoServerName = '';
            // The server name for each language
            $this->itsMultiServerName = array(
              'en' => ''
              , 'fr' => ''
              , 'de' => ''
              , 'nl' => ''
            );
            // The name of each language in all languages
            $this->itsLangNames = array(
              'en' => array(
                'en' => 'English'
                , 'fr' => '(French)'
                , 'ja' => '(Japanese)'
                , 'de' => '(German)'
                , 'ru' => '(Russian)'
              )
              , 'fr' => array(
                'en' => '(Anglais)'
                , 'fr' => 'Français'
                , 'ja' => '(Japonais)'
                , 'de' => '(Allemand)'
                , 'ru' => '(Russe)'
              )
              , 'de' => array(
                'en' => '(Englisch)'
                , 'fr' => '(Französisch)'
                , 'ja' => '(Japanisch)'
                , 'de' => 'Deutsch'
                , 'ru' => '(Russisch)'
              )
              , 'nl' => array(
                'en' => '(Engels)'
                , 'fr' => '(Frans)'
                , 'de' => '(Duits)'
                , 'nl' => 'Nederlands'
              )
            );
            $this->itsChooseLangText = array(
              'en' => 'Select language'
              , 'fr' => 'Choisir une langue'
              , 'de' => 'Waehle Sprache'
              , 'nl' => 'Kies taal'
              );
            // The languages that should be directed to this language root.
            // These should be in priority order
            // The tag is in the format provided by the HTTP Accept-Language header:
            // xx, or xx-yy, where
            // xx: is a two letter language abbreviation
            //     http://www.loc.gov/standards/iso639-2/php/code_list.php
            // yy: is a two letter country code
            //     http://www.iso.org/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm
            // xx on its own matches an xx Accept-Language header
            // with any country code
            // At least one language tag must be specified.
            $this->itsLangTags = array(
              'en' => array(
                'en' 
                )
              , 'fr' => array(
                'fr' 
                )
              , 'de' => array(
                'de' 
                )
              , 'nl' => array(
                'nl' 
                )
              );
            // The MODx manager language name for each language group.
            $this->itsMODxLangName = array(
              'en' => 'english'
              , 'fr' => 'francais-utf8'
              , 'de' => 'german'
              , 'nl' => 'nederlands-utf8'
              );
            // The encoding modifier.
            // 'manager' means use the manager setting
            // 'u' if webpage content is in UTF-8
            // '' otherwise
            $this->itsEncodingModifierMode = 'manager';
            // a comma separated list of active template ids
            // if the default activity is none
            $this->itsActiveTemplates = array(
              4 => NULL
                );
            // Whether or not to manage template variables automatically
            $this->itsManageTVs = TRUE;
            // The yams current lang query parameter name
            $this->itsLangQueryParam = 'yams_lang';
            // The yams change lang query parameter name
            $this->itsChangeLangQueryParam = 'yams_new_lang';
            // Turn on/off redirection from existing pages to multilingual pages
            // You can set to false if you are developing a site from scratch
            // - although leaving as TRUE does not harm in this instance
            // Set to TRUE if you are converting a website
            // that has already been made public
            $this->itsRedirectionMode = 'default';
            // The type of http redirection to perform when redirecting to the default language
            $this->itsHTTPStatus = 307;
            // The type of http redirection to perform when redirecting to a non-default language
            $this->itsHTTPStatusNotDefault = 303;
            // The type of http redirection to perform when responding to a request to change language
            $this->itsHTTPStatusChangeLang = 303;
            // Whether or not to hide the original fields
            $this->itsHideFields = FALSE;
            // Whether or not to place tvs for individual languages on separate tabs
            $this->itsTabifyLangs = TRUE;
            // Whether or not to synchronise the document pagetitle with the default language pagetitle
            $this->itsSynchronisePagetitle = FALSE;
            // Whether or not to to use EasyLingual Compatiblity Mode
            $this->itsEasyLingualCompatibility = FALSE;
            // Whether or not to show the site_start document alias.
            $this->itsShowSiteStartAlias = TRUE;
            // Whether or not to rewrite containers as folders.
            $this->itsRewriteContainersAsFolders = FALSE;
            // If MODx is installed into a subdirectory then this param
            // can be used to specify the path to that directory.
            // (with a trailing slash and no leading slash)
            $this->itsMODxSubdirectory = 'modx';
            // The URL conversion mode
            // none: Don't do any automatic conversion of MODx URLs.
            // default: Convert MODx URLs surrounded by double quotes to (yams_doc:id) placeholders
            // resolve: Convert MODx URLs surrounded by double quotes to (yams_docr:id) placeholders
            $this->itsURLConversionMode = 'default';
            // Whether or not to use multilingual aliases.
            $this->itsUseMultilingualAliases = TRUE;
            // Whether or not multilingual aliases are unique.
            $this->itsMultilingualAliasesAreUnique = TRUE;
            // Whether or not to use mime-dependent URL suffixes.
            $this->itsUseMimeDependentSuffixes = FALSE;
            // The mime-type to suffix mapping.
            $this->itsMimeSuffixMap = array(
              'application/xhtml+xml' => '.xhtml'
              , 'application/javascript' => '.js'
              , 'text/javascript' => '.js'
              , 'application/rss+xml' => '.rss'
              , 'application/xml' => '.xml'
              , 'text/xml' => '.xml'
              , 'text/css' => '.css'
              , 'text/html' => '.html'
              , 'text/plain' => '.txt'
              );
            // Whether or not to use stripAlias on multilingual aliases.
            $this->itsUseStripAlias = TRUE;
            // An array of doc ids for which URLs of the form index.php?id= ... will be  // accepted - even if friendly aliases are being used.
            // A * entry means all docIds.
            $this->itsAcceptMODxURLDocIds = array(
              '*'
              );
          ?>


          Server config:
          You can use the following text to replace the friendly URLs sections of your MODx .htaccess file.
          # Friendly URLs
          RewriteEngine On
          RewriteBase /modx/

          # Fix Apache internal dummy connections from breaking [(site_url)] cache
          RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
          RewriteRule .* - [F,L]

          # Exclude /assets and /manager directories from rewrite rules
          RewriteRule ^(manager|assets) - [L]

          # Redirect from mydomain.com/rootname to mydomain.com/rootname/
          RewriteRule ^en$ en/ [R=301,L]
          RewriteRule ^fr$ fr/ [R=301,L]
          RewriteRule ^de$ de/ [R=301,L]
          RewriteRule ^nl$ nl/ [R=301,L]

          # The Friendly URLs part
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^nl/(.*)$ index.php?q=$1 [L,QSA]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^de/(.*)$ index.php?q=$1 [L,QSA]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^fr/(.*)$ index.php?q=$1 [L,QSA]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

          Language settings are kindof default:
          * Language dependent server name mode is currently OFF. To enable this mode you need to specify a monolingual server name and a multilingual server name for each active language.
          * Language dependent root name mode is currently ON. To disable this mode you need to clear all root names.
          * Unique multilingual aliases mode is currently ON. YAMS can determine the document id and language from the alias alone, so it is not necessary to specify root names or server names.
          * Query param mode is currently OFF. The language can be determined from the server and root names alone. No additional query param is required.

          Monolingual Settings Help Action/Name Edit
          The server name to use for non-multilingual pages. Leave the field blank to accept the default server name, in which case the current server name will be shown in brackets. Server Name (localhost)
          The site URL for monolingual pages. Site URL http://localhost/modx/
          Multilingual Settings Help Action/Name Edit Edit Edit Edit Add
          Deactivate Deactivate Deactivate
          Is Default Set Default Set Default Set Default
          Help Action/Name Edit Edit Edit Edit Add
          Deactivate Deactivate Deactivate
          Is Default Set Default Set Default Set Default
          An identifier for this language group. Alphanumeric characters, no spaces. Lang ID en fr de nl
          A comma separated list of language tags, in priority order, to be associated with this language group. eg: en-us,en-gb Tags en fr de nl
          The server/host name associated with the language group. Leave the field blank to accept the default server name, in which case the current server name will be shown in brackets. Server Name (localhost) (localhost) (localhost) (localhost)
          A root folder name to be used with the language group. Leave empty if you don’t which to distinguish language groups by folder. Root Name en fr de nl
          The site url for the language group. Formed from the server name and root name. Each language must have a unique site url. This parameter can be accessed using the (yams_site) placeholder. Site URL http://localhost/modx/en/ http://localhost/modx/fr/ http://localhost/modx/de/ http://localhost/modx/nl/
          The language direction. This parameter can be accessed using (yams_dir). Language direction ltr ltr ltr ltr
          The corresponding MODx manager language. For use with snippets like ditto and eForm which accept a language parameter. MODx Language Name english francais-utf8 german nederlands-utf8
          Text, written in the current language, to be used when presenting the user with a choice of languages. Select Language Text Select language Choisir une langue Waehle Sprache Kies taal
          The name to use for the language group en written in the current language. Name for en English (Anglais) (Englisch) (Engels)
          The name to use for the language group fr written in the current language. Name for fr (French) Français (Französisch) (Frans)
          The name to use for the language group de written in the current language. Name for de (German) (Allemand) Deutsch (Duits)
          The name to use for the language group nl written in the current language. Name for nl Nederlands
          The name to use for the new language group in its own language. Used only when adding a new language. Name for new


          http://img17.imageshack.us/img17/3747/multilingualtemplates.jpg


          http://img13.imageshack.us/img13/5931/otherparams.jpg

          Let me know if you need something more and thanks for your help.

          Kinds Regards, Joey
            • 22851
            • 805 Posts
            @Joeeeeh.

            Thanks for the comprehensive info. I set-up and local install according to your specifications (MODx 1.0.1, YAMS 1.0.7 RC7), imported your config file and used your server config rules... It works for me. However, I did notice that when I disable my server config rules it breaks in exactly the same way you described. The default language appears but the others cause not found errors.

            My conclusion is that your .htaccess (linux) or ht.access (Windows) file is not being picked up. Assuming that you are using xampp under Windows (let me know if you are not) then your file will need to be called ht.access and it will have to be situated in your xampp\htdocs\modx\ directory.

            Somewhere in your server configuration (either your main config file, apache\conf\httpd.conf, or in the relevant virtual host block if you have set one up, apache\conf\extra\httpd-vhosts.conf) you will need to specify:

            AccessFileName ht.access

            You may also need to specify something like:

            <Directory your-folder/xampp/htdocs/modx/>
            AllowOverride All
            </Directory>

            Hope that helps.
              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.
              • 14404
              • 84 Posts
              Ok its solved, thanks a lot!

              It was the problem that it didnt run with EasyPHP5.2.10 huh

              I tried the things you said, but then Apache in easyphp gave me an error about
              the directory’s, so i tried xampp, which worked smiley thanks a lot!
                • 14404
                • 84 Posts
                Oh btw,

                One more thing, do you have a code that shows my available languages with flags and links to it? Like when im on the page "http://localhost/modx2/en/index.php?id=16"
                and i press the dutch flag, it redirects me automatically to "http://localhost/modx2/nl/index.php?id=16"

                Cheers
                  • 22851
                  • 805 Posts
                    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.
                    • 14404
                    • 84 Posts
                    Quote from: PMS at Dec 09, 2009, 10:42 AM

                    Please see this post on this post on how to create a linked language flag list. Cheers.

                    I did, but its not working? It only shows my current flag and nothing more :S

                    I also had another question, is it possible to make the ’General’ tab as my ’English’ tab? because now when i need to add my English page, i have to do it on the English page instead of General, so my point is, How can i just add it to ’General’ so YAMS see’s ’General’ as English? (english = default language)
                      • 22851
                      • 805 Posts
                      Quote from: Joeeeeh at Dec 09, 2009, 12:14 PM

                      I did, but its not working? It only shows my current flag and nothing more :S
                      I’ll test and get back to you.

                      Quote from: Joeeeeh at Dec 09, 2009, 12:14 PM

                      I also had another question, is it possible to make the ’General’ tab as my ’English’ tab? because now when i need to add my English page, i have to do it on the English page instead of General, so my point is, How can i just add it to ’General’ so YAMS see’s ’General’ as English? (english = default language)
                      Typically what you would do is to hide the standard document variables on the General tab. To do this set: Modules>YAMS>Other Params>Document Layout Settings>Hide Redundant Fields=Hide Fields.

                      On multilingual documents it is necessary to use the default language template variables rather than the standard document variables. By default these TVs are placed on the default language tab using the YAMS ManagerManager rules. However, if it is important to have the default language TVs appearing on the general tab then it should be possible to apply a patch to the YAMS ManagerManager rules to allow it. I’m not sure I’d want to add it as a standard option to YAMS though. Let me know.
                        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.