Description of problem:
Some panel titles are a single character or truncated to a single character of the second letter in the title
Images is rendering as 'm'
Load Balancers is rendering as 'o'
Trunks is rendering as 'r'
Version-Release number of selected component (if applicable):
*** Bug 1746007 has been marked as a duplicate of this bug. ***
*** Bug 1768316 has been marked as a duplicate of this bug. ***
Are there any updates on this? Our clients are complaining about funny looking tabs.
The problem is that the code uses ngettext to get the translation, but the translations only include the singular form:
Adding translations for the plurals fixes this issue:
Of course manually adding the translations is not practical, we need to modify the code to make the translation templates correctly.
The problem is quite tricky and is only visible sometimes, but I think I have figured it out. The culprit is in this code: https://github.com/openstack/horizon/blob/3aa3cc934bf77fd656c53f160125ffa69b1e9b81/horizon/static/framework/conf/resource-type-registry.service.js#L397-L433
As you can see, the function getName() uses ngettext() to translate and return the correct singular or plural name for the given resource. There are several problems with it, however:
* it is being called with already translated strings for singular and plural, which means that most of the time it will not find a translation, and fall back to using those translated strings directly — which is fine as long as your language has only one plural form, like English does, but will break horribly in other languages, producing gibberish
* in the rare case where the translation is the same as the translated string, it will find the translation. However, since those strings have been marked for translation using gettext and not ngettext, they will have two separate translations for singular and for plural, instead of a single translation with singular and plural forms
* ngettext expects a list of translations for the different plural forms, but because the string has been marked for translation with gettext and not ngettext, that translation will be a single string instead. The way ngettext is implemented, it will still try to treat that string as a list of translations, and take the second character from it.
I am working on a fix for this, but it involves changing how setNames() is called everywhere.