Browser language settings

Having problems with building or using the JCEF Java binding? Ask your questions here.

Browser language settings

Postby rreimann » Fri Aug 14, 2015 4:44 am

I'm struggling to change the language used in embedded chromium throughout the whole UI.

Setting the "lang" switch to "de" (german) in a CefAppHandlerAdapter affected only parts of the UI:
  • Button label for <input type=file ...> element changed the language to german
  • File dialog buttons when clicking on <input type=file ...> are still english (open/cancel).
  • Default entries in menu and context menu are still english

Are there any other switches beyond "lang" i need to set to get localized texts/labels throughout the whole browser?
rreimann
Newbie
 
Posts: 6
Joined: Wed Aug 05, 2015 10:43 am

Re: Browser language settings

Postby magreenblatt » Fri Aug 14, 2015 8:24 am

rreimann wrote:File dialog buttons when clicking on <input type=file ...> are still english (open/cancel).

These are the default OS dialogs and will not be localized unless your OS is localized (e.g. install the German version of Windows).

rreimann wrote:Default entries in menu and context menu are still english

The top menu is not localized. The context menu will be localized if translations are available -- are any of the entries in the context menu localized for you?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Browser language settings

Postby rreimann » Fri Aug 14, 2015 9:11 am

magreenblatt wrote:
rreimann wrote:File dialog buttons when clicking on <input type=file ...> are still english (open/cancel).

These are the default OS dialogs and will not be localized unless your OS is localized (e.g. install the German version of Windows).

Yes i know that this is an OS dialog and i'm using a german version of OS X. Opening the dialog from the same web page in a regular browser shows localized buttons - see attached screenshots for a comparison regular browser vs. CEF. Therefore it seems to me that (J)CEF needs an additional language/locale switch or is not passing on the provided lang switch to the OS properly.
FileDialog_CEF.tiff
FileDialog_CEF.tiff (112.32 KiB) Viewed 15072 times
FileDialog_Chrome.tiff
FileDialog_Chrome.tiff (116.83 KiB) Viewed 15072 times


magreenblatt wrote:
rreimann wrote:Default entries in menu and context menu are still english

The top menu is not localized. The context menu will be localized if translations are available -- are any of the entries in the context menu localized for you?

In my case the top menu is a default OS menu (no additional Swing menu involved - see screenshot). Since i'm using a german OS X installation it's german by default (for other applications) but for the JCEF application it's english instead.
default_menu.png
default_menu.png (38.57 KiB) Viewed 15072 times


Regarding the default CEF context menu (no additional custom entries) i assumed that CEF comes with the same translations as a standalone chromium and expected default items like "Back", "Forward", "Print", ... would be localized without the need to provide additional translations by myself.
rreimann
Newbie
 
Posts: 6
Joined: Wed Aug 05, 2015 10:43 am

Re: Browser language settings

Postby magreenblatt » Fri Aug 14, 2015 9:32 am

What JCEF version are you using?

I'm not sure how translation works for the OS file dialogs on OS X -- maybe you can find that out. The top menu and context menus will only be translated if your app bundle includes localized strings (*.lproj folders under "Resources/" for the top menu and "Contents/Frameworks/Chromium Embedded Framework.framework/Resources/" for the context menu). CEF should provide the context menu translations but you are responsible for top menu translations. Check the app bundle contents to see if the context menu translations are included.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Browser language settings

Postby rreimann » Fri Aug 14, 2015 9:40 am

magreenblatt wrote:What JCEF version are you using?

I'm using the fairly old jcef_binary_3.1750.1738.91_macosx64 - i can't use the current master due to https://bitbucket.org/chromiumembedded/ ... at-startup
rreimann
Newbie
 
Posts: 6
Joined: Wed Aug 05, 2015 10:43 am

Re: Browser language settings

Postby magreenblatt » Fri Aug 14, 2015 10:41 am

rreimann wrote:
magreenblatt wrote:What JCEF version are you using?

I'm using the fairly old jcef_binary_3.1750.1738.91_macosx64 - i can't use the current master due to https://bitbucket.org/chromiumembedded/ ... at-startup

Did you actually try the newer version? It works for me as reported in the issue.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Browser language settings

Postby rreimann » Mon Aug 17, 2015 1:28 am

magreenblatt wrote:Did you actually try the newer version? It works for me as reported in the issue.

Yes i did and i'm getting a white screen as described in #166 for my own application as well as the sample app when invoking java directly instead of using the binary launcher jcef_simple_app.app/Contents/MacOS/JavaAppLauncher.
rreimann
Newbie
 
Posts: 6
Joined: Wed Aug 05, 2015 10:43 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 49 guests