You can customize the WebYaST interface by changing graphic elements such as default logos and other graphical objects, or by modifying cascading style sheets or text strings.
All graphic elements of the WebYaST interface, such as images, icons, and cascading style sheets (CSS), are stored in the YaST2 Webclient public directory:
/srv/www/yast/public/
This public directory contains the vendor
subdirectory, which is used as an alternative location for
vendor-specific images, icons, and style sheets. You can replace any file
in the public directory by adding a file with the same relative path into
the vendor subdirectory. If a file exists in this
alternative location, WebYaST uses that file in place of its default
equivalent.
Example 4.1. Using Custom Graphic Files
For example, to override the WebYaST logo stored in
/srv/www/yast/public/
add a replacement file in
images/webyast-logo.png/srv/www/yast/public/.
vendor/images/webyast-logo.png
WebYaST uses gettext to provide translations for text
strings in the user interface. The translations are split in textdomains.
Each textdomain contains text strings for a different part of the user
interface, for example a WebYaST module.
Different textdomains are loaded for different modules. For example, when the WebYaST Status module is loaded, the following textdomains are loaded:
Loading standard textdomain: yast_webclient Loading standard textdomain: yast_webclient_status
For each textdomain, the list of all text strings and their translations
is available in an standard gettext .po file that
you can edit. These .po are available in the WebYaST
source packages.
The editable .po files have to be converted into
binary .mo files with the
rake makemo command. For the main WebYaST domain,
the generated .mo files are located in
/srv/www/yast/locale/.
For WebYaST modules, the generated LANGUAGE/LC_MESSAGES/.mo files are
located in
/srv/www/yast/vendor/plugins/.
MODULE/locale/LANGUAGE/LC_MESSAGES/
This translation mechanism can also be used for customizing the text strings.
![]() | Translations of Customized Strings |
|---|---|
If you customize English strings, do not forget to also customize their translations, if you want to use WebYaST in languages other than English. | |
Procedure 4.1. Customizing English Strings
For example, if you want to change the English strings in the
yast_webclient textdomain, follow these steps:
Copy
/srv/www/yast/po/
to
en/yast_webclient.po/srv/www/yast/public/vendor/text/po/.
en/yast_webclient.po
Edit the text strings in the copied file
/srv/www/yast/public/vendor/text/po/.
en/yast_webclient.po
In the /srv/www/yast/public/vendor/text directory
execute the following command to create updated
.mo files:
export RAILS_PARENT=/srv/www/yast env LANG=en rake makemo
Restart the Web server. The following entries are generated in the log file:
Loading textdomain yast_webclient from public/vendor/text/locale
Loading standard textdomain yast_webclient_status