Skip to content

Translating Uyuni to your language

Abid Mehmood edited this page Sep 7, 2020 · 26 revisions

Introduction

Uyuni is developed in English first and for a long time it has been available only in English. Since Uyuni is a fork of Spacewalk, it inherited partial translations but as they were not maintained, they were disabled.

In mid-2020, SUSE started to reintroduce localization capabilities into Uyuni, per request of SUSE Manager customers.

Scope

A full translation of Uyuni comprises several "blocks":

  • WebUI
  • Command-line tools
  • Documentation
  • YaST module

Each of those blocks, in turn, comprises several pieces.

Plan for translation

It is important to note translating Uyuni is not an "all or nothing" effort: you may translate progressively.

First of all, you should identify who your target user is:

  • Does he use mostly the command-line tools?
  • The WebUI?
  • Or maybe he would feel comfortable with using the WebUI and command-line tools in English, and he only wants the documentation to be translation?

Now that you know where to start, one piece of advice: prefer to translate full "blocks", i. e. do not translate a few pages of the WebUI, then some half the installation guide, then 30% of the core command-line tools "block". That kind of translation cannot be made available by default (and maybe not even shipped) because it's everything is incomplete. On the other hand, if you only translate the Installation Guide, that's a perfectly shippable translation.

How to translate

The source code of Uyuni is all hosted in git repositories, check this page for details:

https://www.uyuni-project.org/pages/source-code.html

To make things easy for translators, we are using the openSUSE WebLate instance to translate Uyuni:

https://l10n.opensuse.org/translate/uyuni/

Strings are pulled from git to WebLate, and pushed the other way around, every few hours in an automated process.

To avoid breaking WebLate because of merge conflicts, translating directly in the git repositories (i. e. a pull request to a GitHub repository which modifies target-language translation files) is NOT allowed. The only exception is translating screenshots, details in the documentation section below.

Translation components

What I called "blocks" earlier is called "components" in WebLate terminology. Let's dig deeper into them.

WebUI

As a consequence of the evolution of the Uyuni WebUI and the different technologies used, the strings in the WebUI are split into several WebLate components:

Java

The Java component in WebLate contains the translations for the keys used in java classes, mainly struts actions and related helpers. These keys then will be reflected on the UI pages based on the result of the current action.

Source

XLIFF files are used in Uyuni java codebase. Classes where most of these keys will be used are here

https://github.com/uyuni-project/uyuni/tree/master/java/code/src/com/redhat/rhn/manager

and the XLIFF source file contains a reference to where each string comes from:

https://github.com/uyuni-project/uyuni/blob/master/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml

JSP

The Java-JSP component in WebLate contains the translations for the keys used in JSPs. These keys then will be reflected on the UI pages based on the result of the current action.

Source

JSPs, where these keys are being used:

https://github.com/uyuni-project/uyuni/tree/master/java/code/webapp/WEB-INF/pages

and the XLIFF source file contains a reference to where each string comes from is

https://github.com/uyuni-project/uyuni/tree/master/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml

Nav

The Java Nav component in WebLate contains the translations for the keys used in java classes that build the Navigation menus.

Source

Classes where these keys are being used:

https://github.com/uyuni-project/uyuni/tree/master/java/code/src/com/redhat/rhn/frontend/events

and the XLIFF source file contains a reference to where each string comes from is

https://github.com/uyuni-project/uyuni/tree/master/java/code/src/com/redhat/rhn/frontend/strings/nav/StringResource_en_US.xml

Template

The Java Template component in WebLate contains the translations for the keys used in java classes that are used for backend events and actions.

Source

Classes where these keys are being used:

https://github.com/uyuni-project/uyuni/tree/master/java/code/src/com/redhat/rhn/frontend/events

and the XLIFF source file contains a reference to where each string comes from is

https://github.com/uyuni-project/uyuni/blob/master/java/code/src/com/redhat/rhn/frontend/strings/template/StringResource_en_US.xml

Command-line tools

Backend

