Need to know which are cultures are supported for TextBlock.IsHyphenationEnabled

I’m currently working on a WPF application and using the TextBlock.IsHyphenationEnabled property to handle text hyphenation. I understand that hyphenation behavior can be culture-specific, and I’m trying to ensure proper functionality across different languages.

Could anyone provide a list of cultures that are officially supported for hyphenation when using the TextBlock.IsHyphenationEnabled property? Specifically, I’m interested in knowing if languages like Swedish (sv-SE), German (de-DE), and others are fully supported.

I see some code related to it but not sure how culture support is done:

Class: NaturalLanguageHyphenator

 public override bool IsCultureSupported(CultureInfo culture)
 {
    // Accept all cultures for the time being. Ideally, NL6 should provide a way for the client to test supported culture.
    return true;
 }

Additionally, if any specific settings or configurations are required on the client machine, such as installing language packs in Windows

Code and debugging values for TextBlock and Culture info (sv-SE not working here)

<TextBlock IsHyphenationEnabled="True" 
Text="{Binding Name}" Language="sv-SE"
TextWrapping="Wrap"/>

System.Globalization.CultureInfo.CurrentCulture - en-IN System.Globalization.CultureInfo.CurrentUICulture - sv

Any documentation or experiences you can share would be greatly appreciated!

Thanks in advance for your help.

1

This is not an answer, but it may help in the investigation.

As you may suspect, Hyphenation is done with the use of native dll. Most probably it is C:WindowsSystem32NaturalLanguage6.dll at very end.

There is a PresentationNative_xxxxx.dll in the middle, but it doesn’t matter right now. NL6 team doesn’t provide a way for the client to test supported culture, as we can read from the comment.

NaturalLanguage6.dll exports 4 functions: DllCanUnloadNow, DllGetClassObject, DllRegisterServer and DllUnregisterServer so it’s a COM library.

I’ve found 4 CLSIDs related to this dll: {0E1EEFB2-E336-481C-B178-36261EC5A843}, {333E6924-4353-4934-A7BE-5FB5BDDDB2D6}, {89EA5B5A-D01C-4560-A874-9FC92AFB0EFA} and {D385FDAD-D394-4812-9CEC-C6575C0B2B38}, but I can’t find much more. I tried to use OleView.exe to inspect NaturalLanguage6.dll, but it failed.

To make thing worse, there is no guarantee that PresentationNative_xxxxx.dll uses NaturalLanguage6.dll, especially on platforms different than Windows.

Anyway it seems that:

  • .NET team doesn’t know which cultures are supported,
  • functionality is buried deep in Windows system dlls,
  • supported cultures may change with Windows updates.

Since it’s pointless to call PresentationNative‘s methods (there’s none that would help), the next likely step will be to decompile the dll to see what’s inside.

1

IsHyphenationEnabled works with any culture language that:

  1. Is installed (e.g. via Language Pack)
  2. Has a valid LCID (i.e. not 4096)

To determine which languages are installed, you can use the GetInstalledInputLanguages() method in this answer.

Then, to determine which cultures allow for hyphenation, we can use this method:

private static ICollection<CultureInfo> GetInstalledCultures()
{
    var languages = GetInstalledInputLanguages()
        .Select(c => c.TwoLetterISOLanguageName)
        .ToHashSet();

    var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures)
        .Where(c => c.LCID != 4096)
        .Where(c => languages.Contains(c.TwoLetterISOLanguageName))
        .ToList();

    return cultures;
}

On my system, I have en-US and en-GB installed which yield the following hyphenation-enabled cultures:

en, en-029, en-AU, en-BZ, en-CA, en-GB, en-HK, en-ID, en-IE, en-IN,
en-JM, en-MY, en-NZ, en-PH, en-SG, en-TT, en-US, en-ZA, en-ZW

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật