Is there a repository for localized common text in WinForms?

后端 未结 2 1134
青春惊慌失措
青春惊慌失措 2020-12-12 00:49

I\'m globalizing a Windows form application.

Is there a way to access common text in the current language for Windows?

For example, for the labels of OK, C

2条回答
  •  难免孤独
    2020-12-12 01:21

    This seems to have some information regarding that:

    The USER32.dll is indeed the repository for localized string in Windows.

    However, it does not not contains multiple string tables, only one.

    I've access to some other localized Windows versions (pt-BR, es-ES, among others) and in every one of them the following positions are fixed from Window XP through Windows 7:

    800 - OK 801 - Cancel 802 - &Abort ...

    I'd still treat this as an implementation detail and nothing to rely on. Read Raymond Chen's blog for various horror stories of developers that took Windows-internal things for granted and eternal.

    Also why not just have your own strings? You can easily put “OK” on the button yourself instead of grabbing it from the OS (and then localize it yourself if your application is intended to be localized). As a user I find it mildly confusing to have parts of an interface in another language than the rest (which would then invariably happen if your program has no localization, say, in German and is used on a German Windows machine – this would leave the interface in English with only the buttons in German).

提交回复
热议问题