wicket select2 version 2.2.2 change local language

1,098 views
Skip to first unread message

gharae...@gmail.com

unread,
Dec 2, 2013, 7:07:32 AM12/2/13
to sel...@googlegroups.com
Hello,

I know there is local .js file for Persian(Farsi - fa) language in select2 version 3.4.5 , but there is none in wicket select2. How can I possibly add Persian as my local language?
You mentioned it in select2 Github readme file it's enough to include the locale js. May I ask how?


--
Regards,
Fatemeh

Igor Vaynberg

unread,
Dec 2, 2013, 11:19:34 AM12/2/13
to sel...@googlegroups.com
all you have to do is add the required javascript language file after
select2.js. you can copy the file into a package and make a wicket
resource reference to it, then add it on pages where you use select2
or make a subclass of select2 that adds it for you.

-igor
> --
> You received this message because you are subscribed to the Google Groups "select2" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
> To post to this group, send email to sel...@googlegroups.com.
> Visit this group at http://groups.google.com/group/select2.
> For more options, visit https://groups.google.com/groups/opt_out.

gharae...@gmail.com

unread,
Dec 2, 2013, 8:38:01 PM12/2/13
to sel...@googlegroups.com
Actually, I never see any code about using select2.js. the only usage is instance of select2multichoice. where should I add it then?

Igor Vaynberg

unread,
Dec 3, 2013, 11:43:53 AM12/3/13
to sel...@googlegroups.com
subclass select2multichoice and in its renderhead() add the reference.

-igor

gharae...@gmail.com

unread,
Dec 4, 2013, 2:16:57 AM12/4/13
to sel...@googlegroups.com
Thanks for you answer,
but I override the renderHead() function like this:
@Override
public void renderHead(IHeaderResponse response){
super.renderHead(response);
response.render(JavaScriptReferenceHeaderItem.forReference(new JavaScriptResourceReference(CssResourceRef.class, "js/select2_locale_fa.js")));
}
and it didn't work!
I'm so confused. What did I do wrong?

Igor Vaynberg

unread,
Dec 4, 2013, 10:57:44 AM12/4/13
to sel...@googlegroups.com
make sure the generated url for that reference is valid. eg view
source, click on it, see if you get your js file back.

-igor

heleni...@gmail.com

unread,
Mar 12, 2014, 8:00:01 AM3/12/14
to sel...@googlegroups.com
It seems to use getString() from Wicket to get the translations. So that is why I think the JS files don't work.
Reply all
Reply to author
Forward
0 new messages