mattbradley / livestampjs

A simple, unobtrusive jQuery plugin that provides auto-updating timeago text to your timestamped HTML elements using Moment.js.
http://mattbradley.github.com/livestampjs
MIT License
409 stars 70 forks source link

Multi Lingual version #18

Closed macray125 closed 9 years ago

macray125 commented 11 years ago

Hi Sir,

Can you help me on how to convert this into Multi lingual languages

Thanks.

mattbradley commented 11 years ago

Livestamp.js uses Moment.js to generate all of the time-ago text, so it is compatible with Moment's language support. Check out Moment's internationalization documentation to get Moment working with other languages.

crapthings commented 10 years ago

awesome to see this. @mattbradley

pangui commented 9 years ago

I'm having trouble setting moment.locale before livestamp replaces DOM elements (with data-livestamp). My intention is to do something like this:

moment.locale($('body').data('lang'));

I have checked both livestamp and moment documentation but I can't find the way to do it. Thanks a lot!

leap-it commented 9 years ago

pangui what i did is load the moment.js first (not the moment with locals) then i load the fr.js (thats right i created a file for each language fr.js en-gb.js etc...) then i load the livestamp.js this works for me.

ps i downloaded this file which contains a folder with most langugue files already in them :) http://fullcalendar.io/download/

pangui commented 9 years ago

Thank you @leap-it I'm going to try your suggestion