Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWSummernote language
#1
I am pleasantly surprised with the Summernote component. The missing documentation was overcome, but I can't manage to change the language of the component, such as the question "To what URL should this link go?". How can I change the texts of the component ?
Reply
#2
Really ? Is there no one out there who can help me with this problem? I do not need to have it completely worked out for me, but just a hint to help me find the right direction...
Reply
#3
Hi Gerrit,

I did test it but never posted my results. TIWSummernote initializes the summernote control but does not give you ways to influence this initialization phase other than setting the TIWSummernote properties. Language is not one of them. I have not found a way to change the summernote settings like language after the init phase. So only way is to change the TIWSummernote init code. I don't know if you have access to the Intraweb sources but you could change the TIWSummernote.RenderHTML() method and include 'lang: "nl-NL",'. You also have to make sure the script file 'summernote-nl-NL.js' is loaded.
Reply
#4
Hi Jeroen,

Thanks for your answer. I will try to solve my problem with your directions. If I succeed, I will report my solution here.
Reply
#5
Not having access to the Intraweb sources, I tried to use Javacsript in the $(document).ready() event of my template. Been puzzling for hours, but nothing changed the language of the hints of the Summernote component. I hope a future release of Intraweb will have a language setting Wink

Finally I managed to create a workaround.

Step 1
  • In the object inspector the Summernote component: RenderCDNfiles = true
  • I make sure the files are downloaded in the IWAppFormCreate of the form : Summernote.DownloadContentFiles;
  • After starting a session and creating the form I have two files in the wwwroot directory :
    summernote-lite.min.js  and  summernote-lite.min.css

Step 2
  • I create a directory in wwwroot : js, where I move the summernote-lite.min.js file
  • From https://cdnjs.com/libraries/summernote I download the language file I need. In my case :
    https://cdnjs.cloudflare.com/ajax/libs/s...-NL.min.js
  • With Notepad (eg) I open both .js files and copy the content of the language file to the summernote-lite.min.js file (take care to start and end at identical positions, like the start of the language indicator "en-US" and the end of the "Select" section.
  • Save the modified summernote-lite.min.js file

Step 3
  • IWAppFormCreate is then modified
  • Remove the line Summernote.DownloadContentFiles;
  • Add the lines :
  • Summernote.LocalJavaScriptFolder:='./js/';
  • Summernote.RenderLocalFiles:=true;

Recompile and run...
Reply
#6
Thanks for sharing your solution.

We are introducing the "Lang" property as an easy way to customize SN language on the next IW release.

It has been already implemented and committed to our code base.
Reply
#7
That would be great ! Unfortunately I am currently stuck with Intraweb 15.2.69, because CGDevtools appears to be deceased (no replies to the forum and on emails) and does not (or very slowly) release new versions. That was one of the reasons to switch to the IWSummernote component as an alternative HTML editor.
Reply
#8
If you are using CG in your projects, and don't intend to replace it, I suggest that you put some thought into purchasing their source code. You will be free from this problem, which can become potentially serious.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)