<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : GUI translation</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : GUI translation]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 12 May 2026 20:06:52 +0000</pubDate>
  <lastBuildDate>Mon, 15 Jan 2018 01:26:09 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=23541</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[GUI translation : Hello,During working on localization...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23541&amp;PID=76475&amp;title=gui-translation#76475</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8730">olebed</a><br /><strong>Subject:</strong> 23541<br /><strong>Posted:</strong> 15 January 2018 at 1:26am<br /><br /><div>Hello,</div><div><br></div><div>During working on localization issues in Codejock library I fonund that to apply translation for Ribbon Backstage Page we need create it with calling <b>CreateIndirect</b>(). With RibbonSample this looks like:</div><div><table width="99%"><tr><td><pre class="BBcode">CMainFrame::CreateBackstage()</div><div>{</div><div>.....</div><div>&nbsp; &nbsp; if (!m_pagePrint.GetSafeHwnd())</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; m_pagePrint.<b>CreateIndirect</b>(XTPResourceManager()-&gt;LoadDialogTemplate(CXTPRibbonBackstagePagePrint::IDD), this);</pre></td></tr></table></div><div>I have added such example in RibbonSample.</div><div>For using localized resources DLL you can use next code:<table width="99%"><tr><td><pre class="BBcode">struct {</div><div>&nbsp; &nbsp; WORD wLanguage;</div><div>&nbsp; &nbsp; LPCTSTR lpszEncoding;</div><div>&nbsp; &nbsp; LPCTSTR lpszCaption;</div><div>&nbsp; &nbsp; LPCTSTR lpszDLLName;</div><div>}</div><div>encoding&#091;&#093; =&nbsp;</div><div>{</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_ARABIC,&nbsp; &nbsp; SUBLANG_ARABIC_SAUDI_ARABIA),&nbsp; _T("windows-1256"), _T("Arabic (Saudi Arabia)"), _T("ResourceArSa")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_BULGARIAN, SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1251"), _T("Bulgarian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceBg")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_CZECH,&nbsp; &nbsp; &nbsp;SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1250"), _T("Czech"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceCs")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_DANISH,&nbsp; &nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1252"), _T("Danish"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceDa")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_GERMAN,&nbsp; &nbsp; SUBLANG_GERMAN),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("windows-1252"), _T("German (Germany)"),&nbsp; &nbsp; &nbsp; _T("ResourceDe")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_GREEK,&nbsp; &nbsp; &nbsp;SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1253"), _T("Greek"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceEl")},&nbsp; &nbsp; // 5</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_ENGLISH,&nbsp; &nbsp;SUBLANG_ENGLISH_US),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("windows-1252"), _T("English (United States)"),_T("ResourceEn")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_SPANISH,&nbsp; &nbsp;SUBLANG_SPANISH_MODERN),&nbsp; &nbsp; &nbsp; &nbsp;_T("windows-1252"), _T("Spanish (Spain - Modern Sort)"),_T("ResourceEs")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_ESTONIAN,&nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1257"), _T("Estonian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceEt")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_FINNISH,&nbsp; &nbsp;SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1252"), _T("Finnish"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceFi")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_FRENCH,&nbsp; &nbsp; SUBLANG_FRENCH),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("windows-1252"), _T("French (France)"),&nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceFr")},&nbsp; &nbsp; //10</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_HEBREW,&nbsp; &nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1255"), _T("Hebrew"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceHe")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_CROATIAN,&nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1250"), _T("Croatian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceHr")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_HUNGARIAN, SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1250"), _T("Hungarian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceHu")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_ITALIAN,&nbsp; &nbsp;SUBLANG_ITALIAN),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1252"), _T("Italian (Italy)"),&nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceIt")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_JAPANESE,&nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("shift-jis"),&nbsp; &nbsp; _T("Japanese"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceJa")},&nbsp; &nbsp; //15</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_KOREAN,&nbsp; &nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ks_c_5601"),&nbsp; &nbsp; _T("Korean"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceKo")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_LITHUANIAN,SUBLANG_LITHUANIAN),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("windows-1257"), _T("Lithuanian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceLt")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_LATVIAN,&nbsp; &nbsp;SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1257"), _T("Latvian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceLv")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_DUTCH,&nbsp; &nbsp; &nbsp;SUBLANG_DUTCH),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1252"), _T("Dutch"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceNl")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL),&nbsp; &nbsp; &nbsp;_T("windows-1252"), _T("Norwegian (Bokmal)"),&nbsp; &nbsp; _T("ResourceNo")},&nbsp; &nbsp; //20</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_POLISH,&nbsp; &nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1250"), _T("Polish"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourcePl")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_PORTUGUESE,SUBLANG_PORTUGUESE),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("windows-1252"), _T("Portuguese (Portugal)"), _T("ResourcePt")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_PORTUGUESE,SUBLANG_PORTUGUESE_BRAZILIAN), _T("windows-1252"), _T("Portuguese (Brazil)"),&nbsp; &nbsp;_T("ResourcePtBr")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_ROMANIAN,&nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1250"), _T("Romanian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceRo")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_RUSSIAN,&nbsp; &nbsp;SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1251"), _T("Russian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceRu")},&nbsp; &nbsp; //25</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_SLOVAK,&nbsp; &nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1250"), _T("Slovak"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceSk")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_SLOVENIAN, SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1250"), _T("Slovenian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceSl")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_SERBIAN,&nbsp; &nbsp;SUBLANG_SERBIAN_LATIN),&nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1250"), _T("Serbian"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceSr")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_SWEDISH,&nbsp; &nbsp;SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1252"), _T("Swedish"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceSv")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_THAI,&nbsp; &nbsp; &nbsp; SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-874"),&nbsp; _T("Thai"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceTh")},&nbsp; &nbsp; //30</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_TURKISH,&nbsp; &nbsp;SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1254"), _T("Turkish"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceTr")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_UKRAINIAN, SUBLANG_DEFAULT),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("windows-1251"), _T("Ukrainian "),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _T("ResourceUk")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_CHINESE,&nbsp; &nbsp;SUBLANG_CHINESE_SIMPLIFIED),&nbsp; &nbsp;_T("gb2312"),&nbsp; &nbsp; &nbsp; &nbsp;_T("Chinese (PRC)"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("ResourceZhCn")},</div><div>&nbsp; &nbsp; {MAKELANGID(LANG_CHINESE,&nbsp; &nbsp;SUBLANG_CHINESE_TRADITIONAL),&nbsp; _T("big5"),&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_T("Chinese (Taiwan)"),&nbsp; &nbsp; &nbsp; _T("ResourceZhTw")}</div><div>};</div><div><br></div><div>#include &lt;locale.h&gt;</div><div><br></div><div>BOOL CRibbonSampleApp::InitInstance()</div><div>{</div><div><br></div><div>//hardcoded language choosing</div><div>&nbsp; &nbsp; const int kk = 34;&nbsp; &nbsp; &nbsp;//any</div><div>&nbsp; &nbsp; //const int kk = 4;&nbsp; &nbsp; //german</div><div>&nbsp; &nbsp; //const int kk = 5;&nbsp; &nbsp; //greek</div><div>&nbsp; &nbsp; LCID Locale = encoding&#091;kk&#093;.wLanguage;</div><div>&nbsp; &nbsp; LPCTSTR szLocale = encoding&#091;kk&#093;.lpszCaption;</div><div>&nbsp; &nbsp; LPCTSTR&nbsp; &nbsp; szFileName = encoding&#091;kk&#093;.lpszDLLName;</div><div><br></div><div>// get application path&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; CString strPath;</div><div>&nbsp; &nbsp; VERIFY(::GetModuleFileName(AfxGetApp()-&gt;m_hInstance, strPath.GetBufferSetLength(_MAX_PATH), _MAX_PATH));</div><div>&nbsp; &nbsp; strPath.ReleaseBuffer();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; int nIndex&nbsp; = strPath.ReverseFind(_T('\\'));</div><div>&nbsp; &nbsp; if (nIndex &gt; 0) strPath = strPath.Left(nIndex + 1); else strPath.Empty();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; strPath = strPath + _T("Translations\\ToolkitPro.") + szFileName + _T(".dll");</div><div><br></div><div>//set resource file for strings</div><div>&nbsp; &nbsp; XTPResourceManager()-&gt;SetResourceManager(new CXTPResourceManager());</div><div>&nbsp; &nbsp; XTPResourceManager()-&gt;SetResourceFile(strPath);</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; ::SetThreadLocale(MAKELCID(Locale, SORT_DEFAULT));&nbsp;</div><div>&nbsp; &nbsp; ::_tsetlocale(LC_ALL, szLocale);&nbsp;</div><div><br></div><div>//test loading resources</div><div>&nbsp; &nbsp; //CString strTitle;</div><div>&nbsp; &nbsp; //XTPResourceManager()-&gt;LoadString(&amp;strTitle, XTP_ID_RIBBONCONTROLQUICKACCESS);</pre></td></tr></table></div><div><br></div><div>Translations are saved in folder 'res\Resource_**.rc' for some controls, for example Calendar</div><div>c:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v18.0.1\Source\Calendar\res\Resource_zh_TW.rc</div><div>These .rc files should be opened with <b>codepage </b>as specified at the begining of every file</div><div><table width="99%"><tr><td><pre class="BBcode">#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)</div><div>#ifdef _WIN32</div><div>LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US</div><div>#pragma <b>code_page</b>(1252)</div><div>#endif //_WIN32</pre></td></tr></table></div><div><br></div><div>then it can be compiled to separate DLL for every language by building project</div><div>c:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v18.2.0\Workspace\Resource\Resource.dsw</div><div><br></div><div>If you know any issues with translations please write here or on support.codejock.com</div><div><br></div><div>Regards,</div><div>&nbsp;Oleksandr Lebed</div>]]>
   </description>
   <pubDate>Mon, 15 Jan 2018 01:26:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23541&amp;PID=76475&amp;title=gui-translation#76475</guid>
  </item> 
 </channel>
</rss>