We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50312
    • 34 Posts
    I am trying to find a way to get the language switching (on the frontend) work in a way similar to linguaPdoTools. I want the language switching link only to show up if the current resource is translated. For example: my site is set up for two languages (DE/EN). When i am on a DE resource which is not translated into EN (TV lang_published for EN is set to "no"), i do not want the language switch for EN to show up on the frontend on this site.

    Any ideas on how I could handle this?
      • 51231
      • 3 Posts
      I got Lingua working - it is great. However I have two questions/issues:

      #1: I'm using it for two languages (English and German) and the lingua_selector displays sometimes "Select language" and sometimes "lingua.select_language"
      #2: The language selector does something weird with pages which do not have an .html at the end

      For issue #1: http://nde-consulting.com/dr.-johannes-vrana.html
      For issue #2 (and #1): http://nde-consulting.com/
        • 51231
        • 3 Posts
        I "solved" issue #1. The issue is that lingua.select_language is defined in components/lingua/lexicon/en/default.inc.php and that somehow by switching the language the chunk wants to read a different language from the lesxicon - but Lingua only provides en. I "solved" it by just hardcoding "Select language" in the chunk.
          • 51231
          • 3 Posts
          Solved issue #2

          Replace
          $pageURL = http_build_url($pageURL, $parseUrl);

          with
          $pageURL = http_build_url($parseUrl);


          and replace
          $pageURL = $parseUrl['scheme'] . '://' . $parseUrl['host'] . '/' . $parseUrl['path'] . $itemUri;

          with
          if (strstr($parseUrl['path'],$itemUri))
          {$pageURL = $parseUrl['scheme'] . '://' . $parseUrl['host'] . $parseUrl['path'];}
          else
          {$pageURL = $parseUrl['scheme'] . '://' . $parseUrl['host'] . $parseUrl['path'] . $itemUri;}
            • 50312
            • 34 Posts
            BACKEND ISSUE

            I can not save TV's where the second language has an empty value. After saving and refreshing (Backend) I always get the value of my main language in my second language. Happens with imageTV's, MIGX TV's,...

            Example: Main language is German, second language is English.

            imageTV (DE selected): imagename-DE.jpg
            imageTV (EN selected): imagename-EN.jpg

            When I delete the file from the second language:

            imageTV (DE selected): imagename-DE.jpg
            imageTV (EN selected):

            hit save and refresh the page, i get this:

            imageTV (DE selected): imagename-DE.jpg
            imageTV (EN selected): imagename-DE.jpg
              • 51347
              • 82 Posts
              Hi all,

              I'm trying to use importX Plugin with Lingua. The website is in german and english is the second language.

              Is it possible to change the ImportX db-settings depending on which language I'm importing?

              Example: modx_site_content -> modx_lingua_site_content

              Thanks!
                • 11055 ☆ A M B ☆
                • 3,112 Posts
                @joe-petts, you need to contact the importX's author, then.
                  Rico
                  Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                  MODx is great, but knowing how to use it well makes it perfect!

                  www.virtudraft.com

                  Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                  Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                  Maintainter/contributor of Babel

                  Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                  • 50312
                  • 34 Posts
                  I am trying to receive translated fields via getImageList INSIDE a pdoResources call.
                  I am using linguaPdoTools from @Bruno17.
                  The Problem: In the myGetImageListTpl the value of the MIGX fields do not get translated, the default language is always displayed. Example field: "[[+myField]]"

                  pdoResources call:
                  [[!pdoResources? 
                  &parents=`19`
                  &depth=`0`
                  &tpl=`myPdoTpl`
                  &includeContent=`1`
                  &sortby=`menuindex`
                  &sortdir=`ASC`
                  &limit=`0`
                  &showUnpublished=`1`
                  &showHidden=`1`
                  &tvPrefix=``
                  &includeTVs=`lang_published,myMigxTV`
                  &where=`{"TVlang_published.value":"1"}`
                  ]]

                  myPdoTpl content:
                  [[!getImageList?
                  &tvname=`myMigxTV`
                  &tpl=`myGetImageListTpl`
                  &limit=`0`
                  &docid=`[[+id]]`
                  ]]

                  myGetImageListTpl content:
                  <li>[[+myField]]</li>


                  to get the [[+myField]] value i have also tried:
                  <li>[[!lingua.getValue? &id=`[[+id]]` &field=`myField`]]</li>

                  <li>[[!lingua.getValue? &id=`[[+id]]` &field=`[[+myField]]`]]</li>

                  <li>[[!lingua.getValue? &id=`[[+id]]` &field=`[[+migx.title]]`]]</li>

                  and so on... nothing works.

                  Any ideas?
                    • 4172
                    • 5,888 Posts
                    how did you setup MIGX?
                    Do you different field for each language, for example title_de, title_en
                    Or do you have completely different MIGX-items for each language?

                    Then they are not stored in the default TV-value, but in the lingua-table and you will need to fetch that value for getImageList from there.
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 4172
                      • 5,888 Posts
                      Not sure, but I think something like

                      [[!getImageList?
                      &tvname=`myMigxTV`
                      &value=`[[!lingua.getValue? &id=`[[+id]]` &field=`myMigxTV`]]`
                      &tpl=`myGetImageListTpl`
                      &limit=`0`
                      &docid=`[[+id]]`
                      ]]
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!