-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
i18n #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this would be an easy thing to address... might as well. In the meantime, you can always provide a |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
If anyone is wondering how to change it as @brianreavis suggested, just do something like this: $('.my-select').selectize({
create: true,
render: {
option_create: function(data, escape) {
var addString = 'Adicionar';
return '<div class="create">' + addString + ' <strong>' + escape(data.input) + '</strong>…</div>';
}
}
}); |
As someone who's native tongue is French, I'd be inclined to accept a PR making this simpler. We could add an option allowing you to spectify a string (eg. |
Handle case where setLabelSelector gets called before filter widget i…
+1 |
I'll go even further in this, the function would be called with two params,
instead of:
Default: or something automagic like that. |
|
Here's what I see: describe("I18n", function(){
describe("dictionary syntax", function(){
var s = Selectize.init({
dictionary: {
addThis: "Ajouter %{elem}"
}
})
expect(s.i18n('addThis', {elem: 'ceci'}).to.equal("Ajouter ceci")
})
describe("delegate to i18n library", function(){
var I18n = {
t: function(key, params) {
return "Ajouter " + params.elem;
}
}
var s = Selectize.init({
i18n: I18n.t
});
expect(s.i18n('addThis', {elem: 'ceci'})).to.equal("Ajouter ceci")
})
describe("default i18n library", function(){
var I18n = {
t: function(key, params) {
return "Ajouter " + params.elem;
}
}
var s = Selectize.init({
// i18n: default
});
expect(s.i18n('addThis', {elem: 'ceci'})).to.equal("Ajouter ceci")
})
}) |
Libraries i18next, I18n-js and Polyglot all use syntax |
closing stale issues older than one year. |
It's been a while I haven't touched this project, but I would imagine a PR that makes it possible to specify the language string in the options would be a great start. – Oops, actually that's what #902 proposed and I closed the PR in favor of this one. (harsh.) Funny how I don't agree with my past self anymore, I think something along the lines of #902 is a good idea, maybe a bit more fleshed out. But again, I'm not the one who puts much work in this project anymore so that's only my own personal opinion! |
always welcome a PR, my time is stretched these days too, and I fully admit that my i18n skills are underdeveloped. I agree that #902 at least feels more simple to implement, but I would need to do some research before jumping in myself |
Huh? |
Suport for multiple languages.
Text to create new item is hardcoded english.
The text was updated successfully, but these errors were encountered: