yuche / vue-strap

Bootstrap components built with Vue.js
http://yuche.github.io/vue-strap/
MIT License
4.71k stars 929 forks source link

About translations #362

Closed smartpierre closed 8 years ago

smartpierre commented 8 years ago

Hello,

I use vue-strap on my projects and I need the french translations, however I don't understand how I am supposed to add it here :

https://github.com/yuche/vue-strap/blob/master/src/utils/utils.js#L83

Could explain me how I should proceed or add this translation yourself please ?

/* fr */
let text = {
    daysOfWeek: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'],
    limit: 'Limite atteinte ({{limit}} objets max).',
    loading: 'Chargement...',
    minLength: 'Taille Min.',
    months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
    notSelected: 'Pas de sélection',
    required: 'Requis',
    search: 'Recherche'
}

Thanks !

smartpierre commented 8 years ago

@wffranco

jokagent commented 8 years ago

I managed to do it without hacking project files. Clone file dist/vue-strap-lang.js somewhere in your project, add your translation (or, in your case, replace) into object inside VueStrapLang function. Then require your file before any import from vue-strap.

require('./VueStrapLang.js');
import {datepicker} from 'vue-strap';

Does anyone know, is this a right way to do it?

wffranco commented 8 years ago

Translations now is separated from the main vuestrap, so if you need translations you have to add the lang file. Required:

require('vue-strap/dist/vue-strap-lang.js')

or in your project include the file as in the documentation (is in 'getting started').

smartpierre commented 8 years ago

It worked !

Thanks :)