Enhancement #925
help translators: remove spaces from strings
| Status: | Closed | Start: | 05/28/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | % 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
- Assigned to set to Nikolaus Filus
- Target version set to Centreon-2.1
Updated by Sylvestre Ho 406 days ago
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
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.
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 Nikolaus Filus 402 days ago
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 392 days ago
- 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
- Status changed from New to Solved
- % Done changed from 0 to 100
Applied in changeset r8559.