Zum Inhalt springen

Xfce/Sprache: Unterschied zwischen den Versionen

Aus Foxwiki
Der Seiteninhalt wurde durch einen anderen Text ersetzt: „'''Xfce/Sprache''' == Beschreibung == sudo dpkg-reconfigure locales Kategorie:Xfce
Markierung: Ersetzt
 
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 2: Zeile 2:


== Beschreibung ==
== 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.


In this tutorial, '''we’ll check out methods for changing the UI language on a Ubuntu 22.04 [https://www.xfce.org/ Xfce] desktop'''.
sudo dpkg-reconfigure locales


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].
[[Kategorie:Xfce]]
 
== 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'':
 
sudo locale-gen an_ES.UTF-8
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]
sudo nano ~/.i18n
 
Then, we add the code to export the [https://www.baeldung.com/linux/locale-environment-variables language-related environment variables]:
export LANGUAGE=an_ES.utf8
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''':
 
sudo nano ~/.config/xfce4/xinitrc
 
Next, we add the code in the ''~/.config/xfce4/xinitrc'' file:
 
#!/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:
 
sudo reboot
 
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'''.
 
== Using the Language Support Utility ==
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:
 
[[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&nbsp; 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.
 
== Conclusion ==
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'''.
 
== Links ==
# https://www.baeldung.com/linux/xfce-change-ui-language#bd-using-the-shell

Aktuelle Version vom 10. November 2025, 22:10 Uhr

Xfce/Sprache

Beschreibung

sudo dpkg-reconfigure locales