<commit_before>'use strict';

var should = require('should');
var l10n = require('../lib/server/l10n');

describe('l10n', () => {
   
    describe('translation', () => {
        
        it('should return a translation', done => {
            l10n.translate(null, 'its time for a beer', 'fr')
            .then(t => t.translation.should.not.equal(t.original))
            .finally(() => done());
        });
       
        it('should not translate on same language', done => {
            l10n.translate(null, 'its time for a beer', 'en')
            .then(t => t.translation.should.equal(t.original))
            .finally(() => done());
        });
        
        it('should support french translations', done => {
            l10n.translate(null, 'its time for a beer', 'fr')
            .then(t => t.translation.should.equal('son temps pour une bière'))
            .finally(() => done());
        });

   }) 
});<commit_msg>more translation tests, #60<commit_after>'use strict';

var should = require('should');
var l10n = require('../lib/server/l10n');

describe('l10n', () => {
   
    describe('translation', () => {
        
        it('should return a translation', done => {
            l10n.translate(null, 'its time for a beer', 'fr')
            .then(t => t.translation.should.not.equal(t.original))
            .finally(() => done());
        });
       
        it('should not translate on same language', done => {
            l10n.translate(null, 'its time for a beer', 'en')
            .then(t => t.translation.should.equal(t.original))
            .finally(() => done());
        });
        
        it('should support French (fr) translations', done => {
            l10n.translate(null, 'its time for a beer', 'fr')
            .then(t => t.translation.should.equal('son temps pour une bière'))
            .finally(() => done());
        });

        it('should support Chineese (zh) translations', done => {
            l10n.translate(null, 'its time for a beer', 'zh')
            .then(t => t.translation.should.equal('一杯啤酒的时候了'))
            .finally(() => done());
        });

        it('should support Mainland China (zh-CN) translations', done => {
            l10n.translate(null, 'its time for a beer', 'zh-CN')
            .then(t => t.translation.should.equal('一杯啤酒的时候了'))
            .finally(() => done());
        });

        it('should support Hong Kong (zh-HK) translations', done => {
            l10n.translate(null, 'its time for a beer', 'zh-HK')
            .then(t => t.translation.should.equal('一杯啤酒的时候了'))
            .finally(() => done());
        });

        it('should support Taiwaneese (zh-TW) translations', done => {
            l10n.translate(null, 'its time for a beer', 'zh-TW')
            .then(t => t.translation.should.equal('一杯啤酒的時候了'))
            .finally(() => done());
        });
   }) 
});
{'fraction_non_alphanumeric': 0.18067666550401115, 'fraction_numerical': 0.011859086152772933, 'mean_word_length': 1.9937369519832986, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4387420', 'n_tokens_mistral': 898, 'n_tokens_neox': 863, 'n_words': 202}