Skip to content

Commit

Permalink
merge it locale #19
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Sep 12, 2016
2 parents 26526da + 7eb6eba commit 2c834b1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
18 changes: 18 additions & 0 deletions locales/it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = function(number, index) {
return [
['poco fa', 'tra poco'],
['%s secondi fa', '%s secondi da ora'],
['un minuto fa', 'un minuto da ora'],
['%s minuti fa', '%s minuti da ora'],
['un\'ora fa', 'un\'ora da ora'],
['%s ore fa', '%s ore da ora'],
['un giorno fa', 'un giorno da ora'],
['%s giorni fa', '%s giorni da ora'],
['una settimana fa', 'una settimana da ora'],
['%s settimane fa', '%s settimane da ora'],
['un mese fa', 'un mese da ora'],
['%s mesi fa', '%s mesi da ora'],
['un anno fa', 'un anno da ora'],
['%s anni fa', '%s anni da ora']
][index];
}
8 changes: 4 additions & 4 deletions tests/locales_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ var fs = require('fs');
var test = require('tape');
var timeago = require('..');

var tobeTested = ['en', 'zh_CN', 'fr', 'nl_BE', 'pt_BR', 'da', 'in_ID', 'es', 'pl', 'zh_TW', 'sv', 'el_GR']; // when add a new locale, add locale's name here
var tobeTested = ['en', 'zh_CN', 'fr', 'nl_BE', 'pt_BR', 'da', 'in_ID', 'it', 'es', 'pl', 'zh_TW', 'sv', 'el_GR']; // when add a new locale, add locale's name here

test('Testing locales', function (t) {
for (var i = 0; i < tobeTested.length ; i++) {
var locale_name = tobeTested[i];

console.log('\nTesting locales [' + locale_name + ']');

var locale = require('../locales/' + locale_name);
Expand All @@ -33,5 +33,5 @@ test('Testing locales', function (t) {

t.end();
});


0 comments on commit 2c834b1

Please sign in to comment.