Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(i18n): In local installation by default use the EFI locale #1924

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lslezak
Copy link
Contributor

@lslezak lslezak commented Jan 20, 2025

Problem

  • In a local installation Agama by default always uses the English language in the UI.
  • But in a remote installation it uses the language configured in the browser.
  • It would be nice to have something similar also in a local installation and read the preferred language directly from the system.

Solution

  • Use the language configured in the EFI firmware

Advantages

  • Allows using the user preferred language also in a local installation

Disadvantages

  • Works only with EFI firmware (i.e. does not work on S390)
  • The list of supported languages is firmware dependent. Some firmware might support few languages (the VirtualBox EFI firmware supports only English or French), some might support quite a lot of languages (my Asus board offers 7 additional languages besides the English default) and some firmware might implement none (just using the English default).
  • For users it might not be obvious which language is actually configured in the firmware. At boot time firmware usually displays a splash screen with vendor logo without any hint about the selected language. This might be confusing if you buy a second hand laptop and the previous user used some exotic language...

Although it has some drawbacks and probably only very few users will benefit from this feature I still find it pretty cool. 😎
If we later get some bug reports about this feature we can easily disable it. But I'd like to give it a try... 💪

To get a list of languages supported by your firmware run

cat /sys/firmware/efi/efivars/PlatformLangCodes-* | tail -c +5 | tr -cd '[:print:]'

Notes

  • When connecting remotely it still prefers the browser language, this change only affects the local installation
  • The later "welcome screen" will allow changing the language in the very first dialog. So if the EFI default is not what the user would like so see then it can be changed easily.

Testing

  • Tested manually in VirtualBox which allows selecting between English (default) and French, see the screenshots and the recording below.

Screenshots

After selecting the French language in the firmware...

agama-efi-language-selection

... you will see Agama in French as well. (OK, not all descriptions are translated...)

agama-efi-language

Recording

agama-efi-language-screen0.webm

Note: For some reason the Chrome browser does not play the video well for me, right-clicking and selecting "Open video in a new tab" works fine though. And Firefox is OK...

When connecting remotely it still prefers the browser language
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12872161404

Details

  • 0 of 7 (0.0%) changed or added relevant lines in 1 file are covered.
  • 110 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.01%) to 70.928%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rust/agama-server/src/web/http.rs 0 7 0.0%
Files with Coverage Reduction New Missed Lines %
rust/agama-server/src/web/http.rs 1 6.82%
rust/agama-lib/src/product/client.rs 26 0.0%
rust/agama-server/src/software/web.rs 83 0.0%
Totals Coverage Status
Change from base Build 12870685697: 0.01%
Covered Lines: 17183
Relevant Lines: 24226

💛 - Coveralls

@ancorgs
Copy link
Contributor

ancorgs commented Jan 21, 2025

Something different but kind of related. I have a Laptop with a german keyboard layout. I use everything in English (EFI, system, etc.)

The point is that when I enter the Grub shell, the german layout is used. Without configuring anything special, the physical layout corresponds to what Grub does. That is usually not the case with operating systems.

I wonder how that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants