. Net Program localization instance

Source: Internet
Author: User
Tags dotnet

Preface

This article is not a profound technical article, but describes the complete Chinese process of a. Net program. The main tools used in this article are: Radialix , SDL passolo 2009 , DOTNET helper , Beyond compare And editplus
And discusses the comprehensive application of the above tools.

Sample Software
Subtitle
Edit
It is an open-source free subtitle processing software. The development language is C #. Although the author provides source code download, it may be caused by the system environment. The source code package cannot be compiled successfully; in addition, it seems that the Chinese source code is not as convenient as the Chinese source code through decompilation.

Radialix
Preliminary Localization
I have to say that
Radialix is really awesome. Although its stability needs to be improved, it still provides great support to Chinese personnel. Radialix can directly read. Net program resources. Create
Subtitle edit localization solution:

You can select "extract nonstandard resources" and select "create localized file" in the target settings ".

There are not many skills for translation standard resources. It should be noted that the adjustments to Form Controls in radialix sometimes show sizes and locations not necessarily the same as those in the target file:

When this problem occurs, you can select the control and switch to the resource label for check:

What we need to do is to directly change the expected value in the translation part of the resource tag without considering the value displayed on the toolbar.

Using radialix to translate non-standard resources is the same as the translation standard string resources, but the initial status of non-standard resources is read-only and needs to be switched. You can use the right-click menu or shortcut key Ctrl + K:

Radialix also comes with Google
With Microsoft's powerful online translation engine, machine translation is sometimes extremely accurate in terms of words in software:

However, you cannot simply use machine translation for software localization. Users will certainly complain about your behavior and will not even go to other works.

After all the words are translated, You can compile the target file. The shortcut key is Ctrl + F9. If you use radialix
Other software is hand-made in hand, and it is a good luck. This step is almost over. In this example, this is only the beginning because either an error is reported when you generate the target file or the compiled file has missing functions. If you see this, you will certainly complain that you are not busy, but please be patient, because in this article
Radialix is only used as an auxiliary tool.

Next, we will export the translation dictionary from radialix and use the term file format (*. Glo) to prepare for future work:

As I have previously reviewed and verified each translation Statement (shortcut key
CTRL + q), so only the verified translations can be exported in the Wizard. The rest will be handled by other software.

DOTNET helper

Decompilation

DOTNET
Helper is a tool developed by tracky, a Chinese New Century member, to support compilation/decompilation. net. The interface is easy to operate and saves the trouble of inputting command lines. Drag and Drop the program file to be decompiled
On DOTNET helper:

In this example, compile the Subtitle edit
The Framework version is 2.0, and there are no encryption obfuscation issues, so you don't need to set it up. Click the decompilation button directly. Many files are generated, but we mainly process the file extension. il.
.
In addition, if you are using a system earlier than XP, you should confirm that the system has installed. NET Framework 2.0.
The above version. Otherwise, go to the official website to download and install it: Http://www.microsoft.com/downloads/details.aspx? Familyid = ZH-CN

Passolo

Process. Il
File

Passolo
With a powerful resource parser, You can process files in various special formats. In order for passolo to correctly extract strings from the. Il file, we need to set the strings. Start in blank workspace Mode
Passolo: click "" in the tool menu to select ins. The Ins dialog box is displayed, for example:

In the parser tab, select load text file parser and click set on the right side to bring up the rule definition dialog box of the text Parser:

Century provides. Net Il
File Parsing rules, but cannot parse the two-line string, we can solve it with a slight modification. Click here Download the rule file for import.

After setting, we can create a new scheme in passolo to formally process the previously decompiled. Il file. When adding the source file, if passolo
If the. Net il parsing rule cannot be called correctly, you need to manually specify:

After the solution is created, start the translation. First, we need to load
For the terminology file (. Glo) exported by radialix, click the glossary option under the passolo tool menu to bring up the glossary dialog box:

