We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3932
    • 19 Posts
    Hello everyone.
    I’m using MODx Revolution RC. I’ve installed Quip package to enable commenting on my site. As I’m Russian, I translate entire site to Russian language. I tried to translate strings that Quip use, but no success.
    1. I created "ru" language.
    2. I exported topic "default" in "quip" namespace in "en" language.
    3. I imported then this file as "ru:quip:default" and translated some strings.
    4. Changed "cultureKey" setting to "ru".
    5. Cleared caches.
    6. Nothing changed in front-end.

    After that I tried to translate entire site with back-end, and changed then "manager_language" to "ru" as well. Here is 2 screenshots:
    System settings:
    Lexicon with translated string:

    I also looked in class file quip.class.php:
    if ($this->modx->lexicon) {
              $this->modx->lexicon->load('quip:default');
            }
    

    Everything seems ok.
    In snippets there is using of [[&..]] constructions: [[%quip.username_said? &username=`[[+name]]`]]

    What’s wrong?

    P.S. When I changed the lexicon entry in "en" language - it changed in the front-end too.
      • 3932
      • 19 Posts
      One more notice.
      When I’m going to Components menu -> Quip to administer comments, strings are translated.
      That’s why I think the problem is in "cultureKey" setting.
        • 3932
        • 19 Posts
        I assume this is MODx lexicon problem. I’ve created an issue in JIRA: http://svn.modxcms.com/jira/browse/MODX-1854.

        The simpliest way to fix this issue is following.
        In file /core/model/modx/modxlexicon.class.php replace line 122, 156 and 185
         
        122:	if (empty($language)) $language = $this->modx->cultureKey;
        ...
        156:	$language = $this->modx->cultureKey;
        ...
        185:	if (empty($language)) $language = $this->modx->cultureKey;
        

        with this one:
        122:	if (empty($language)) $language = $this->modx->config['cultureKey'];
        ...
        156:	$language = $this->modx->config['cultureKey']
        ...
        185:	if (empty($language)) $language = $this->modx->config['cultureKey'];
        

        And in file /core/model/modx/modparser.class.php replace line 1010
        $language = !empty($this->_properties['language']) ? $this->_properties['language'] : $this->modx->cultureKey;
        

        with
        $language = !empty($this->_properties['language']) ? $this->_properties['language'] : $this->modx->config['cultureKey'];
        


        And thank you guys for great CMF!
          • 22303 MODX Staff
          • 10,725 Posts
          The cultureKey should match the config[’cultueKey’], so it’s just a bug I am guessing.

          Also, use $modx->getOption(’cultureKey’) rather than directly accessing the $modx->config array, as this is not going to be available for direct access in future releases.
            • 28215
            • 4,149 Posts
            This has been fixed in SVN.
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com