Mac context menus and regions

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Mac context menus and regions

Postby JasonLP » Mon Aug 24, 2020 9:50 am

On Mac with CEF version 78.3.9 I am setting the locale using the following code:
Code: Select all
   
    NSString* locale = [[NSLocale currentLocale] localeIdentifier];
    NSLog(@"Using locale %@", locale);
    CefString(&settings.locale).FromString([locale cStringUsingEncoding:NSUTF8StringEncoding]);


For most languages, the context menu that pops up on a text field is showing appropriately, but some combinations of language with regions are failing. For instance, in English, if the region is set to Canada, the context menu strings are empty. It looks like the following:

Screen Shot 2020-08-24 at 10.38.24 AM.png
Screen Shot 2020-08-24 at 10.38.24 AM.png (255.2 KiB) Viewed 1840 times


It seems if an exact match is not found, it will not fall back to a known set of resources. Is there any workaround for this?
JasonLP
Mentor
 
Posts: 98
Joined: Fri Jul 25, 2014 10:10 am

Re: Mac context menus and regions

Postby magreenblatt » Mon Aug 24, 2020 9:59 am

I would suggest that you restrict the setting to the list of locales supported by CEF, and fall back to some reasonable default if the current system locale is not supported.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 58 guests