• 16 Oct 2019
  • TYPO3
  • Alexander Bohndorf

TYPO3 Extension translatelabels

With this extension, editors can translate labels in Frontend themselves in conjunction with the admin panel.

We have just released the extension sitegeist/translatelabels on github.

Forms created using the form editor with the Form Framework from TYPO3 can also be fully translated in this way. Starting with the labels, placeholders, descriptions, error messages, etc.

With the "Translate Labels" module activated in the admin panel, labels are underlined. A tooltip appears on mouseover and shows the name of the label. If you click on the name of the label, a table opens in the admin panel in which the selected label is highlighted and you can edit the translation directly inline.

Enhanced Frontend with underlined labels and tooltips that display the name of the label

The admin panel has been expanded to include a module in which all labels contained on the current page are displayed in a table:

Display of labels in the new "Translate Labels" module in the Admin Panel

The translations can be edited directly inline in this tabular view. All you need to do is click on the label text and write the translation.

If you prefer the "classic" way, use the edit buttons on the right and go directly to the editing screen of the translation data record in a new browser tab at TYPO3 Backend .

Developers often ask themselves: Where does this text come from? They quickly search through all the files in the project and if they don't find what they are looking for, they assume that the label is probably hidden in the editorial content after all.

Or is it not? Is it perhaps in a language file after all? And was the file perhaps overloaded by an extension? Or worse still, by several extensions? Which one wins? Or was the label set with Typoscript?

The second tab "Language Files" provides an answer to these questions:

"Language Files" tab of the translation module in the admin panel

In this table, you can see all sources and their overloads in the "Overrides" column, whereby the last one has the highest priority and is therefore responsible for the translation displayed on the page.

This makes work much easier for developers: simply check and immediately adapt the translation in the correct language file.

Under the hood, the extension works with translation data records that are created within a sysfolder in Backend. These can also be maintained as normal directly in Backend.

The translate view helpers are overloaded and also look in the database. If there is a data record with a matching key, the translation from this data record is used.

The form framework uses its own view helpers for translations. The extension also offers an overloaded version for these.

Last but not least, old pi_base plugins can also be translated with it. However, as these generally do not use Fluid, they must be overloaded using xclass. The extension contains an example for the felogin plugin, which unfortunately has not yet been converted to fluid in the current version 9.5.9. This example can be used as a template for all other pi_base plugins.

We developed the extension to speed up collaboration between the customer, translation agency and agency for projects with a large number of languages and plugins. Before the extension, there were often beautiful Excel tables, Word documents, etc., which ideally contained 80% of the required translations for an area of the page. The missing 20% then cost another 80% in effort and time..

Now our customers can enter a large proportion of the translations themselves during the development phase or have this done by a translation agency with its own editor access.

We already have exciting enhancements planned for future versions:

  • Currently, the text is taken from the default language when you create a new translation data record for a label. Here we will build a language provider that fetches the text in the desired language from a translation service provider on the fly via API, e.g. from LanguageWire, Google Translate or DeepL.
  • In addition, we will develop a mechanism with which the translations created in the data records can be automatically converted into language files, so that the translations are then available in files and can be included in the versioning process. Speaking of versioning: As the translations are now available as data records, versioning of the changes in TYPO3 Backend is also included.

The extension sitegeist/translatelabels is currently only available on github, but we will also make it available in TER in the next few days.

It can be installed quickly with composer and the README contains everything you need to know about the configuration.

Bash

We hope you enjoy the extension and look forward to your feedback!

Alexander Bohndorf

Alexander Bohndorf