We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4395
    • 13 Posts
    I have following problem:

    My chunk look like this:

    <h1><span>Aktualności</span></h1>
    [[!getResources?
    &parents=`46`
    &hideContainers=`1`
    &tpl=`latestNewsTpl`
    &limit=`2`
    &sortby=`publishedon`
    ]]
    <p style="clear: both; text-align: right; padding-right: 20px; margin-top: 10px;">
    <a class="more" href="[[~46]]">zobacz wszystko</a>
    </p>​


    And here is the latestNewsTpl:
    <div class="news" id="news_item_[[+id]]">
            <div class="news-date">
              <div class="day">[[+publishedon:notempty=`[[+publishedon:strtotime:date=`%d`]]`]]</div>
              <div class="month">[[+publishedon:notempty=`[[+publishedon:strtotime:date=`%b`]]`]]</div>
            </div>
      <div class="news-content"><p>[[+introtext:ellipsis=`80`:default=`[[+content:ellipsis=`80`]]`]] <a href="[[~[[+id]]]]">[więcej]</a></p></div>
    </div>​
    


    Problem is that getResources is not getting me Polish months names.. I’ve translated lexicon fields responsible for months, I’ve added cultureKey (`pl`) and nothing.. I’m still getting AUG, JAN etc.
    What is it that I am doing wrong?
    • Hi,

      no solution to bring, but i’m facing the same problem. The OS locales seems properly set, but strtotime still displays english days/mounths.
      Any hint will be much appreciated.
        • 22019
        • 390 Posts
        Sorry, don’t really understand your problem as I don’t do international stuff, but if "więcej" is meant to be a placeholder then it’s mis-tagged. Should be [[+więcej]]

        Probably doesn’t help at all....
          Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • Have you set the php locale? You’ll need to do that in php.ini or write a plugin or snippet to set it as you expect.
          • Thanks for your reply OpenGeek,

            The php locale is set too, but it doesn’t affect the rendering (probably a misconfiguration of server OS). I solved the problem with a plugin as you suggested. If someone with lower php skill than me is interested :
            <?php
            setlocale(LC_ALL, 'fr_FR.UTF-8');
            
            (or whatever locale you need) and plugin triggered on WebPageInit.
              • 1778
              • 659 Posts
              Hi

              not sure of that, but I think I read somewhere, there was a ’problem’ with the setlocale, with Windows...
              On my site on local install (Windows7, WAMP, Revo2) setlocale (well specified in php.ini etc...) does not work and my days and months stay in english (no matter of my settings in System settings or php.ini)
              But on a site on my live server (Linux) with the same settings (in my system settings and my php.ini)the setlocale works and I get the days and months in the right language...
              The problem is the same with other snippets (Quip ...)

              Don’t know if Windows7 (don’t know about other versions) is the culprit for this issue... but ...

              Cheers
              • Hi anso smiley

                Read that too, but if i properly understood, it’s apache’s fault (at least the windows binary). Inn my case it’s running on a Debian Squeeze. So far, i’ve understood that the locales must be properly set before apache & php install. No time to check for now, so i’ll stay with that plugin stuff.

                Thanks for your insight by the way smiley

                Et bonne journée
                  • 1778
                  • 659 Posts
                  Romain

                  You’re probably right about Apacha (instead of W7) I read that a while ago, and I read a lot about a lot of things, can’t remember exactly what and when smiley

                  Thanks for your clarification
                  Bonne journée aussi
                    • 19799
                    • 14 Posts
                    Hi!

                    Referring this lead by anso: http://modxcms.com/forums/index.php/topic,37646.msg318274.html#msg318274.

                    Sadly, I must report that neither locale setting in php.ini, nor plugin triggering every WebPageInit do not change situation a bit.
                    On the remote I was able to test the plugin only as I am on shared UNIX hosting. Locally it was tested under WAMMP/ Trying XAMMP, but it is not important.

                    The important thing is that there is seems no reliable decision exists. Will have to rely on dirty hacks...

                    Thanks to all, who helped.

                    UPD: setlocale() actually works, but ONLY withing the snippet its called in. Even if I insert snippet call (setlocale) into the start of my template, the dates shows as if there no locale change/set.