Chapter 4. Customizing WebYaST Interface

Contents

4.1. Replacing Graphics and Style Sheets
4.2. Customizing Text Strings

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.

4.1. Replacing Graphics and Style Sheets

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/images/webyast-logo.png add a replacement file in /srv/www/yast/public/vendor/images/webyast-logo.png.


4.2. Customizing Text Strings

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/LANGUAGE/LC_MESSAGES/. For WebYaST modules, the generated .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.

[Note]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:

  1. Copy /srv/www/yast/po/en/yast_webclient.po to /srv/www/yast/public/vendor/text/po/en/yast_webclient.po.

  2. Edit the text strings in the copied file /srv/www/yast/public/vendor/text/po/en/yast_webclient.po.

  3. 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
    
  4. 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
        

WebYaST WebYaST Vendor Guide 11