25. Internationale ILIAS-Konferenz

Feature Wiki

Information about planned and released features

Tabs

PO-Files for improving language handling

1 Initial Problem

The language handling mechanism relies on a very outdated scheme. Modern approaches now exist to make the language service more future-proof and maintainable.

2 Conceptual Summary

PO files, implemented using the `gettext()` function, are to be introduced for the new language handling scheme.

This scheme also makes it easy to implement language variants — such as British English and American English or an easy language version of an existing language.  etc. In general, it allows for the creation and setup of any new language.

Example:

# ----------------------------
# Variante A (mit msgctxt)
# ----------------------------
# legacy: mail#:#unread_messages#:#Du hast %d ungelesene Nachricht(en)
msgctxt "mail"
msgid "unread_messages"
msgid_plural "unread_messages_plural"
msgstr[0] "Du hast %d ungelesene Nachricht"
msgstr[1] "Du hast %d ungelesene Nachrichten"
# ----------------------------
# Variante B (ohne msgctxt, msgid = modul.identifier)
# ----------------------------
# legacy: mail#:#unread_messages#:#Du hast %d ungelesene Nachricht(en)
msgid "mail.unread_messages"
msgid_plural "mail.unread_messages_plural"
msgstr[0] "Du hast %d ungelesene Nachricht"
msgstr[1] "Du hast %d ungelesene Nachrichten"

The ILIAS GUI for editing language variables remains available.

3 User Interface Modifications

3.1 List of Affected Views

No views affected.

3.2 User Interface Details

No UI changes required.

3.3 New User Interface Concepts

No new UI concepts available.

3.4 Accessibility Implications

No changes regarding accessibility.

4 Additional Information

4.1 Involved Authorities

4.2 Technical Aspects

The following are brief explanations of the terms gettext, POT file, PO file and MO file:

  • The gettext functions implement an NLS (Native Language Support) API that can be used to internationalize PHP applications.
  • POT file (.pot): Stands for Portable Object Template. It is the blank master template. A program scans the source code for text strings and collects them in this file. It contains the original text but no translations yet.
  • PO file (.po): Stands for Portable Object. It is created by copying and filling out the POT file for a specific language. It is a simple text file containing pairs of original text (msgid) and translation (msgstr). It is easy for humans to read and edit.
  • MO file (.mo): Stands for Machine Object. It is the binary version of the PO file. The finished program reads this file because computers can process binary data much faster than plain text.

As a result, the `txt()` function must be replaced by `gettext()` in every component, or this must be handled within the Language component.

4.3 Privacy

No changes.

4.4 Security

The following security aspect must be taken into account:

  • No scripts may be integrated via the GUI.

4.5 Contact

Person to be contacted in case of questions about the feature or for funding offers:  Auerbach, Jeanine [jeanine.auerbach]

4.6 Funding

Funding status and funding parties are listed in the block 'Status of Feature' in the right column of this page.

If you are interested to give funding for this feature, please get into contact with the person mentioned above as 'Contact'.

5 Discussion

6 Implementation

Feature has been implemented by {Please add related profile link of this person}

6.1 Description and Screenshots

{ Description of the final implementation and screenshots if possible. }

6.2 Test Cases

Test cases completed at {date} by {user}

  • {Test case number linked to Testrail} : {test case title}

6.3 Privacy

Information in privacy.md of component: updated at {date} by {user} | no change required

6.4 Approval

Approved at {date} by {user}.

Last edited: 28. Jul 2026, 14:24, Kunkel, Matthias [mkunkel]