jquery-timeago
jquery-timeago copied to clipboard
How can I add translation for months' names?
Hello.
I'd like to type the date in 'title' in english i.e.: title="July 17, 2008" and I'd like to add the translation for the name of the 12 months in a script, i.e. July: "Julho", as we have in locale files, so when I set up the locale to portuguese the user would get the date not as July 17, 2008 but Julho 17, 2008.
Is there a way to do it?
Example

Best regards.
https://github.com/rmm5t/jquery-timeago/tree/master/locales
Best regards!!
I didn't find anything related to the name of the months in 'locale'. I don't want to use short version like '1d, 1m...', I'd like to use the name of months but translated. I.e. (es) Enero 27... (fr) Janvier 27... (pt) Janeiro 27...
the locale js files adds a customization support for the relative time text! u 're making a mistake, 'cause this plugins only converts the iso to a relative time text. perhaps u're confusing w/ the examples... the locale info comes from ur data or info actually showing. no need to replace the eng notations :)
in othr words, u can set the title attr w/ the text u wanna show... =)
<time class="timeago" datetime="[dateisoformat]" title="[Custom user text]">... and this text is edited from the plugin using the locales</time>
in othr words, u can set the title attr w/ the text u wanna show... =)
<time class="timeago" datetime="[dateisoformat]" title="[Custom user text]">... and this text is edited from the plugin using the locales</time>
But that's the problem. I wanna show the text in title attr in multiple languages. I want to show it by default in english, but the user can define the language he will see (es, fr, pt...). That's the reason I translated the names of the months. Perhaps this is not the right way to do it, but the problem is solved, and sincerely I didn't find how to solve it using your instructions.
,