Enable Spellcheck for other languages then EN
Is there an easy way to enable spellcheck DE in the ContentBlock RadEditor through Advanced Setting?
Markus
Hi Markus ,
There is no UI section that allows you to enable spell checker for another language. I will log a task about implementing it
You can enable it by mapping the HtmlField template
Below you can find the template of the control
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditTemplate.ascx.cs" Inherits="SitefinityWebApp.Controls.EditTemplate" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<
sf:ConditionalTemplateContainer
ID
=
"htmlEditor"
runat
=
"server"
>
<
Templates
>
<
sf:ConditionalTemplate
ID
=
"ConditionalTemplate1"
Left
=
"DisplayMode"
Operator
=
"Equal"
Right
=
"Read"
runat
=
"server"
>
<
sf:SitefinityLabel
id
=
"titleLabel_read"
runat
=
"server"
WrapperTagName
=
"div"
HideIfNoText
=
"false"
CssClass
=
"sfTxtLbl"
/>
<
sf:SitefinityLabel
id
=
"viewControl"
runat
=
"server"
WrapperTagName
=
"div"
HideIfNoText
=
"false"
CssClass
=
"sfRTFContent"
/>
</
sf:ConditionalTemplate
>
<
sf:ConditionalTemplate
ID
=
"ConditionalTemplate2"
Left
=
"DisplayMode"
Operator
=
"Equal"
Right
=
"Write"
runat
=
"server"
>
<
sf:ResourceLinks
id
=
"resourcesLinks2"
runat
=
"server"
>
<
sf:EmbeddedResourcePropertySetter
Name
=
"Telerik.Sitefinity.Resources.Themes.Default.Styles.EditorDialogs.css"
Static
=
"true"
ControlID
=
"editControl"
ControlPropertyName
=
"DialogsCssFile"
/>
<
sf:ResourceFile
Name
=
"Telerik.Sitefinity.Resources.Themes.Default.Styles.Window.css"
Static
=
"true"
/>
</
sf:ResourceLinks
>
<
asp:Label
ID
=
"titleLabel_write"
runat
=
"server"
CssClass
=
"sfTxtLbl"
AssociatedControlID
=
"editControl"
/>
<
asp:LinkButton
ID
=
"expandLink"
runat
=
"server"
OnClientClick
=
"return false;"
CssClass
=
"sfOptionalExpander"
/>
<
asp:Panel
ID
=
"expandableTarget"
runat
=
"server"
CssClass
=
"sfEditorWrp sfClearfix"
>
Howdy
<
telerik:RadEditor
ID
=
"editControl"
runat
=
"server"
Skin
=
"Sitefinity"
Width
=
"100%"
AllowScripts
=
"true"
Height
=
"370px"
EditorContentFilters
=
"IndentHTMLContent"
EditorStripFormattingOptions
=
"MSWord,Css,Font,Span,ConvertWordLists"
DisplayMode
=
"Write"
FixCursorIssue
=
"True"
EnableResize
=
"False"
EditModes
=
"Design,HTML"
DialogHandlerUrl
=
"~/Telerik.Web.UI.DialogHandler.axd"
Content
=
""
NewLineBr
=
"False"
StripFormattingOptions
=
"Css,Font,Span"
OnClientLoad
=
"Telerik$Sitefinity$Web$UI$Fields$HtmlField$radEditorToggleAdvancedToolbars"
OnClientPasteHtml
=
"OnClientPasteHtml"
OnClientCommandExecuting
=
"OnClientCommandExecuting"
>
<
FlashManager
ViewPaths
=
"~/Files"
UploadPaths
=
"~/Files"
DeletePaths
=
"~/Files"
/>
</
telerik:RadEditor
>
<
sf:SitefinityLabel
id
=
"descriptionLabel"
runat
=
"server"
WrapperTagName
=
"div"
HideIfNoText
=
"true"
CssClass
=
"sfDescription"
/>
<
sf:SitefinityLabel
id
=
"exampleLabel"
runat
=
"server"
WrapperTagName
=
"div"
HideIfNoText
=
"true"
CssClass
=
"sfExample"
/>
</
asp:Panel
>
<
style
type
=
"text/css"
>
a.link
color: #0000ff;
font-weight: normal;
font-style: italic;
.img
border: none;
.redtext
color: red;
</
style
>
<
script
type
=
"text/javascript"
>
/*
<![CDATA[ */
var className = null;
var toRemove = false;
var handlersAdded = false;
function OnClientPasteHtml(sender, args)
var newContent = args.get_value();
newContent = newContent.replace(new RegExp("<b(\\s([^>])*?)?>", "ig"), "<strong$1>");
newContent = newContent.replace(new RegExp("</b(\\s([^>])*?)?>", "ig"), "</strong$1>");
newContent = newContent.replace(new RegExp("<i(\\s([^>])*?)?>", "ig"), "<em$1>");
newContent = newContent.replace(new RegExp("</i(\\s([^>])*?)?>", "ig"), "</em$1>");
var regex = /<([a-zA-Z]+) ?[^>]*?>\s*<\/\1>/gi;
newContent = newContent.replace(regex, "");
args.set_value(newContent);
function OnClientCommandExecuting(editor, args)
var name = args.get_name();
var val = args.get_value();
var commandName = args.get_commandName();
className = "re" + commandName;
if (editor.get_dialogOpener())
if (editor.get_dialogOpener()._container && !handlersAdded)
editor.get_dialogOpener()._container.add_show(AddRemoveCSSClass);
editor.get_dialogOpener()._container.add_close(AddRemoveCSSClass);
handlersAdded = true;
if (name == "MergeTags")
editor.pasteHtml(val);
//Cancel the further execution of the command as such a command does not exist in the editor command list
args.set_cancel(true);
if (commandName == "ToggleScreenMode")
var containerWnd = GetRadWindow();
if (!editor.isFullScreen()) //if the editor is placed in fullscreen mode specify the needed content area width
$(editor.get_element()).addClass("sfFullScreenEditor");
if(containerWnd != null && !containerWnd.isMaximized())
containerWnd.maximize();
$(containerWnd.get_element()).addClass("sfWndToBeRestored");
editor.get_document().body.style.maxWidth = "640px";
else
$(editor.get_element()).removeClass("sfFullScreenEditor");
if(containerWnd != null && $(containerWnd.get_element()).hasClass("sfWndToBeRestored"))
$(containerWnd.get_element()).removeClass("sfWndToBeRestored");
containerWnd.restore();
editor.get_document().body.style.maxWidth = "100%";
function AddRemoveCSSClass(sender, args)
var popupElement = sender.get_popupElement();
if (!toRemove)
Sys.UI.DomElement.addCssClass(popupElement, className);
else
Sys.UI.DomElement.removeCssClass(popupElement, className);
function GetRadWindow()
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
/* ]]>
*/
</
script
>
</
sf:ConditionalTemplate
>
</
Templates
>
</
sf:ConditionalTemplateContainer
>
<Languages> <telerik:SpellCheckerLanguage Code="de-DE" Title="Title" /> </Languages>
Thanks Ivan
I usually don't like working with templates I want to keep SF as pure as possible. But will use it in this case.
At least make the default to include EN/DE/FR which you deliver anyhow. (Make EN default)
So like this you would not have any real change. The aditional two .tdf files are not that big to upload.
This would be a quick fix for the next build which would probably help more then one.
---------
Anything that would speek against this quick fix.
If I remember correct there was an idea by some guy to move the Heading Section to basic as well so you are touching the template anyhow :-)
Markus
However
I did set the code but only get english (the howdy showd so I knew the template was used. Would I have to add the languages at another place then radeditor?
PS: Any chance to extend this thread for toolsfile.xml (I want the heading and doc manger to be in basic, as well as apply some stylings to the heading in the dropdownlist as well as editor content)
<
telerik:RadEditor
ID
=
"editControl"
runat
=
"server"
Skin
=
"Sitefinity"
Width
=
"100%"
AllowScripts
=
"true"
Height
=
"370px"
EditorContentFilters
=
"IndentHTMLContent"
EditorStripFormattingOptions
=
"MSWord,Css,Font,Span,ConvertWordLists"
DisplayMode
=
"Write"
FixCursorIssue
=
"True"
EnableResize
=
"False"
EditModes
=
"Design,HTML"
DialogHandlerUrl
=
"~/Telerik.Web.UI.DialogHandler.axd"
Content
=
""
NewLineBr
=
"False"
StripFormattingOptions
=
"Css,Font,Span"
OnClientLoad
=
"Telerik$Sitefinity$Web$UI$Fields$HtmlField$radEditorToggleAdvancedToolbars"
OnClientPasteHtml
=
"OnClientPasteHtml"
OnClientCommandExecuting
=
"OnClientCommandExecuting"
>
<
FlashManager
ViewPaths
=
"~/Files"
UploadPaths
=
"~/Files"
DeletePaths
=
"~/Files"
/>
<
Languages
>
<
telerik:SpellCheckerLanguage
Code
=
"de-DE"
Title
=
"Deutsch"
/>
<
telerik:SpellCheckerLanguage
Code
=
"en-US"
Title
=
"English"
/>
</
Languages
>
</
telerik:RadEditor
>
Hi Markus Berchtold,
Can you, please, try fixing the title of the Language from Deutsch to German and see if this fixes the issue. I have just tested the functionality by adding all 3 default languages to the SpellChecker thought the code-behind of the template like this:
protected
void
Page_Load(
object
sender, EventArgs e)
editControl.PreRender +=
new
EventHandler(editControl_PreRender);
void
editControl_PreRender(
object
sender, EventArgs e)
editControl.ToolsFile =
"~/ToolsFileCustom.xml"
;
editControl.Languages.Add(
"en-US"
,
"English"
);
editControl.Languages.Add(
"fr-FR"
,
"French"
);
editControl.Languages.Add(
"de-DE"
,
"German"
);
I've attached a screenshot to the thread showing how the functionality shows up int he editor once the changes are applied.
Concerning your ToolsFile request,please note in the above code sample I'm setting my custom ToolsFile, you can simply change the path to where yours is located. I'm attaching to the thread a file containing all the tools that are available, you can simply pick the ones you want to display when using the mapped template.
For more information on setting custom CSS in the dropdown, please take a look at this article from our Editor documentation, which provides several code samples and detailed explanation on how to achieve the desired functionality. If you need any further assistance please let us know.
All the best,
Boyan Barnev
the Telerik team
[View:/cfs-file/__key/communityserver-discussions-components-files/295/275020_5F00_StandardToolsFile.rar:320:240]
Dear Boyant
Could not test it yet. 4.2 should have editor configuration possiblities. Is enabeling different spellckecks possible then too?
Markus
Hi Markus Berchtold,
Thank you for contacting us. Editor configurations are planned for Q2 and different spellcheckers will not be supported.
All the best,
Antoaneta
the Telerik team
Dear Antoaneta
Sorry I guess I was not realy clear, the question was if it would also be possible to select the languages you want to show in the editor toolbar.
Out of the box EN/FR/DE is provided by telerik and it would be nice if we could select which we want to have enabled in the toolbar of the editor.
Markus
PS: I guess it would be appreciated it Telerik delivered the .tdf files for all langues available in the backend. Since I guess once you have the backend in Spanisch it would be nice to have the ES spellcheck out of the box as well. I am for once lucky with the provide once :-)
Hello Markus Berchtold,
Thank you for this request. I have logged it in PITS where you and other customers can vote and raise its priority. The item ID is 6458
I have also updated your Telerik points.
Greetings,
Antoaneta
the Telerik team
Dear Anotaneta
Sorry PITS link gives an error. Any news on this?
Markus
Hi Markus Berchtold,
The link seems to be working properly now, can you please check again on this public URL.
All the best,
Boyan Barnev
the Telerik team