Language strings having multiple parameters require sequence numbers so translations can reorder the arguments. Thanks @infograf768
Currently in J341 there are 156 language strings with multiple parameters without sequence numbers.
administrator: 49
installation: 49
site: 58
Labels |
Added:
?
|
Category | ⇒ | Language & Strings |
Haven't found any use in J341 yet. Maybe new requirements from translators.
Usually we get objections when we make a lot of changes to language strings
especially when they are not deemed necessary
I don't think it's a hard requirement but it does improve flexibility. The
strings are basically run through sprintf so specifying an order ensures
the first var gets to %1s. In reality this shouldn't be a change that
affects translators; if they need sprintf injected vars in a specific order
they should already be doing so.
On Saturday, April 4, 2015, Brian Teeman notifications@github.com wrote:
Usually we get objections when we make a lot of changes to language strings
especially when they are not deemed necessary—
Reply to this email directly or view it on GitHub
#6657 (comment).
Given that, it should only be used in other languages or when required in en-GB. Can't think of a reason to use it, other than in translation.
Guess, this should be closed.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-04-04 20:34:36 |
In reality this shouldn't be a change that affects translators; if they need sprintf injected vars in a specific order they should already be doing so.
It makes it harder for the translators when the order has to be set a specific way if it is not set in the English reference strings. Basically, it forces them to look into the code to figure which variable is which (when they know how to...).
Instead of refactoring all existing strings, I suggest that any new string with multiple variables use the order in en-GB also.
Don't see how seq# is going to help with that. E.g.
COM_FINDER_INDEX_DATE_INFO="Link Date Information::Published Start: %s
Published End: %s
Content Start: %s
Content End: %s"
Providing an override for this:
COM_CONTENTHISTORY_COMPARE_VALUE1="Saved on %s %s"
Same procedure, problem is that the parameters are not clear. Adding seq# is not going to help here. You would still need to find the code to figure out the meaning of the arguments. Documenting it is the only thing going to help here. Changing the message to make the arguments obvious is not always acceptable. Surprise, surprise: COM_CONTENTHISTORY_COMPARE_VALUE2="Saved on %s %s"
So, i suggest to document them and only add seq# when not in order of the list
How would you document them? All the translation tools just show the string
to be translated
On 7 April 2015 at 19:03, sovainfo notifications@github.com wrote:
Don't see how seq# is going to help with that. E.g.
COM_FINDER_INDEX_DATE_INFO="Link Date Information::Published Start: %s
Published End: %s
Content Start: %s
Content End: %s"
Providing an override for this:
- put in seq#
- reorder text
- reword text COM_CONTENTHISTORY_COMPARE_VALUE1="Saved on %s %s" Same procedure, problem is that the parameters are not clear. Adding seq# is not going to help here. You would still need to find the code to figure out the meaning of the arguments. Documenting it is the only thing going to help here. Changing the message to make the arguments obvious is not always acceptable. Surprise, surprise: COM_CONTENTHISTORY_COMPARE_VALUE2="Saved on %s %s"
So, i suggest to document them and only add seq# when not in order of the
list—
Reply to this email directly or view it on GitHub
#6657 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
I think named parameters would be nicer, I just don't know if you could fit it into the existing JText sprintf and plural methods without a major B/C break (right now they effectively translate the base string and run the result through PHP's sprintf function). FWIW, Symfony's translator supports named parameters and the base translator does this through PHP's strtr function.
Strange that this has never been asked for before
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6657.