Skip to content

Ugly fix for percent character issues on gettext and go-text

Leandro Santiago requested to merge fix/179_fix_percent_on_translations into master

Note to the reviewer: this implementation is far from optimal, so in case the required suggestions are too large to be quickly fixed, I suggest we moving this MR to the next milestone where we can fix it properly.

This MR frees us from the need to escape the character percent (%) in the gettext (.po) files when they are meant to be used as usual placeholder for translated strings.

The rationale for such change is to make the translatable strings regular for the translation team (via weblate or any other tool), by following the same convention of other projects, where, for instance %s, with a single percent, is used as a formatting placeholder, instead of %%s, with duplicated percent.

Ref #179 (closed)

Please also have a look at #245

Test Plan

  • Build the application
  • Configure it to send slack notifications to German
  • Generate some insight (an easy one is to configure the IP address, forcing a RBL insight to be generated after a couple of minutes), or restart the application in dev mode, getting some sample insights.
  • Change the browser language to German.

Expectations:

  • the slack notifications should be in german. Notice that not all strings are translated, so some of them will be in English
  • the UI interface will be in German.
Edited by Leandro Santiago

Merge request reports