Added terms, passolo
You only need to press the shortcut key F8 on the corresponding Translation Line (you can select multiple lines to operate at the same time.
One thing to note is that it is similar to passolo.
This intelligent tool will help you automatically translate repeated items. In most cases, it is a good thing, but in this example, note that Subtitle edit has subtitle format conversion, some markup, color, and font attributes such as bold
It cannot be translated. You need to determine the location of the word based on the context, whether it is the interface or the subtitle format. Finally, the translated scheme is used to generate the target file.

Compilation and non-standard processing


Return to DOTNET helper again. To facilitate the operation, we change the file with the extension. Res
The object names generated in are the same, for example, se. Res and Se. il. Drag and Drop the se. Il file to DOTNET helper
After successful compilation, a window will pop up. If your eyesight is good, you can see the word successfully:

Compilation failure also flash a window with a striking *** Number:

If an error occurs, the compiler will prompt the location of the error (corresponding to. Il ).
File. To view the error message, use DOTNET helper
Generate a batch file and run it in the command line.

Now let's run the compiled program and check that many button characters are not fully displayed. There are untranslated strings in the CREATE/Add rows and visual synchronization panel: "<symbol sec"
And "& ½ second back" buttons. To find out the cause, open the se. Il file in a text editor. The software I use here is
Editplus. For ease of viewing, set it first. Click "Preferences" in the editplus tool menu to bring up the parameter selection dialog box:

After setting, the syntax is highlighted. Next we will look for "<strong
SEC "and" & ½ second back "strings, no results; continue searching for strings near them, such as" <3 seconds ":

It can be seen that the control name corresponds to the string one by one. Obviously, the most marked section in the red box is "<
½ Sec ", you only need to replace it with" <second. However, we 'd better modify the corresponding part of the source. Il file decompiled by DOTNET helper, because
When passolo generates a new target file, we need to repeat the above operations. Instead, we should change the corresponding part of the source file to the string form that passolo can extract and hand it to passolo.
Processing.
[Note: if the source. Il file is changed, you must create or update strings for the source file (English) and target file (Chinese) in the passolo solution.
Passolo can extract modified strings]

After the above processing and secondary compilation, let's check whether there are still untranslated "non-standard strings". There are still two other parts: one is the jump dialog box between lines; one is in the Select language stream dialog box for importing binary subtitle files. Different from the previous one, both of these are dialog boxes rather than single strings,
This problem does not occur if the Chinese files generated by radialix are compiled. To know the difference, use DOTNET helper
Decompile the compiled Chinese files to other directories, and copy the. Il and. res files to the directory decompiled by the original English version. That is to say, we transplanted. Il in the radialix Chinese version.
The file and the. Resources and. xml files in the original English version form a new. net resource set:

"Se-" in compilation-
English version. Il ", the program still has the two untranslated dialog boxes. It can be inferred that the "non-standard string" is not in the. Il file, but in the. Resources file. Start
Radialix creates a localization project. The source file is
Subtitlecreator. chooselanguage. Resources, you can immediately see the "non-standard string ":

After translation, replace the source file with the generated target file.
The se. Il file is compiled. You can see that the dialog box has been translated. Handling nikse. subtitleedit. Forms. gotoline. Resources in the same way
File.

Control adjustment and Testing

The widget size and position are adjusted a lot, so they are placed at the end. Before the adjustment, you must confirm again that the program does not have any function missing issues. For example, if there is an independent word "dictionaries", I translate it into a dictionary, and the result is
The spelling check function of Subtitle edit is missing. How can I troubleshoot this problem?

All those who have learned programming know that there is a binary method, which can be used here for troubleshooting: In passolo
Sort the translation status columns so that translated rows are concentrated together, select about half translated rows from top to bottom, and press the shortcut key Ctrl + u
Cancel the translation and do not perform any additional actions. immediately generate the target file and compile and output the executable file for verification. There are only two situations: one is that there is still an error, indicating that in passolo
The row selected in is OK, so we can cancel the cancel translation operation first, and then select the other half that has already been translated to repeat the previous operation. The other is that there is no error, which indicates that in passolo
The selected row contains the part that cannot be translated, so we only need to select half of the selected row to continue the verification ...... Repeat the preceding operations several times to quickly locate the error location. Radialix
More convenient, you only need to sort the error-prone non-standard read-only attribute columns, then select half the number of non-read-only attribute rows and press the shortcut key Ctrl + k
Switch the read-only attribute, and the subsequent verification operations will be the same.

Now, adjust the widget size and position. First, let's take a look at how the. Il file describes:

It is also processed, and the actual data is not so close, but it is easy to identify the red line. In addition
Data starting with 0x is in hexadecimal format.
The calculator provided by the system can easily convert between decimal and hexadecimal.

You can adjust the value in the graph in two steps: the first step is rough adjustment.
Compare the decompiled "Se-Chinese version. Il" with the target file "se. Il" generated by passolo. Only the numerical value is changed. We usually use beyond
Compare to complete (there is no "Se-Chinese version. Il" file in hand, so you can only use the comparison graph of "se. Il" and the English source. Il file to fill the number );

The next step is fine-tuning. You can use
Editplus open the se. Il file for manual adjustment. Despite the trouble, you can refer to it: Open the previous radialix
In the localization scheme, select the control to be adjusted and switch to the resource tag to see the control name, position, size, and other data, which is also quite fast.

Update Maintenance

Updating the Chinese version is much easier. Open the previous
Radialix Localization Scheme, change the source file to the new version program, and then press the shortcut key F5 to update the resource, we can immediately know what changes are made to the new version of the program:

The following operations will not be detailed.

So far, we have completed
. Net program. Try to perform as many tests as possible before release to avoid presenting major errors to users. Due to Subtitle edit
This is an open-source and free green software, so shelling, packaging, and so on are not covered in this article. The above is a compromise between my current. Net Program localization and the future version of radialix.
This complex approach can be completely changed, or new tools can be created to provide better solutions. I hope my friends can share their experiences, and I hope that you will be able to learn more after reading this article.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.