We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37743
    • 49 Posts
    I have been working on a new i18n extra for Revolution (tested 2.2+) and it is nearly ready for release. Full details can be found at https://github.com/alanpich/modTranslatedDocument/

    The aim is to allow resources to be presented to the visitor in different languages, while still maintaining a single resource tree (i.e. not separate contexts/trees like Babel).

    I would greatly appreciate any comments/suggestions/bugs/fixes if anybody has the time to test this initial release for me (please submit any bugs on gitHub)

    The transport package attached to this post should do most of the work for you, once installed you will need to:

    • activate the 'onHandleRequest' event for the new plugin (TranslationsGateway)
    • Create a new resource of type 'Translatable Document'
    • Refresh the resource page once saved
    Once the resource is created, refresh the page and the new 'Translations' tab will appear with Settings,TVs etc [ed. note: alanpich last edited this post 14 years, 4 months ago.]
      • 4172
      • 5,888 Posts
      when I try to add new translation I get 'translations.translation_err_save'
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 37743
        • 49 Posts
        Well that's a good start...

        Anything in the ModX error log? What version u running?
          • 11055 ☆ A M B ☆
          • 3,112 Posts
          This is interesting.
          Do you have a running site using this plugin?
            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.
            • 11055 ☆ A M B ☆
            • 3,112 Posts
            This is my first attempt on installing:

            Console running...
            Attempting to install package with signature: translations-1.0-beta1
            Package found...now preparing to install.
            Grabbing package workspace...
            Workspace environment initiated, now installing package...
            Error 42S22 executing statement: Array ( [0] => 42S22 [1] => 1054 [2] => Unknown column 'modPluginEvent.name' in 'where clause' )
            Could not load class: Translation from mysql.translation.
            Successfully installed package translations-1.0-beta1
              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.
              • 11055 ☆ A M B ☆
              • 3,112 Posts
              And I also got the same as Bruno17 when adding the New Translation.
              I selected 'en'.
              I'm using 2.2.2

              Anyway, should I add my language (Indonesia - id) into MODX's lexicon to be available?

              This is the error log:
              [2012-05-08 08:59:09] (ERROR @ /test-modx-2.2.2-pl/www/connectors/resource/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:09] (ERROR @ /test-modx-2.2.2-pl/www/connectors/resource/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:09] (ERROR @ /test-modx-2.2.2-pl/www/connectors/resource/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:09] (ERROR @ /test-modx-2.2.2-pl/www/connectors/resource/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:09] (ERROR @ /test-modx-2.2.2-pl/www/connectors/resource/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:09] (ERROR @ /test-modx-2.2.2-pl/www/connectors/resource/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:16] (ERROR @ /test-modx-2.2.2-pl/www/manager/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:16] (ERROR @ /test-modx-2.2.2-pl/www/manager/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:16] (ERROR @ /test-modx-2.2.2-pl/www/manager/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:16] (ERROR @ /test-modx-2.2.2-pl/www/manager/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:16] (ERROR @ /test-modx-2.2.2-pl/www/manager/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:16] (ERROR @ /test-modx-2.2.2-pl/www/manager/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:16] (ERROR @ /test-modx-2.2.2-pl/www/manager/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 08:59:16] (ERROR @ /test-modx-2.2.2-pl/www/manager/index.php) Error 42S02 executing statement: 
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 09:00:02] (ERROR @ /test-modx-2.2.2-pl/www/assets/components/translations/connector.php) Error 42S02 executing statement:
              INSERT INTO `modx_translations` (`articleID`, `language`, `pagetitle`, `longtitle`, `menutitle`, `description`, `introtext`, `content`) VALUES (7, 'en', '', '', '', '', '', '')
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              [2012-05-08 09:00:18] (ERROR @ /test-modx-2.2.2-pl/www/assets/components/translations/connector.php) Error 42S02 executing statement:
              INSERT INTO `modx_translations` (`articleID`, `language`, `pagetitle`, `longtitle`, `menutitle`, `description`, `introtext`, `content`) VALUES (7, 'de', '', '', '', '', '', '')
              Array
              (
                  [0] => 42S02
                  [1] => 1146
                  [2] => Table 'test_modx_222pl.modx_translations' doesn't exist
              )
              
              
              
                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.
                • 37743
                • 49 Posts
                Hey goldsky, thanks for getting back to me so soon (and on so much detail!)
                It looks as though the db resolver isn't working properly in 2.2, I'll get it patched up n post another package for you.

                It was working fine in 2.0 (current distro when I started). ModX moves on so fast!
                  • 37743
                  • 49 Posts
                  OK... take two. I have checked over the transport package and the mgr interface on a completely fresh install of 2.2.2. Everything seems to be working as it should (famous last words)

                  There are a couple of installation niggles to be ironed out, but I have added the method i followed for a successful install to the package readme, and also online https://github.com/alanpich/modTranslatedDocument/blob/master/BETA%20INSTALL%20GUIDE.md"" target="_blank" rel="nofollow">here.

                  A new transport package is attached to this post


                  @Goldsky - to add a language not in the list you are correct; just create a lexicon entry in that language.
                  The best way to do this would be to add the following entry:
                  Namespace: translations
                  Topic:     languages
                  Key:       translations.language.id
                  Value:     Indonesian

                  [ed. note: alanpich last edited this post 14 years, 4 months ago.]
                    • 11055 ☆ A M B ☆
                    • 3,112 Posts
                    Hi Alan,
                    Right now i'm using PHP's Strict Standard mode, and it seems the plugin breaks the entire manager, and I got this on the front end:
                    Strict Standards: Declaration of modTranslatedDocument::get() should be compatible with xPDOObject::get($k, $format = NULL, $formatTemplate = NULL) in D:\localhost\modx-revo-tests\core\components\translations\model\translations\modtranslateddocument.class.php on line 169
                      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.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Tried installing the second package, and get this results:
                      Attempting to install package with signature: translations-1.0-beta1
                      Package found...now preparing to install.
                      Grabbing package workspace...
                      Workspace environment initiated, now installing package...
                      Could not load class: Translation from mysql.translation.
                      Successfully installed package translations-1.0-beta1


                      When trying to create a new translation of a Translation page, I get an error message "translations.translation_err_save", and the error log contains
                      [2013-03-25 05:46:07] (ERROR @ /revo226/assets/components/translations/connector.php) Error 42S02 executing statement:
                      INSERT INTO `modx_translations` (`articleID`, `language`, `pagetitle`, `longtitle`, `menutitle`, `description`, `introtext`, `content`) VALUES (12, 'fr', '', '', '', '', '', '')
                      Array
                      (
                          [0] => 42S02
                          [1] => 1146
                          [2] => Table 'revo226.modx_translations' doesn't exist
                      )
                      


                      I manually created the table, and was able to add a "new translation", but it can't save the translation. My PHP error log has
                      [25-Mar-2013 06:08:52 Europe/Berlin] PHP Strict Standards:  Declaration of modTranslatedDocument::get() should be compatible with xPDOObject::get($k, $format = NULL, $formatTemplate = NULL) in /Applications/MAMP/htdocs/revo226/core/components/translations/model/translations/modtranslateddocument.class.php on line 169
                      
                      which is rather odd, as line 169 is the last line of the file. [ed. note: sottwell last edited this post 13 years, 6 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