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):
https://www.mediafire.com/download/23jqx56gjc1jjji/relative-date-template-tag.zipThe zip file contains the plugin.
You just need to make your translations with POEdit or similar.Example:
<?php $params = array( 'prefix' => 'Publicado hace ', 'suffix' => '' ); the_relative_date( $params ); ?>
Result:
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.
https://www.ads-software.com/plugins/relative-date-template-tag/
- The topic ‘Localization Ready’ is closed to new replies.