Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PROBLEM CKEditor language
#1
It should be simple because nobody asks it here (at least if I search the forum well) so it is a bit embarrassing. But I need to ask because I am helpless already.
The thing is I am not able to switch the WYSIWYG editor to my selected language (Czech namely). I naturally followed the instruction from the wiki (Editor - Language): found the file "cs.js", copied it to the directory /admin/template/js/ckeditor/lang/, changed the language code to "cs" in the file gsconfig.php; despite that my editor is still in English.
There are already ten language files in the directory /admin/template/js/ckeditor/lang/ after installation of the CMS (German, Italian, Russian and other). To switch the editor to any of these ten languages is no problem for me but if I add any other language file in the same directory I am unable to switch to it. I even took the German localization file that works for me, translated all German strings to the Czech ones, adapted the file's beginning (to "CKEDITOR.lang['cs']), renamed the file to "cs.js" and still am not able switch to the Czech language.
Reply
#2
you have to use ckeditor 4 languages
where did you get this language file from ?

maybe ckeditor is not loading external language files, since it was bundles with those which would me incredibly dumb.
I can look into it.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
(2016-12-29, 08:36:08)shawn_a Wrote: you have to use ckeditor 4 languages

I don't undestand.

Quote:where did you get this language file from ?


In accord with wiki I downloaded the latest CKEditor and extracted the cs.js file from it. As I saw it has the same structure as the ten language files included in the CMS after installation so no problem should have arosen in my opinion. Then I even translated the working German file (probably uselessly because thus I obtained the same file as that downloaded with the official CKEditor) and renamed it as I have written above and still nothing works.
Reply
#4
There seems to be a bug in CKEDITOR that hardcodes only the languages included in the bundler.

It adds this to the end of the ckeditor.js source, which overrides the previous one that defines them all.
CKEDITOR.lang.languages={"de":1,"en":1,"es":1,"fr":1,"it":1,"nl":1,"pl":1,"pt":1,"ru":1,"sv":1};}());

so even adding a lang won't work.

also even if you override this with a
CKEDITOR.lang.languages['cs'] = 1;

It still wont work because it will throw errors on the missing languages in some of the plugins.

you will have to goto ckeditor builder
click upload build config
then add your languages to the config we use, then download optimized version and extract over the ckeditor folder in GS

this way you get ALL the cs.js in all folders
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
Lightbulb 
Thank you, this works. [Image: lightbulb.gif]
Reply
#6
yeah i did not realize how hard it was to add languages, it is fairly imposible, so i will probably start bundling more or offer a full language version patch to make it easer. I just didn't want to inflate GS by 1mb for them all.

Ideally the way i posted above is supposed to work ( add to lang.languages object ), but when i did that it throws fatal js errors. So there must be a ck bug in a plugin that is not happy when it doesn't not find a lang for itself.

Here is that error if anyone wants to follow through with ckeditor bugs
this is for cs, some others threw different errors

note i did not check latest version of ckeditor 4.6.1 we are on 4.5.9

Code:
Uncaught TypeError: Cannot read property 'options' of undefined
    at new $ (ckeditor.js?t=3.3.13:718)
    at Object.beforeInit (ckeditor.js?t=3.3.13:720)
    at Object.<anonymous> (ckeditor.js?t=3.3.13:249)
    at f (ckeditor.js?t=3.3.13:229)
    at Array.y (ckeditor.js?t=3.3.13:229)
    at A (ckeditor.js?t=3.3.13:229)
    at ckeditor.js?t=3.3.13:230
$ @ ckeditor.js?t=3.3.13:718
beforeInit @ ckeditor.js?t=3.3.13:720
(anonymous) @ ckeditor.js?t=3.3.13:249
f @ ckeditor.js?t=3.3.13:229
y @ ckeditor.js?t=3.3.13:229
A @ ckeditor.js?t=3.3.13:229
(anonymous) @ ckeditor.js?t=3.3.13:230
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
looks the same in 4.6.1
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#8
(2016-12-30, 19:15:24)lotova Wrote: Thank you, this works. [Image: lightbulb.gif]

