Editing Text and Translating Cadcorp SIS WebMap
All text on your WebMap site is handled by .resx files located in the App_GlobalResources and App_LocalResources folders.
Note: For more information on .resx files see http://msdn.microsoft.com/en-us/library/ekyft91f%28v=vs.90%29.aspx.
The sections included in each folder are:
App_GlobalResources
- Cadcorp.Security.Resources.resx
- Cadcorp.Web.Resources.resx
- Cadcorp.Web.Resources.fr-FR.resx (Example of a Cadcorp.Web.UI.resx that has been translated into French)
- Cadcorp.Web.Templates.resx
App_LocalResources
- accessdenied.aspx.resx
- CookiePolicy.aspx.resx
- GenericError.aspx.resx
- help.aspx.resx
- NotFound.aspx.resx
WebMap can be easily localized and adapted across language and cultural scenarios.
Simply edit the Cadcorp.Web.Templates.resx file (located in the App_GlobalResources folder) with the appropriate culture code. Eg Cadcorp.Web.Templates.sa-IN for Sanskrit
A full list of Culture codes is available on the Programmer Reference section of Microsoft..
Templates
SIS WebMap’s Local Knowledge templates support regional localization.
This is done via regular expression tags instead of plain text. The opening and closing tags for the regular expression are: to open <% and, to close %>. Any regular HTML editor can be used.
Note: Formatting applied to the tags will be applied to the string it represents.
Resources File
The strings that are associated with each tag are placed in a .resx file. This is a tightly formatted XML document and best viewed / edited in a resx viewer or Feature rich text editor such as Notepad++.
The resx file contains the tags used in templates alongside the strings they will represent. The same tag can be used multiple times. The name of the resx file is modified to reflect the language it contains, when the site is accessed, a localised version will be opened.
Producing a localizable template
- Option 1
- Open the .resx file in Notepad++
- Copy and paste the final entry at lines 120 – 122
- Modify the name to reflect the tag you will use (without <%%>)
- Change value to contain text you want to be displayed.
- Repeat for each tag.
- Option 2
- Open the .resx in Windows Visual Studio Express (or any alternative)
- Add the entries in the resx editor.
- Open the template editor in the admin interface.
- If strings are split by JavaScript arrays - {Items[0].Attributes[CalcItem]} or HTML, use individual tags.
For eg: our bin collections are on {array} and {array}. ‘Your bin collections are on’ would require a tag, ‘and’ would require a tag. The template would look something like <%bin_template_tag%>{array}<%and_tag%>{array}. This would display as your ‘bin collections are on Tuesday and Friday’.
- If the same string is used repeatedly, for example ‘metres away’, the same tag can be used for each occurrence.
- Resx tags can also be used to localise Notice Titles in Notice Board.
To render Cadcorp SIS WebMap into another language, just translate the .resx files and replace them in the locations mentioned above.
Note: For Cadcorp SIS WebMap to read the correct .resx file the names must match EXACTLY those outlined at the top of this help section (excluding the French example file, Cadcorp.Web.UI.fr-FR.resx, this will not be read by your Cadcorp SIS WebMap site)