Localization of MapGuide Enterprise 2011 and a fix for Search command in Ajax viewer
2010-07-16 17:15
519 查看
There are so many languages in the world, but MapGuide Enterprise is provided in only a few languages. I think many developers are trying to localize it to make it more user friendly.
Here are the basic steps to localize MapGuide Enterprise:
1. Prepare the resource file, which locates at C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\localized by default. 2. Copy the file en to a new one named as zh for Chinese, fr for France, for example. Put it into the same directory. Please be note that this is NO extension for this file. 3. Open the copied resource file and translate the message into local language. 4. Save the file, please save it using Unicode if needed, especially for east Asian language. 5. Pass the locale parameter to the Ajax viewer. <code_begin> <frameset rows="0,*" border="0" framespacing="0"> <frame /> <frame src="/mapguide2011/mapviewernet/ajaxviewer.aspx?SESSION=<%= sessionId %>&WEBLAYOUT=<%= webLayout %>&Locale=zh" name="ViewerFrame" /> </frameset> <code_end> 6. Just change the tooltip and command name in MapGuide Studio
to localize the build-in command.
After that, you will notice that almost all items are localized. Sit back and have some drink! :)
But wait, it seems that the Search command is still using the English version. The “SEARCHTITILE” is not localized, always use the en version. What’s going on?!
Actually, it is a defect of MapGuide Enterprise 2011 Ajax Viewer. after some investigations, I finally found the bug out and fixed it! Here you go: Problem Analysis: searchprompt.aspx should pass the “LOCALE” parameter to search.aspx, but this parameter is missed . How to fix? . Fortunately, the source code is provided, you can fix it yourself: Pass the “LOCALE” parameter to search.aspx in searchprompt.aspx C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\viewerfiles\searchprompt.templ, Line 101 <input type="hidden" name="SESSION" value="%s"> <input type="hidden" name="LOCALE" value="%s"> <!—Add this line here--> <input type="hidden" name="FILTER" value="%s"> C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\mapviewernet\searchprompt.aspx Line 52 String[] vals = { target.ToString(NumberFormatInfo.InvariantInfo), popup.ToString(NumberFormatInfo.InvariantInfo), cmdIndex.ToString(NumberFormatInfo.InvariantInfo), clientWidth.ToString(NumberFormatInfo.InvariantInfo), GetSurroundVirtualPath(Request) + "search.aspx", cmdIndex.ToString(NumberFormatInfo.InvariantInfo), target.ToString(NumberFormatInfo.InvariantInfo), popup.ToString(NumberFormatInfo.InvariantInfo), EscapeForHtml(layerId), mapName, sessionId, locale, //Add this line here EscapeForHtml(filter), matchLimit.ToString(NumberFormatInfo.InvariantInfo) }; File Affected: C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\viewerfiles\searchprompt.templ, C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\mapviewernet\searchprompt.aspx Here is the test result, I localized the UI to Croatian :) Problem solved.
Cheers, Daniel Du DevTech, ADN
Here are the basic steps to localize MapGuide Enterprise:
1. Prepare the resource file, which locates at C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\localized by default. 2. Copy the file en to a new one named as zh for Chinese, fr for France, for example. Put it into the same directory. Please be note that this is NO extension for this file. 3. Open the copied resource file and translate the message into local language. 4. Save the file, please save it using Unicode if needed, especially for east Asian language. 5. Pass the locale parameter to the Ajax viewer. <code_begin> <frameset rows="0,*" border="0" framespacing="0"> <frame /> <frame src="/mapguide2011/mapviewernet/ajaxviewer.aspx?SESSION=<%= sessionId %>&WEBLAYOUT=<%= webLayout %>&Locale=zh" name="ViewerFrame" /> </frameset> <code_end> 6. Just change the tooltip and command name in MapGuide Studio
to localize the build-in command.
After that, you will notice that almost all items are localized. Sit back and have some drink! :)
But wait, it seems that the Search command is still using the English version. The “SEARCHTITILE” is not localized, always use the en version. What’s going on?!
Actually, it is a defect of MapGuide Enterprise 2011 Ajax Viewer. after some investigations, I finally found the bug out and fixed it! Here you go: Problem Analysis: searchprompt.aspx should pass the “LOCALE” parameter to search.aspx, but this parameter is missed . How to fix? . Fortunately, the source code is provided, you can fix it yourself: Pass the “LOCALE” parameter to search.aspx in searchprompt.aspx C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\viewerfiles\searchprompt.templ, Line 101 <input type="hidden" name="SESSION" value="%s"> <input type="hidden" name="LOCALE" value="%s"> <!—Add this line here--> <input type="hidden" name="FILTER" value="%s"> C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\mapviewernet\searchprompt.aspx Line 52 String[] vals = { target.ToString(NumberFormatInfo.InvariantInfo), popup.ToString(NumberFormatInfo.InvariantInfo), cmdIndex.ToString(NumberFormatInfo.InvariantInfo), clientWidth.ToString(NumberFormatInfo.InvariantInfo), GetSurroundVirtualPath(Request) + "search.aspx", cmdIndex.ToString(NumberFormatInfo.InvariantInfo), target.ToString(NumberFormatInfo.InvariantInfo), popup.ToString(NumberFormatInfo.InvariantInfo), EscapeForHtml(layerId), mapName, sessionId, locale, //Add this line here EscapeForHtml(filter), matchLimit.ToString(NumberFormatInfo.InvariantInfo) }; File Affected: C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\viewerfiles\searchprompt.templ, C:\Program Files\Autodesk\MapGuideEnterprise2011\WebServerExtensions\www\mapviewernet\searchprompt.aspx Here is the test result, I localized the UI to Croatian :) Problem solved.
Cheers, Daniel Du DevTech, ADN
相关文章推荐
- To Implement ZoomToSelection in Fusion Viewer MapGuide Enterprise 2011
- Digitize using Fusion Viewer API in MapGuide Enterprise 2011
- Intelligent landing page for AIMS/MapGuide Ajax viewer
- Autodesk MapGuide Enterprise 2011 Update 2 for Windows Released!
- 如何安装配置Intelligent landing page for AIMS/MapGuide Ajax viewer
- 5月28号Autodesk MapGuide Enterprise 2011 API 新功能培训录像资料下载
- MapGuide Enterprise 2011 授权错误的解决办法
- Autodesk MapGuide Enterprise 2011 has been released, 已经正式发布
- Moving to Autodesk MapGuide Enterprise – A guide for ESRI ArcIMS users
- MapGuide Tips----如何限制MapGuide Ajax Viewer的缩放范围
- 预告5月28号:Autodesk MapGuide Enterprise 2011 API 新功能培训
- 图解MapGuide Enterprise 2011的全新安装界面
- Autodesk MapGuide Enterprise 2011 Update 1 for Windows发布了
- MapGuide与Google Maps集成(Integrate Google Maps into MapGuide Enterprise Fusion viewer)
- View Controller Programming Guide for iOS---(三)---Using View Controllers in Your App
- Elasticsearch.The.Definitive.Guide学习笔记 -- 1. You know, for search
- Spark 2.0 DataFrame map操作中Unable to find encoder for type stored in a Dataset.问题的分析与解决
- Google documents show hopes for big gains in non-search revenue 谷歌2013年超过35%的收益将来自非搜索业务
- Linux profilers: oprofile vs. ftrace (with guide for use in Android)
- RunningMapReduceExampleTFIDF - hadoop-clusternet - This document describes how to run the TF-IDF MapReduce example against ascii books. - This project is for those who wants to experiment hadoop as a skunkworks in a small cluster (1-10 nodes) - Google Pro