Well, my joy was probably premature.
I downloaded the customized (builded) CKEditor from its official site, in the version 4.6.1 by the way, and replaced the folder ckeditor in the GS by it. The editor was then translated as I wanted (hence my joy in the first moment) but acted strangely what I discovered later. For example, I have this piece of code in one my page:
Code:
<script>
function odkryt(id) {
       document.getElementById(id).style.display="block";
           }
</script>
<p class="kontakty"><a onclick="odkryt('vyskakkontakt')" id="emailklik" aria-haspopup="true">some e-mail</a><span> (kliknutím zobrazíte kontaktní formulář)</span></p>

But when I wanted to modify the source code in the respective page the editor displayed only this from all the piece of code above:
Code:
<p>some e-mail (kliknutím zobrazíte kontaktní formulář)</p>

I noticed this only after I had changed something in the page and some things disappeard from it when it displayed because the editor really saved, not only displayed the code mutilated this way (it striped the HTML (and Javascript) code also in my other pages which I tried to modify in the CKEditor). Maybe the version 4.6.1. gets along not with the present GS.

So the modified CKEditor is unusable for me and I unfortunately had to revert to the editor that is a part of the GetSimple (version 3.5.9.) although I cannot change its language. The translated editor was intended for a person not knowing English but it will have to be satisfied with it as it is.
Reply
#9
You have to use our build did you upload the build config we provide in the ckeditor folder?
did you overwrite our config.js? You probably did.
Otherwise there should be no difference.

Make sure you use our build config to get the same plugins and then add your custom atuff and do not overwrote config.js
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#10
(2016-12-31, 07:45:55)shawn_a Wrote: did you overwrite our config.js? You probably did.

Yes, I did.
But still no progress: the rebuilded CKEditor + config.js from the original GS installation = the editor disappears at all.
Reply
#11
Did you remove the getsimple theme somehow?
Check js console
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#12
(2017-01-01, 05:33:28)shawn_a Wrote: Did you remove the getsimple theme somehow?
Check js console

Finally, I have the CKEditor translated and well working.
Checking javascript console was a good idea.
But the overall process was really complicated so I summarize it step by step for others who may have the same problem:
1) go to the CKEditor builder (http://ckeditor.com/builder), there: upload the build-config.js file from your GetSimple installation (/admin/template/js/ckeditor/) through the same-labeled button, choose Full preset above it, let the available skin be preselected, add your preferred language to the left column (Your editor’s language) at the bottom of the page and then download;
2) extract the downloaded archive elsewhere in your harddisk, you obtain the folder "ckeditor";
3) back up the file /admin/template/js/ckeditor/config.js and the folder /admin/template/js/ckeditor/skins/getsimple, then completely remove the folder ckeditor from your GetSimple installation (but back up it);
4) copy your downloaded folder "ckeditor" to the place of the same recently removed folder in your GetSimple installation;
5) replace the file /admin/template/js/ckeditor/config.js with the same backed up file, remove the skin from the folder /admin/template/js/ckeditor/skins and copy the backed up folder "getsimple" in it;
6) if the CKEditor is missing in your editation pages now, check the browser console (e.g. Ctrl-Shift-K in Firefox, F12 in Chrome) and copy potentially missings folders to the folder /admin/template/js/ckeditor/plugins from your GetSimple installation (you need your backup now);

and that's all (at last).
Reply
#13
Its quite simple.

download ckeditor customize option, upload our build config ( this select everything for you, do not change it unless you want to add some plugins or languages )

The easiest way to copy is to just extract all contents, deselect config.js when extracting or delete from archive then copy or extract rigt on top of gs version. No backing up and moving stuff

And there might be some cache issues if there is a version change etc.

I would add your guide to the wiki if you can, but remove the select FULL part that is confusing.

Either way I just open the archive and remove config.js, much easier.

Also note that i have added some plugins externally ( not included in the build config ) for testing, so if you happen to remove the gs ckeditor folder instead of overwrite you might lose these.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 2 Guest(s)