I18nHelper getText('upm.messages.install.licensing.followup.try', 'text') does not work

I am using I18nHelper and want to translate text ‘upm.messages.install.licensing.followup.try’, which contains a parameter.

The i18n text in english is
'{0}' is installed, but not licensed. Get a license from MyAtlassian so you can use this add-on

So I am using getText('upm.messages.install.licensing.followup.try', 'text') in order to get 'test' is installed, but not licensed. Get a license from MyAtlassian so you can use this add-on

But this is not working. I am not able to replace {0} with my string parameter.

Looks like there is a special problem with this text ‘upm.messages.install.licensing.followup.try’. It works perfectly fine with other labels, who have {0} parameters.

Any ideas?

https://translations.atlassian.com/dashboard/originalMessage/88999?lang=en_US

Hi Holger,

Looks like a bug. Single quotes should be double escaped (as per http://docs.oracle.com/javase/7/docs/api/java/text/MessageFormat.html)
As the string currently stands, it should currently be displaying as " ‘{0}’ is installed … " so the {0} isnt being replaced at all, rather than " ‘test’ is installed " as is expected.

The way to fix this is to change the i18n text to

‘’{0}’’ is installed, but not licensed. Get a license from MyAtlassian so you can use this add-on

I’ve raised a ticket to fix https://ecosystem.atlassian.net/browse/UPM-5679 , which you can follow to be notified when the change should be available.

Thanks

1 Like

That this is a bug scares me, because that translation text is there for years. And also the same in other languages e.g. German https://translations.atlassian.com/dashboard/originalMessage/88999?lang=de_DE