jQuery Timeago timestamps: How to choose language?

You can get the spanish .js file for timeago here: https://gist.github.com/6251.

Reference the correct .js file in your website where you are loading an English or Spanish page.

Ie in file page_spanish.html:

<script type="text/javascript" src="timeago_spanish.js"></script>

Ie in file page_english.html:

<script type="text/javascript" src="timeago_english.js"></script>

Or if you are doing this via one PHP script, toggle based on a variable:

<?php
    if $page_lang = 'SPANISH' then
        echo '<script type="text/javascript" src="timeago_spanish.js"></script>';
    else if $page_lang = 'ENGLISH' then
        echo '<script type="text/javascript" src="timeago_english.js"></script>';
?>