We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38304
    • 68 Posts
    Where is the [[+ago]] Snippet of Articles/Quip?

    I have to translate the posting date. Quip "ago" translation in Lexicon isn't working in this case.

    So where i can find the [[+ago]] Snippet or how to translate this without changing whole to a different Mainlanguage.

    Thank you!

    With best regards,
    Chris

    This question has been answered by MokoJumbie. See the first response.

    [ed. note: theoretiker last edited this post 13 years, 6 months ago.]
      • 38304
      • 68 Posts
      Ok, i think i have to specify what i am trying to do, so somebody cloud help me maybe.

      Ok, i have a norwegian Customer and Norwegian dedicated Website with Articles.

      So i want to translate some parts to norwegian for more comfortable feel for their Blogvisitors.

      Erverything is fine i had much progress. But norwegian notation of date is something diffrent than US / EN / DE ...

      So i translated via lexicon the core filter date items... year month week day and the pre and post items of date (time).

      But now i have a really small issue but it is one and i have to fix it.

      Recent Comments in articles show "ago 3 months, 2 days" by default and now its norwegian says something like
      "For 2 måneder, 4 uker siden" ... but the colon (,) is wrong there.

      I want to get rid of the colon "," and get it to "og" so it says
      "For 2 måneder og 4 uker siden"
      instead of
      "For 2 måneder, 4 uker siden".

      the Date in Articles recent comments is done by [[+ago]] but i can't find the ago snippet to change the colon.

      Would be really nice to have a fast workaround. Time is running. I couldn't find the place to edit.

      With best regards,
      Chris
      • discuss.answer
        • 20093
        • 81 Posts
        Just had a quick look, but you might have some luck looking at the function getTimeAgo() in quip.class.php
          • 38304
          • 68 Posts
          For all future People who are searching the delimiting colon on recent comments date/time too:

          Open:
          core/components/quip/model/quip/quip.class.php

          Search for function:
          getTimeAgo

          third last line OF THE FUNCTION:
          $output = implode(', ',$ago);


          kill the colon...

          $output = implode('I_AM_NOT_HERE_ANYMORE ',$ago);


          did it.



          Thank you very much for your help MokoJumbie!!!!

          With best regards,
          Chris

            • 20093
            • 81 Posts
            Glad that helped, but just realize that any updates to Quip in the future will break that. Maybe there is a better way to format the output of getTimeAgo so it's easier to localize. getTimeAgo in Quip is just coped from the core so you may want to file this as a bug/feature request with the MODx revo tracker.
              • 38304
              • 68 Posts
              Yes, you are right and i am aware of it, but i think opening a ticket for an colon is a bit overdoze.

              The worstcase is an appearing colon which is aceptable but not really wanted. Fixing is editing one line of code.

              I think with the actual issues (and there are some) there is more potential to fix the real things/bugs first and not focus wishlists.

              I have some serious Problems actually... and they are much harder ones....

              You are right... but this colon thing is not that important.

              Thank you again!!!

              with best regards,
              Chris
                • 20093
                • 81 Posts
                Hmm, I hear you but I think this indicates a larger problem of not being to correctly localize strings. It will almost certainly come back to bite someone else. In any case, glad you found a suitable workaround. ^^
                  • 38304
                  • 68 Posts
                  No no.

                  3 month, 2 days ago is correct in the most countries.

                  There is no Norwegian Package at all...

                  My customer just wants to have the "," as "and" ... which is "og" at nrwegian language.

                  So this is no bug/error... its just somelike a polish of notation.

                  "3 month, 2 days ago"

                  gets

                  "For 3 måneder og 2 uker siden".

                  The thing is:
                  "3 måneder, 2 uker siden" is "correct" also...

                  So to get rid of the colon, its just finetuning.

                  In my opinion, the colon hasn't to be there in Quip class but in core filter lexicon (time).
                  This would maybe be a improvement, but colon on core filter lexicon maybe results distortions at other places than quip.

                  with best regards,
                  Chris