[PUP-8122] I18n strings that include repeated lists of sentence fragments can be hard to translate Created: 2017/11/02  Updated: 2018/02/05  Resolved: 2018/01/08

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 5.3.4, PUP 5.4.0

Type: Bug Priority: Normal
Reporter: Eric Delaney Assignee: Eric Delaney
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PUP-8092 Concatenated strings causing breakage... Closed
Template: PUP Bug Template
Epic Link: Agent i18n/l10n testing
Sub-team: Coremunity
Team: Platform Core
Sprint: Platform Core KANBAN
Method Found: Inspection
Release Notes: Not Needed
QA Risk Assessment: No Action

 Description   

We need to review the PO file and source code of puppet looking for strings where we build up a list of things where we include sentence fragment in the repeated list and determine if this should be change to allow for better translations

For example the below code includes a sentence fragment "which depends on" which will be hard to translate into Japanese, We should create a list of cases, review them and determine which ones we want to change string in.

lib/puppet/module_tool/errors/shared.rb

_("    which depends on '%{name}' (%{version})") % { name: m[:name], version: v(m[:version]) }

      dependency_list = @source[1..-1].map do |m|
        #TRANSLATORS This message repeats as separate lines as a list under the heading "You specified '%{name}' (%{version})\n"
        _("    which depends on '%{name}' (%{version})") % { name: m[:name], version: v(m[:version]) }
      end.join(",\n")
 
      msg_variables = { requested_module: @requested_module, version: v(@requested_version), module_name: @module_name,
                        name: @source.first[:name], dependency_list: dependency_list }
      _(<<-EOM).chomp % msg_variables
Could not install module '%{requested_module}' (%{version})
  No version of '%{module_name}' will satisfy dependencies
    You specified '%{name}' (%{version})
%{dependency_list}
    Use `puppet module install --force` to install this module anyway
      EOM

We should look to update the repeated list text to be (and remove the TRANSLATOR comment)

        _("    This depends on '%{name}' (%{version})") % { name: m[:name], version: v(m[:version]) }



 Comments   
Comment by Eric Delaney [ 2017/11/06 ]

Larissa Lane The description lists the cases I could find where we build a list of something and want to include it in the output. The one line code example above each code section is the line that is repeats to make up the list.

Comment by Larissa Lane [ 2017/12/17 ]

If each line in the list forms a full sentence and is externalized by itself, this should be okay. The only fragment of a sentence I can see in the examples is "which depends on ..." We could fix this by changing it to "This depends on ..." or "'%

{name}

' (%

{version}

) depends on ..." so that it is a complete sentence.

I'm not sure if I'm fully understanding the problem you want to highlight though.

Comment by Larissa Lane [ 2017/12/19 ]

Great, thanks Eric Delaney

Comment by Jacob Helwig [ 2018/01/03 ]

Merged into 5.3.x in e97a37d6.

Generated at Thu Feb 27 00:32:37 PST 2020 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.