|
|
| (5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) |
| Zeile 1: |
Zeile 1: |
| = Language in Xfce =
| | '''Xfce/Sprache''' |
|
| |
|
| == 1. Overview == | | == Beschreibung == |
|
| |
|
| In multi-user environments, we might need to change the user interface or [https://www.baeldung.com/linux/gui graphical user interface (GUI)] language to interact with the system in our preferred language. For instance, this task becomes essential when we want to personalize the computing environment and standardize its visual elements according to our native language.
| | sudo dpkg-reconfigure locales |
|
| |
|
| In this tutorial, '''we’ll check out methods for changing the UI language on a Ubuntu 22.04 [https://www.xfce.org/ Xfce] desktop'''.
| | [[Kategorie:Xfce]] |
| | |
| Notably, our examples involve changing the UI language to Aragonese using the shell and the [https://www.baeldung.com/linux/gnome-calendar-monday-first-day#using-the-language-support-utility Language Support utility].
| |
| | |
| == 2. Using the Shell ==
| |
| | |
| '''We can change the UI language in Xfce through the shell in case we prefer command-line interactions'''.
| |
| | |
| Particularly, in this method, we’ll configure the [https://baeldung.com/linux/terminal-locales-check-character-encoding#locale locale] settings and modify specific files to set the desired language as Aragonese.
| |
| | |
| For this, let’s open the terminal and use ''locale-gen'' to generate locale for Aragonese which is ''an_ES.UTF-8'':
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">$ sudo locale-gen an_ES.UTF-8</div>
| |
| Generating locales (this might take a while)...
| |
| an_ES.UTF-8... done
| |
| Generation complete.
| |
| | |
| Once the locale generation is complete, we edit the [https://www.baeldung.com/linux/gnome-calendar-monday-first-day#editing-a-specific-locales-file ~/.i18n file] in a text editor like [https://baeldung.com/linux/files-vi-nano-emacs#nano nano]:
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">$ sudo nano ~/.i18n</div>
| |
| | |
| Then, we add the code to export the [https://www.baeldung.com/linux/locale-environment-variables language-related environment variables]:
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">export LANGUAGE=an_ES.utf8</div>
| |
| export LANG=an_ES.utf8
| |
| export LC_ALL=an_ES.utf8
| |
| | |
| In the above script, '''we specify ''an_ES.utf8'' as the value of the [https://www.baeldung.com/linux/terminal-locales-check-character-encoding#linux-locale LANGUAGE, LANG, and LC_ALL] variables, respectively'''.
| |
| | |
| Thus, we set the language, and default locale, and override all other locale settings with the Aragonese locale.
| |
| | |
| After adding the code, we press ''CTRL+O'' and ''Return'' to save the ''~/.i18n'' file and ''CTRL+X'' to exit the ''nano'' editor:
| |
| | |
| [[Image:Bild3.png|top|alt="saving .i18n script in xfce"]]
| |
| | |
| Then, '''we modify the ''~/.config/xfce4/xinitrc'' file to include the language settings during Xfce session initialization''':
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">$ sudo nano ~/.config/xfce4/xinitrc</div>
| |
| | |
| Next, we add the code in the ''~/.config/xfce4/xinitrc'' file:
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;"><nowiki>#!/bin/sh</nowiki></div>
| |
| if [ -f "$HOME/.i18n" ]; then
| |
| . "$HOME/.i18n"
| |
| fi
| |
| . /etc/xdg/xfce4/xinitrc
| |
| | |
| In the above script, the ''if'' statement with the ''-f'' option checks if the ''$HOME/.i18n'' file exists. If so, the dot ''.'' which is shorthand for the [https://www.baeldung.com/linux/source-command source] command, reads and executes commands from ''$HOME/.i18n'' containing the environment variable settings for UI language configurations.
| |
| | |
| Next, '''we ''source'' the ''/etc/xdg/xfce4/xinitrc'' script with ''.'' to incorporate its functionality into the current shell session'''.
| |
| | |
| After adding the code, we press ''CTRL+O'' and ''Return'' to save the ''~/.config/xfce4/xinitrc'' file and ''CTRL+X'' to exit the ''nano'' editor:
| |
| | |
| [[Image:Bild4.png|top|alt="saving content of xinitrc file in xfce linux"]]
| |
| | |
| Lastly, we reboot the system to apply the language and switch to the new UI language:
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;">$ reboot</div>
| |
| | |
| Now, we open any application, such as Calendar on our system to test the configured settings:
| |
| | |
| [[Image:Bild5.png|top|alt="viewing calendar in xfce for testing"]]
| |
| | |
| As a result, '''we can see Aragonese as the UI language of the components of the Calendar application'''.
| |
| | |
| == 3. Using the Language Support Utility ==
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;"></div>
| |
| | |
| In Xfce, '''Language Support is a graphical tool that enables us to manage the language-related configuration'''. Specifically, this method is often more user-friendly and doesn’t require extensive command-line interactions.
| |
| | |
| In particular, '''we use the Language Support tool to change the UI language of our Xfce desktop environment to Aragonese'''.
| |
| | |
| To do so, first, we type ''Language Support'' in the ''Activities'' menu and open the application:
| |
| | |
| [[Image:Bild6.png|top|alt="opening language support in xfce linux"]]
| |
| | |
| Then, we click on the ''Install/Remove Languages…'' button to install a new UI language:
| |
| | |
| | |
| <div style="text-align:center;margin-left:0.212cm;margin-right:0.212cm;"></div>
| |
| | |
| [[Image:Bild7.png|top|alt="clicking on install or remove languages button in language tab of language support"]]
| |
| | |
| Next, '''we look for ''Aragonese'' in the ''Language'' list, mark its checkbox for installation, and click ''Apply''''':
| |
| | |
| [[Image:Bild8.png|top|alt="installing aragonese language on xfce"]]
| |
| | |
| After that, '''we drag the ''Aragonese'' entry at the top of the L''anguage for menus and windows''''' and click on the ''Apply system-wide'' button:
| |
| | |
| [[Image:Bild9.png|top|alt="applying system wide language settings"]]
| |
| | |
| Now, we enter the ''Password for root'' and click ''Authenticate'':
| |
| | |
| [[Image:Bild10.png|top|alt="entering system password for authentication to apply changes"]]
| |
| | |
| This process may take a few minutes to apply the language changes to the system interface:
| |
| | |
| [[Image:Bild11.png|top|alt="waiting for applying language changes on xfce"]]
| |
| | |
| Then, we open the ''Log Out'' prompt window via the ''Activities'' menu to log out of the current session:
| |
| | |
| [[Image:Bild12.png|top|alt="logging out of current screen in xfce"]]
| |
| | |
| After that, we enter the password to again log into the system:
| |
| | |
| [[Image:Bild13.png|top|alt="logging in again in xfce"]]
| |
| | |
| Now, '''we open any application like the Text Editor to test the UI language changes''':
| |
| | |
| [[Image:Bild14.png|top|alt="opening text editor for testing in xfce"]]
| |
| | |
| Thus, we can see Aragonese as the UI language of the Text Editor on our desktop.
| |
| | |
| == 4. Conclusion ==
| |
| | |
| <div style="margin-left:0cm;margin-right:0cm;"></div>
| |
| | |
| In this article, we learned different methods for changing the UI language of an Xfce desktop.
| |
| | |
| Particularly, we can edit the ''~/.i18n'' in the shell to set the language-related environment variables. On the other hand, the Language Support utility enables us to change the UI language via a user-friendly interface.
| |
| | |
| Ultimately, '''we can select any of these methods based on our preference for using the command line or graphical user interface'''.
| |
| | |
| | |
| # https://www.baeldung.com/linux/xfce-change-ui-language#bd-using-the-shell
| |
| | |
| | |
| = TMP =
| |
| Hier wird beschrieben, wie man unter Arch Linux ein auf UTF-8 basierendes System mit deutschem Tastaturlayout erhält. Die folgenden Arbeiten müssen als root ausgeführt werden! Wichtig: ALLE Schritte müssen gemacht werden.
| |
| | |
| == Grundkonfiguration ==
| |
| | |
| === Deutsches Deutsch ===
| |
| echo LANG=de_DE.UTF-8 > /etc/locale.conf
| |
| echo KEYMAP=de-latin1-nodeadkeys > /etc/vconsole.conf
| |
| ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
| |
| Wenn Akzent-Zeichen wie <code>é</code>, <code>è</code>, <code>â</code> benutzt und z. B. aus <kbd>'</kbd> und <kbd>E</kbd> zusammengesetzt werden sollen, muss <code>KEYMAP="de-latin1"</code> verwendet werden.
| |
| | |
| === Schweizerisches Deutsch ===
| |
| Für ein System, das auf „schweizerischem Deutsch“ betrieben werden soll, sind geringfügig andere Optionen nötig.
| |
| echo LANG=de_CH.UTF-8 > /etc/locale.conf
| |
| echo KEYMAP=de_CH-latin1 > /etc/vconsole.conf
| |
| ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime
| |
| | |
| === Österreichisches Deutsch ===
| |
| Österreichische Systeme werden analog dazu wie folgt konfiguriert.
| |
| echo LANG=de_AT.UTF-8 > /etc/locale.conf
| |
| echo KEYMAP=de-latin1-nodeadkeys > /etc/vconsole.conf
| |
| ln -s /usr/share/zoneinfo/Europe/Vienna /etc/localtime
| |
| Im Beispiel mit deutschem Tastaturlayout.
| |
| | |
| Für alle Varianten: Falls die Tastatureinstellung durch direktes Schreiben der Datei <code>/etc/vconsole</code> nicht funktioniert, mit dem Befehl <code>localectl</code> versuchen (siehe weiter unten).
| |
| | |
| == Hardwareuhr ==
| |
| Die Hardwareuhr sollte auf die UTC Zeit eingestellt sein, ansonsten könnte es unter Umständen zu Problemen mit Programmen kommen, die als Grundlage die Hardwareuhr verwenden, und UTC voraussetzen.
| |
| timedatectl set-local-rtc 0
| |
| Die lokale Uhrzeit wird anhand der Zeitzonenangabe (siehe vorheriger Abschnitt) aus der UTC-Zeit berechnet.
| |
| | |
| == Locales ==
| |
| Damit die Locales auch verwendet werden können, müssen diese noch generiert werden. Die gewünschten Locales werden in der Datei <code>/etc/locale.gen</code> aktiviert. In der Datei befinden sich alle generierbaren Locales. Vor den gewünschten Angaben muss das Kommentarzeichen entfernt werden.
| |
| de_DE.UTF-8 UTF-8 # Für Deutschland
| |
| de_CH.UTF-8 UTF-8 # Für die Schweiz
| |
| de_AT.UTF-8 UTF-8 # Für Österreich
| |
| | |
| === Generieren ===
| |
| Nach der Konfiguration werden die Locales dann generiert.
| |
| locale-gen
| |
| | |
| Generating locales...
| |
| de_DE.UTF-8... done
| |
| Generation complete.
| |
| Spätestens nach einem Neustart ergibt sich beim Überprüfen nun folgendes Bild.
| |
| locale
| |
| | |
| LANG=de_DE.UTF-8
| |
| LC_CTYPE="de_DE.UTF-8"
| |
| LC_NUMERIC="de_DE.UTF-8"
| |
| LC_TIME="de_DE.UTF-8"
| |
| LC_COLLATE="de_DE.UTF-8"
| |
| LC_MONETARY="de_DE.UTF-8"
| |
| LC_MESSAGES="de_DE.UTF-8"
| |
| LC_PAPER="de_DE.UTF-8"
| |
| LC_NAME="de_DE.UTF-8"
| |
| LC_ADDRESS="de_DE.UTF-8"
| |
| LC_TELEPHONE="de_DE.UTF-8"
| |
| LC_MEASUREMENT="de_DE.UTF-8"
| |
| LC_IDENTIFICATION="de_DE.UTF-8"
| |
| LC_ALL=
| |
| Das Setzen der LC-Variablen kann systemweit in <code>/etc/locale.conf</code>, oder useraccountbezogen in <code>~/.config/locale.conf</code> vorgenommen werden.
| |
| export LC_DATE=de_DE.utf8
| |
| export LC_NUMERIC=de_DE.utf8
| |
| export LC_TIME=de_DE.utf8
| |
| export LANG=de_DE.utf8
| |
| Nach Änderungen sollte man sich zumindest einmal ab- und wieder anmelden.
| |
| | |
| == X.org ==
| |
| X nutzt udev zur Erkennung von Eingabegeräten. Diese können unter <code>/etc/X11/xorg.conf.d/</code> konfiguriert werden. Ein deutsches Tastaturlayout wird für alle angeschlossenen Tastaturen mit dem Anlegen der Datei <code>/etc/X11/xorg.conf.d/00-keyboard.conf</code> definiert.
| |
| Section "InputClass"
| |
| Identifier "system-keyboard"
| |
| MatchIsKeyboard "on"
| |
| Option "XkbLayout" "de"
| |
| Option "XkbVariant" "deadgraveacute"
| |
| EndSection
| |
| Das Schweizer Layout erreicht man mittels <code>Option "XkbLayout" "ch"</code>. Bei Verwendung einer Tastatur mit Deutschem Layout kann man <code>Option "XkbVariant" "de"</code> belassen.
| |
| | |
| Mit der <code>Option "XkbVariant" "deadgraveacute"</code> werden nur die Gravis (<code>`</code>) und Akut (<code>´</code>) Taste als "dead key" behandelt und der Zirkumflex (<code>^</code>) nicht. Bei einem "dead key" wird erst einen Tastendruck später ein Buchstabe erstellt, womit man <code>Café</code> anstatt <code>Caf´e</code> schreibt.
| |
| | |
| Anschließend muss X neugestartet werden.
| |
| | |
| == localectl ==
| |
| Anstatt die Konfigurationsdateien manuell zu bearbeiten, kann auch <code>localectl</code> genutzt werden.
| |
| | |
| === Aktuelle Einstellungen anzeigen ===
| |
| localectl status
| |
| | |
| System Locale: LANG=de_DE.UTF-8
| |
| LANGUAGE=de_DE
| |
| VC Keymap: de-latin1-nodeadkeys
| |
| X11 Layout: de
| |
| X11 Model: pc105
| |
| X11 Variant: nodeadkeys
| |
| | |
| === Tastaturlayout einstellen ===
| |
| | |
| ==== Deutsches Deutsch ====
| |
| localectl --no-convert set-keymap de-latin1-nodeadkeys
| |
| | |
| localectl --no-convert set-x11-keymap de pc105 deadgraveacute
| |
| | |
| ==== Schweizer Deutsch ====
| |
| Es scheint, dass die Untersektion <code>de_sundeadkeys</code> aus dem <code>ch</code> Key-Mapping mit Update vom 17.02.2021 entfernt wurde. Der bisherige <code>localectl</code> Befehl meldet:
| |
| Failed to set keymap: Specified keymap cannot be compiled, refusing as invalid.
| |
| Nachfolgend die aktuellen Befehle:
| |
| localectl --no-convert set-keymap de_CH-latin1
| |
| | |
| localectl --no-convert set-x11-keymap ch pc106
| |
| Allerdings hat das Key-Mapping (nach wie vor?) den Fehler, dass <code>AltGr-1</code> einen Bar (|) anstatt des Broken-Bars (¦) produziert.
| |
| | |
| Die Einstellungen werden in <code>/etc/vconsole.conf</code> und <code>/etc/X11/xorg.conf.d/00-keyboard.conf</code> gespeichert. Manuelle Änderungen an diesen Dateien werden beim nächsten Aufruf von localectl überschrieben.
| |
| | |
| Die Option <code>--no-convert</code> verhindert, dass set-keymap auch das Xorg Layout ändert. Beziehungsweise set-x11-keymap das Layout für die Konsole. Mehr Optionen <code>man localectl</code>.
| |
| | |
| == Siehe auch ==
| |
| | |
| * Locale
| |
| * locale.conf
| |
| | |
| == Weblinks ==
| |
| | |
| * ''Locale Helper'' über <code>de_DE</code>
| |