Some problems in software geographicalization (ZZ)

zhaozj2021-02-16  80

// zz from http://xiaogi.nease.net/article/translate.htm

With the continuous increase in China's economic power, the gradual deepening of the opening is, China Software industry is facing unprecedented challenges and opportunities. To grasp opportunities in this challenge, China's software must go out of the country, accept the world's inspection, while International software must introduce the national door to stimulate and motivate the development of our software industry. In this process, software geographicalization is a critical link, so it is increasingly attracting attention.

The author used to participate in a long period of time to translate a commercial software JMSS into English, have done a software geographic work, so I really want to discuss with you with this issue.

However, the software geographical range is great, and its meaning is much more than the text or string of the translation menu and dialog, it also includes bitmap, icon, and even acceleration keys that make the software in accordance with local customs. This is far beyond my ability, so I just want to talk about simple things - how to translate resources in VC software.

The language that is the most encountered in the VC program is that when we choose to create a new MFCAppWizard program, the VC will ask what we choose from. If we need to generate software that supports double-bytes, you must use the DLL that supports the far East language. These DLLs are not installed when the default is installed, and you need you to manually install it yourself. These files are specifically described below in the / bin / IDE directory of the Visualc CD:

Japanese Appwzjpn.dll Simplified Chinese AppWZCHS.DLL Taiwan Chinese AppWZCHT.DLL

If you want to support Chinese in your software, you must copy the above appwzchs.dll to the / bin / IDE directory in the directory of the Vusial C , then select Chinese AppWizard. Otherwise, even in the Chinese environment, your software cannot support Chinese.

So, what changes will I choose Chinese AppWizard? Interested friends can open the resource file (* .rc) in the text, you will find that there is such a code:

#if! defined (AFX_RESOURCE_DLL) || defined (AFX_TARG_CHS) #ifdef _WIN32LANGUAGE 4, 2 # pragma code_page (936) #endif // _ WIN32 and #if! defined (AFX_RESOURCE_DLL) || defined (AFX_TARG_CHS) #ifdef _WIN32LANGUAGE 4, 2 #ndif //_Win32 # include "res // new.rc2" // Non-Microsoft Visual C Edited Resources # include "l.chs // AfXRES.RC" // Standard Components # include "L .chs // afxprint.rc "// printing / print preview resources # Endif

The AFX_TARG_CHS and 936 define the Simplified Chinese properties of the resource file. The English attribute is AFX_TARG_ENU and 1252, and the Japanese properties are AFX_TARG_JPN and 932, and the traditional Chinese attribute is AFX_TARG_CHT and 950. The corresponding language properties must be changed during translation.

Note the following two sentences should also be changed: #include "l.chs // AfXRES.RC" // Standard Components # include "l.chs // afxprint.rc" //printing / print preview resource ": #include" AFXRES .rc "// standard Components # include" AfxPrint.rc "// Printing / Print Preview Resources Japanese is: #include" l.jpn // AfXRES.RC "// Standard Components # include" L.JPN // AfxPrint. RC "// Printing / Print Preview Resources Traditional Chinese is: #include" l.cht // Afxres.rc "// Standard Components # include" l.cht // afxprint.rc "//printing / print preview resources Some friends Download some original code from the Internet, but found that even if you translate the menu, string, etc., you can't display correctly, that is, because these language properties are not changed. In addition, there is a lot of things (p.r.c.) To save the resource file directly in the text status than a dialog.

BTW, to turn Chinese Help files into English or open the * .hpj file in text state, then change Chinese (p.r.c.) into English (u.s.).

After the language properties are changed, there will be no problem with the menu and string (of course, be careful, such as the correct translation of characters such as bipheet% or ").

What is mentioned above is a translation work in the premise of obtaining the original code of the resource file, then what if there is no original code? In fact, there is no impossible thing without the original code translation software under Windows. Of course, this is to pay attention to the high thinking of Windows designers.

Everyone knows that the VC compiles the resource file to * .res files separately, and then connect to other target files into executable files. This allows us to extract the resources in the executable through a tool. For example, the resource compiler in VC can complete this job, but must be in Windows NT, only edit in Window 9x, and cannot be saved.

Interested friends can use VC to open an EXE file, but pay attention to select Resources in the Open AS combo box in the Open dialog, not to choose Auto, after opening, you will find all resources for the executable , Including menus, dialogs, and strings, etc. However, the language attribute issuance of this translation cannot be changed in the text state, and can only be changed one by one. You can click Right-click on the corresponding resource ID, then select the properties in the context menu that is jumped, then modify the Language in the property page.

Some friends may notice that if an application places it in String Table in String Table, the software can be thoroughly translated into another language, so I can't help but sigh: No wectle Weizhenjiang often teaches us to put all the strings into string table, which is the case. :-)

From the above, a software is to benefit geographically, it is best to put all resources in * .rc, but I think, in fact, the best way is to make the resource into a DLL file (such as resource.dll ), Then load resource at the time of running: m_hrc = afxloadLibrary (_t ("resource.dll")); / * Remember to free resource library at eXiting, Such as: if (m_hrc) AFXFREELIBRARY (m_hrc); * / if (m_hrc) AFXSetResourceHandle (M_HRC); so you can use the resources contained in all resource.dll like the use of the resource that can be used. The advantage of this method is obvious. When the software is dominated, it is possible to change the resource.dll. A truly excellent software should do a long time.

The above is just some of the rough views of some of the problems in software geographical or software translation, and there must be a matter of nothing, I hope that friends will correct.

转载请注明原文地址:https://www.9cbs.com/read-12743.html

New Post(0)