The backend component in WebLate contains the translations for the backend tools required by any Uyuni Server: spacewalk-repo-sync, mgr-inter-sync, Oracle ULN authenticator, diskchecker, taskomatic, etc.

Source

Those tools implement i18n using gettext. The source code is here:

https://github.com/uyuni-project/uyuni/blob/master/backend/

and the gettext catalog file contains a reference to where each string comes from:

https://github.com/uyuni-project/uyuni/blob/master/backend/po/spacewalk-backend-server.pot

Uyuni Server daemon

The mgr-daemon component contains the translations for the Server-side of of the traditional client tools.

Source

The source code is here:

https://github.com/uyuni-project/uyuni/tree/master/client/rhel/mgr-daemon

and the gettext catalog file contains a reference to where each string comes from:

https://github.com/uyuni-project/uyuni/blob/master/client/rhel/mgr-daemon/po/rhnsd.pot

Traditional stack client tools

The spacewalk-client-tools component contains the translation for the client-side of the of the traditional client tools.

Source

The source code is here:

https://github.com/uyuni-project/uyuni/tree/master/client/rhel/spacewalk-client-tools

and the gettext catalog file contains a reference to where each string comes from:

https://github.com/uyuni-project/uyuni/blob/master/client/rhel/spacewalk-client-tools/po/rhn-client-tools.pot

Yum plugin for RHN

The yum-rhn-plugin component contains the translations of another piece of the traditional client tools, specific to yum-based distributions (RHEL, CentOS, Oracle Linux 6 and 7), to connect to the RH CDN.

Source

The source code is here:

https://github.com/uyuni-project/uyuni/tree/master/client/rhel/yum-rhn-plugin

and the gettext catalog file contains a reference to where each string comes from:

https://github.com/uyuni-project/uyuni/blob/master/client/rhel/yum-rhn-plugin/po/yum-rhn-plugin.pot

ABRT plugin

The spacewalk-abrt component contains the translatios of the ABRT crash reporter.

Advice: do not translate this unless you are really bored, it will probably be removed soon.

The source code is here:

https://github.com/uyuni-project/uyuni/tree/master/client/tools/spacewalk-abrt

and the gettext catalog file contains a reference to where each string comes from:

https://github.com/uyuni-project/uyuni/blob/master/client/tools/spacewalk-abrt/po/spacewalk-abrt.pot

YaST module

The susemanager component contains the translatios for the YaST module to configure Uyuni after installation.

Source

If you want to check where some string is used, you can find the code where these strings where extracted in the Ruby (.rb) files here:

https://github.com/uyuni-project/uyuni/tree/master/susemanager/yast

and the gettext catalog file contains a reference to where each string comes from:

https://github.com/uyuni-project/uyuni/blob/master/susemanager/po/susemanager.pot

Look for strings enclosed in the usual "_" (underscore) gettext prefix, e. g. susemanager/yast/susemanager_db.rb

Popup.Error(
Builtins.sformat(
_("The password should have at least %1 characters."),
7
)
)

Documentation

You can read the documentation in English in the Uyuni website: https://www.uyuni-project.org/uyuni-docs/uyuni/index.html

Source

The Uyuni documentation is written in AsciiDoc format (source files here).

Since neither WebLate nor any other translation tool supports AsciiDoc natively, we convert it to gettext (.pot/.po), submit it to WebLate and then do the opposite. Translated AsciiDoc is generated at build time, it is not stored in the git repository.

Screenshots

It is important to note all guides contain some screenshots.

At this moment, WebLate cannot manage "translation" of screenshots (i. e. taking a screenshot of the screen in the target language and replacing the screenshot in English), so the only way to provide "translated" screenshots is to create a pull request to the uyuni-docs git repository in GitHub.

This is the only case where translations are allowed outside WebLate.

Limitations

As of this writing, the following parts of Uyuni are not enabled for translation:

Enabling them for translation is rather easy (a matter of adding wrapping the strings for gettext, adding a few lines of boilerplate code and a Makefile target to extract them). Contributions are welcome!

Clone this wiki locally