Support » Plugin: Relative Date Template Tag » Localization Ready

  • Hi there.
    Pretty nice plugin for dev’s Eric.
    Simple, yet powerful.

    I needed the output text translated to Spanish,
    so I get on the code and made some mods.

    • Added some code to allow POT file translations.
    • Modified just a little bit iaRelativeDate.class.php:
      – Added class constant DOMAIN for text domain translation
      – Removed spaces for singular words in “check_name” method.
      (the spaces were added already in “build_rel_date” method)
      – Added ‘prefix’ parameter for flexibility.
    • The languages dir include POT file and es_ES .po, .mo files.

    Download link (mediafire):

    The zip file contains the plugin.
    You just need to make your translations with POEdit or similar.


        $params = array(
             'prefix' => 'Publicado hace ',
             'suffix' => ''
        the_relative_date( $params );


    Publicado hace 1 hora

    POT file source words:
    ‘second’, ‘seconds’, ‘minute’, ‘minutes’, ‘hour’, ‘hours’, ‘day’, ‘days’, ‘week’, ‘weeks’, ‘month’, ‘months’, ‘year’, ‘years’, ‘decade’, ‘decades’, ‘centuries’, ‘century’, ‘millenia’, ‘millenium’, ‘moments’, ‘just’, ‘ago’

    I hope this is helpful.

  • The topic ‘Localization Ready’ is closed to new replies.