Skip to content

Latest commit

 

History

History

ResourcesExtractor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

ResourcesExtractor

This tool helps generating localized resources from a running WinUI application given the localizedResource.h file from WinUI source code.

The language codes were extracted based on winrt.h. The following method can be used to get a language id:

private static int MAKELANGID(int primaryLang, int subLang)
{
   return ((((ushort)(subLang)) << 10) | (ushort)(primaryLang));
}

For example, let's look into winrt.h for en-US. The two relevant entries are:

#define LANG_ENGLISH                     0x09
#define SUBLANG_ENGLISH_US                          0x01    // English (USA)

So, now if you do Console.WriteLine(MAKELANGID(0x09, 0x01).ToString("X"));, you'll get 409, so it's en-US is defined in Languages enum as en_us = 0x409.

The result of this tool is added in src\Uno.UI\Microsoft\UI\Xaml\Controls\WinUIResources