cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.23k stars 1.11k forks source link

Bug reporting integration: "Report to Fedora" does not respect Cockpit UI language setting #18337

Open M4rtinK opened 1 year ago

M4rtinK commented 1 year ago

Explain what happens

  1. make sure to have a reportable crash logged in journal
  2. to to the logs page
  3. click on the reportable crash entry
  4. the crash reporting page opens
  5. after a few seconds the two bug reporting buttons show up
  6. description of the second button is never translated to the Cockpit UI language and is always in Czech (likely due to this being my system language) Screenshot 2023-02-14 at 02-17-56 Logs - mkolman@localhost localdomain
  7. try switching the Cockpit UI language
  8. everything else changes language, including description of the first button

Version of Cockpit

282

Where is the problem in Cockpit?

Logs

Server operating system

Fedora

Server operating system version

37

What browsers are you using?

Firefox

System log

No response

jelly commented 1 year ago

The label comes from DBUS specifically org.freedesktop.reportd.Service GetWorkflows. So in our test this shows:

Report to Cockpit
Report to Fedora

This isn't something we can translate as it comes from dbus:

> debug: dbus: {"reply":[[[["workflow_Cockpit","Report to Cockpit","Process the crash using Cockpit infrastructure"],["workflow_FedoraCCpp","Report to Fedora","Process the
C/C++ crash using the Fedora infrastructure"]]]],"id":"1"}

So I'm afraid this is a won't fix.

M4rtinK commented 1 year ago

Fair enough - while there could be some systems with a missmatch, mostly the Cockpit UI and system language will probably be the same.

marusak commented 1 year ago

This must be the first case when something is not English and people want it to be :)

We often get reports that something is not translated what we get though dbus. And the question is always "can we ask the service to send translated data?" So this is a good learning opportunity to figure out how to ask dbus for language specific version.

M4rtinK commented 1 year ago

I know about at least one project that supports sending custom-translated data - the RHSM Dbus service:

https://www.candlepinproject.org/docs/subscription-manager/dbus_objects.html#d-bus-objects

Note: All methods have at least one string argument. This last string argument can be empty string or it can specify locale. When locale string is set to supported locale, then RHSM service will try to translate some strings and error messages.

So its possible, but at least in this case it means that every DBus method signature needs to have a string argument to set the language for translation. That solves the issue but has a quite substantial impact on DBus API design.