I found net.fckeditor.localization.LocaleResolver class in SVN trunk. But I can not find any examples of using this class. Do you how to use it? Thanks.
Yes I know, because I wrote it Do you really want to use bleeding edge technology?
If so, read the JavaDoc of the class and take a look at the present implementations. A HTML documentation is underway and can generated with "mvn site". Checkout i18n.html.
But I found only ConnectorServlet is using LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(request);
If I only use FCK tag(I will not use ConnectorServlet) as the following , Can I still use LocaleResolver interface? <FCK:editor height="580" instanceName="content" value=""> </FCK:editor>
Can I set Locale in FCKeditor.java? I want to client FCKeditor UI depends on LocaleResolver interface.
Obviously you missed to read the vital parts of the editor doc about language detection. You don't need the LocaleResolver to supply the correct language for the editor.
But I still have two questions: 1: If I pass a Locale object and use ${yourBean.locale.language} , how can I handle zh-cn? When I pass a String with country code, I can handle that situation. 2: If you have provided a LocaleResolver interface, maybe the best way is that JSP tag can use that interface to set javascript locale variable automatically, then we do not need to set DefaultLanguage.
But I still have two questions: 1: If I pass a Locale object and use ${yourBean.locale.language} , how can I handle zh-cn? When I pass a String with country code, I can handle that situation.
Simply pass ${yourBean.locale} only, I call .toString() internally in the tag. From them it's the editor's responsibility.
EDIT: Just took a into the editor js code: fcklanguagemanager.js, the code is quite suboptimal. I does neither handle locale with underscore, not a decent (Java) notation like de_DE, only de-de which will fail. I'd have to patch the code.
tomcatacec wrote: 2: If you have provided a LocaleResolver interface, maybe the best way is that JSP tag can use that interface to set javascript locale variable automatically, then we do not need to set DefaultLanguage.
I have already thought about that. It'd be a editor tag attribute with boolean value. I didn't come up with a decent attibute name. AutoDetectLanguage ist nor possible because it's already reserved by the FCKConfig object.
Re: LocaleResolver interface
Yes I know, because I wrote it Do you really want to use bleeding edge technology?
If so, read the JavaDoc of the class and take a look at the present implementations. A HTML documentation is underway and can generated with "mvn site". Checkout i18n.html.
Re: LocaleResolver interface
But I found only ConnectorServlet is using
LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(request);
If I only use FCK tag(I will not use ConnectorServlet) as the following , Can I still use LocaleResolver interface?
<FCK:editor height="580" instanceName="content" value="">
</FCK:editor>
Can I set Locale in FCKeditor.java? I want to client FCKeditor UI depends on LocaleResolver interface.
Re: LocaleResolver interface
Simply do:
See sample03.jsp for more details!
Re: LocaleResolver interface
I try to pass a java Locale object, but it does not work. Then I have to pass a string, such as: "de", "zh-cn"
The following logic works fine:
String localeString = locale.getLanguage().toLowerCase() + "-" + locale.getCountry().toLowerCase();
Re: LocaleResolver interface
Re: LocaleResolver interface
But I still have two questions:
1: If I pass a Locale object and use ${yourBean.locale.language} , how can I handle zh-cn?
When I pass a String with country code, I can handle that situation.
2: If you have provided a LocaleResolver interface, maybe the best way is that JSP tag can use that interface to set javascript locale variable automatically, then we do not need to set DefaultLanguage.
Regards.
Re: LocaleResolver interface
Simply pass ${yourBean.locale} only, I call .toString() internally in the tag. From them it's the editor's responsibility.
EDIT: Just took a into the editor js code: fcklanguagemanager.js, the code is quite suboptimal. I does neither handle locale with underscore, not a decent (Java) notation like de_DE, only de-de which will fail. I'd have to patch the code.
I have already thought about that. It'd be a editor tag attribute with boolean value. I didn't come up with a decent attibute name. AutoDetectLanguage ist nor possible because it's already reserved by the FCKConfig object.
Any ideas?
Re: LocaleResolver interface
Maybe you can use this name:
AutoLocaleResolve
BTW, English is not my first language.
Re: LocaleResolver interface