CKEditor UI language

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
4/6/2011 4:39:15 PM
Gravatar
Total Posts 30

CKEditor UI language

Hi again

I noticed that the CKEditor shows up in German on my site for all users. web.config contains

<globalization culture="de-CH" uiCulture="en-US" requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="iso-8859-15" />

on my site, so I expected all UI elements to show up in english. I then added the following lines to ~\ClientScripts\ckeditor-mojoconfig.js:

config.autoLanguage=false;
config.language='en';
config.defaultLanguage='en';

Also without success. It was only then that I noticed the lang="DE" attribute in the CKEdit tag. To make a long story short: MojoPortal uses the globalization-culture instead of uiCulture to determine the language of CKEditor. I believe it should use uiCulture.

Cheers,
Simon

4/7/2011 9:55:51 AM
Gravatar
Total Posts 18439

Re: CKEditor UI language

Yes, your web.config forces the thread to always execute as German. This is not advisable, you should keep that globalization section as it was which was configured for auto detection of the browser  language with fallback to English for missing keys.

Read the Localization Document carefully to understand it.

You should not configure another language as the default because it will have missing keys and that will result in null reference exceptions when those keys are encountered. Only the English resource files are complete so that should always be the default.

You can force your site to use German in general with

<add key="UseCultureOverride" value="true" />
  <add key="site1culture" value="de" />

but this will also result in all users having German used for labels and resources and editors. However for missing keys it will still fall back to English and not throw exceptions.

So supported scenarios are

1. Using Autodetection with fallback to English (the default) and then users will see the editors in their own languages

2. Forcing a specific culture as shown above but not using fallback so all users see labels and editors etc in in the specified language.

It would be theoretically possible to configure auto detection with fallback to German like this:

<globalization culture="auto:de-DE" uiCulture="auto:de-DE" requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="iso-8859-15" />

but in practice this will likely result in some null reference exceptions because the German resources have missing keys.

If you don't have the "auto" part it will never go by the browser language preference and if forced to a specific culture as shown with the site1culture setting above it will not either.

We don't have any resource files for de-CH, so it will use the Resource.de.resx files

Hope it helps,

Joe

4/8/2011 4:26:01 AM
Gravatar
Total Posts 30

Re: CKEditor UI language

Thanks for the extensive reply. However it doesn't solve my problem. What I want is to have the site in English except for date/time formats which should be Swiss German. I would expect MojoPortal to load String resources from the specified uiCulture? At least that's the behaviour I saw. Except for the editor: It uses culture and not uiCulture.

Unfortunately the documentation of the localization doesn't cover uiCulture.

4/8/2011 7:39:09 AM
Gravatar
Total Posts 18439

Re: CKEditor UI language

 

Hi Simon,

In the source code repository I've changed it to use UICulture for the editor localization, and I've made it possible to configure Culture and UICulture separately from config settings like this:

<add key="UseCultureOverride" value="true" />
  <add key="site1culture" value="de-CH" />
  <add key="site1uiculture" value="en-US" />

So these changes will be in the next release.

Best,

Joe

4/8/2011 8:07:19 AM
Gravatar
Total Posts 30

Re: CKEditor UI language

Excellent! Thanks a *lot*!

You must sign in to post in the forums. This thread is closed to new posts.