Showing posts with label back-end. Show all posts
Showing posts with label back-end. Show all posts

Saturday, August 7, 2010

Translating Sitecore items using Google Translate

One of the strongest techniques which can be used to increase sales and get more potential customers of the people from other regions is a multilingual website. Multi-language management is a cornerstone of Sitecore CMS, integrated into all aspects of content and site management. It allows you to build a multi-language website with almost the same effort as a single-language. See this amazing case-study about building website in 28 languages.

But what if you want to translate an existing site with a thousands of pages, hundreds of templates and website sections? How to identify possible architecture(like "Shared" fields that actually should be translated) problems, or implementation bugs (hard-coded texts, displaying item name instead of a title and so on). Sure, you can ask content-editors to spend few weeks in order to translate the site, test it, etc. But how about instant website translation using some online service? Translation quality is not as important when you simply need to identify possible problems after translation, so... let's start!

In this example, I'll use Google Translate as a translation provider. I also tried Bing Translator service, it's almost identical, but does not provide easy API like google-api-for-dotnet.

Monday, July 5, 2010

Integrating SyntaxHighlighter with Sitecore's Rich Text Editor

Some time ago I've noticed that Rich Text Editor is missing "Format Code" button in it's profiles. After initial investigation, I've found that such functionality actually exists, but it's hidden for some reason. To enable it, you should  add a new button to the profile (for example, here: /sitecore/system/Settings/Html Editor Profiles/Rich Text Full/Toolbar 1) and set it's "Click" field value to "FormatCodeBlock":


If you did everything correctly, you'll get the following button in your Text Editor toolbar:



and default RadEditor's code formatting dialog


The dialog itself looks good but html it's producing is too ugly to be used at modern websites, few lines of code result in 50+ lines of markup like:

div style="BORDER-BOTTOM: #7f9db9 1px solid; BORDER-LEFT: #7f9db9 1px solid; LINE-HEIGHT: 100% !important; BACKGROUND-COLOR: white; WIDTH: 100%; FONT-FAMILY: Courier New; HEIGHT: 132px; FONT-SIZE: 11px; OVERFLOW: auto; BORDER-TOP: #7f9db9 1px solid; BORDER-RIGHT: #7f9db9 1px solid">


So, I've decided to replace it by very popular Syntax Highlighter  module. It has a lot of features, very customizable and looks really nice 

keeping the initial markup clear.