?
avatar sovainfo
sovainfo
4 Apr 2015

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

avatar sovainfo sovainfo - open - 4 Apr 2015
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 4 Apr 2015
Category Language & Strings
avatar brianteeman
brianteeman - comment - 4 Apr 2015

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.
avatar sovainfo
sovainfo - comment - 4 Apr 2015

Haven't found any use in J341 yet. Maybe new requirements from translators.

avatar brianteeman
brianteeman - comment - 4 Apr 2015

Usually we get objections when we make a lot of changes to language strings
especially when they are not deemed necessary

avatar mbabker
mbabker - comment - 4 Apr 2015

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).

avatar sovainfo
sovainfo - comment - 4 Apr 2015

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.

avatar sovainfo sovainfo - change - 4 Apr 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-04-04 20:34:36
avatar sovainfo sovainfo - close - 4 Apr 2015
avatar sovainfo sovainfo - close - 4 Apr 2015
avatar infograf768
infograf768 - comment - 7 Apr 2015

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.

avatar sovainfo
sovainfo - comment - 7 Apr 2015

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

avatar brianteeman
brianteeman - comment - 7 Apr 2015

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/

avatar sovainfo
sovainfo - comment - 7 Apr 2015

Obviously those tools would need to be adjusted depending on how you document them.
Suggestions:

  • Free format on the same line append: "// #1=file, #2=folder"
  • On the same line: 'Parameters="file,folder"'
  • Any tekst on the same line: 'folder, file'

Introduce named parameters instead of numbered.

avatar mbabker
mbabker - comment - 7 Apr 2015

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.

Add a Comment

Login with GitHub to post a comment