Enhancement #925

avatar

help translators: remove spaces from strings

Added by Nikolaus Filus 427 days ago. Updated 312 days ago.

Status:Closed Start:05/28/2009
Priority:Normal Due date:
Assigned to:avatarNikolaus Filus % Done:

100%

Category:CentWeb
Target version:Centreon-2.2
Resolution:


Description

There are several strings defined as:
_(" string to translate ")
which is bad style. Especially as spaces are hard to track in some editors like poedit
and some of the strings are doubled by defining another instance without spaces.
Most current example: r8248

BTW: there is no bug category "translation"

History

Updated by Julien Mathis 407 days ago

avatar
  • Assigned to set to Nikolaus Filus
  • Target version set to Centreon-2.1

Updated by Sylvestre Ho 406 days ago

avatar

I couldn't agree more.

Strings such as _(" Hosts ") should be replaced by " " . _("Hosts") . " "

By the way, what do you suggest for strings like this ?
_("The host") . " " . $hostName . " " . _("does not exist");

Translators will have 2 different strings "The Host" and "does not exist" which make no sense at all. As one of our translators, I believe you have faced this issue?

_("The host $hostName does not exist") might work though, I haven't tried yet.

Updated by Nikolaus Filus 406 days ago

avatar

Thanks for the common sense, but ...
at first I also started to use concatenation with " "._()." " but although this works it is ugly. This mixes code and layout.
It's much cleaner to put the spaces (or  ) into the template.

Regarding the latter one, on many forums the trick with
echo sprintf(_("%s test"),$variable);

was suggested and should work. With the variables %2$s and %1$s it should be also possible to change the order of arguments (see http://www.onlamp.com/pub/a/php/2002/11/28/php_i18n.html).

Updated by Julien Mathis 402 days ago

avatar

Is it ok ? Can we close this bug ?

thanks,

Updated by Nikolaus Filus 402 days ago

avatar

Please regenerate all translation files, so translators like me can start looking into the new/changed strings.
I would prefer to keep this open as long as translations are not redone.

Updated by Julien Mathis 402 days ago

avatar

done :)

Updated by Julien Mathis 392 days ago

avatar
  • Target version changed from Centreon-2.1 to Centreon-2.2

too much work for centreon 2.1... sorry it will be available in 2.2...

Updated by Nikolaus Filus 391 days ago

avatar
  • Status changed from New to Solved
  • % Done changed from 0 to 100

Applied in changeset r8559.

Updated by Nikolaus Filus 312 days ago

avatar
  • Status changed from Solved to Closed

Also available in: Atom PDF