Windows xp internationalization




















With the additional customization that is covered later in Step 5, applications can be enabled for multi-lingual support to run on versions prior to Windows Vista. The primary mechanisms available to split resources from executable code, starting with Windows Vista, are:. See Resource Utilities for more information. For the sake of simplicity, this tutorial uses muirct.

This overview describes the required steps; the next section presents a command file that performs those steps. The command line above uses the configuration file DoReverseMuiLoc. This type of configuration file is typically used by muirct.

In this case, the DoReverseMuiLoc. For more information about how to prepare a resource configuration file, see Preparing a Resource Configuration File. In addition to creating a HelloModule. In order to properly load at run-time the appropriate resources from the language-specific HelloModule.

This is done by a command such as:. Similarly, muirct. However, in those cases the language-neutral DLL is discarded, as only the first one created will be needed.

The commands that process the Spanish and French resources look like this:. One of the most important things to notice in the muirct. The value provided to muirct. This language value is central and is used by muirct.

An incorrect value produces resource loading failures for that particular. Each split. For this tutorial you create a command file containing the commands to split the various DLLs, and you invoke it manually. Note that in actual development work, you could reduce the potential for build errors by including these commands as pre-build or post-build events in the HelloMUI solution, but that is beyond the scope of this tutorial.

Copy DoReverseMuiLoc. When you create a release build, you copy the same DoReverseMuiLoc. The new run-time code presented in this step includes the module loading LoadLibraryEx and string retrieval LoadString logic.

Build and run the application. The output will be displayed in the language currently set as the display language of the computer provided it is one of the seven languages we have built.

Although the previous example is able to display its output in different languages, it falls short in a number of areas. Some folks don't realize that the reason folks says "i18n" is because there's eighteen letters between the i and n in i nternationalizatio n.

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author. Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sponsored By. About Scott Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. NET there's no way you can set a global culture for an entire process that would override the individual thread cultures.

Having worked on numerous applications where one of the key requirements was that the application use a different culture and language from the one in use by the operating system, I know many of you will struggle with this issue. The InternationalizationDemo program that's part of this month's source code download shows one way of tackling this problem see the link at the top of this article. While you might think that there's only one CultureInfo value per thread, there are actually two, and you'll see in a moment how this makes sense.

You get the first CultureInfo instance through the static properties—CultureInfo. CurrentCulture and Thread. The CultureInfo instance holds the locale information for performing all number, time, date, and calendar formatting. You can get the user interface display culture by reading the static properties, CultureInfo. CurrentUICulture and Thread. In order for you to change the locale for a thread, you should set the Thread.

CurrentUICulture properties. Since the Thread. If you try to set Thread. CurrentCulture to a CultureInfo instance that only has the language portion set, you'll encounter an exception. As I hinted at earlier, you can set the Thread. That way you can share UI resources, such as translated Windows Forms, across cultures that speak the same language, but don't share other cultural formatting. Figure 2 shows the code for a simple console application that outputs the current date and time using three different CultureInfo values.

The first value uses the system default. In my case, that's English as spoken in the U. After setting the current thread's CultureInfo, the second value is the date, displayed in German as spoken in Germany.

The final display is the result of passing a CultureInfo class as the second parameter to the DateTime.

ToString method. The final output of the program shows the properly formatted output for French as spoken in Switzerland. Earlier, I mentioned the invariant culture. With this option, no cultural information is applied, thus it is culture insensitive.

This is important in two kinds of situations. The first is when you need to make a security decision that depends on the return value of string comparisons or case change. Compare uses the CultureInfo. CurrentCulture culture to perform the comparison so security vulnerabilities may creep into the process if you do the compare with active locales that were never tested by the developer. In dealing with security and strings, always pass the invariant culture to any comparison or casing methods to ensure that there aren't any surprises.

Getting the invariant culture is easy, and the following two C lines are identical:. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Visit chat. Related Hot Network Questions. Question feed.

Stack Overflow works best with JavaScript enabled.



0コメント

  • 1000 / 1000