If you're deciding per user per load, you could just use a GET var in the url to hold a localization variable. Then just use the variable when you initialize the CKEditor instance using the language config value.
Of course you need to make sure that you confirm it is a valid localization code, otherwise you may have issues, such as breaking the editor when it sees a non-expected value.
Say you have a url with a variable in it like "http://localhost/ckeditor.html?lang=en". The lang=en is a GET variable, which is accessible in a variety of ways. However, in this case, we will probably use javascript to get that variable, here is a function you can use that I located on Snipplr:
function getUrlVars()
{
var map = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
map[key] = value;
});
return map;
}
Re: how to set the localized language dynamically?
If you're deciding per user per load, you could just use a GET var in the url to hold a localization variable. Then just use the variable when you initialize the CKEditor instance using the language config value.
Of course you need to make sure that you confirm it is a valid localization code, otherwise you may have issues, such as breaking the editor when it sees a non-expected value.
Re: how to set the localized language dynamically?
would you show me some code since im new the CKEditor, please?
thanks a lot
Re: how to set the localized language dynamically?
Say you have a url with a variable in it like "http://localhost/ckeditor.html?lang=en". The lang=en is a GET variable, which is accessible in a variety of ways. However, in this case, we will probably use javascript to get that variable, here is a function you can use that I located on Snipplr: