W dniu 05.10.2016 o 19:20, Vasco Almeida pisze: > Mark messages in some perl scripts for translation. > > Thanks for the reviews of Junio Hamano and Jakub Narębski. Although I think > Jakub Narębski's suggestions are overall good, I am not willing to go that > path > because I cannot see huge benefits from them given what we already have and > also I lack Perl skills.
All right. While I think that Locale::TextDomain-like interpolation in translated strings (__x, __xn / __nx, etc.), which is labelled as 'perl-brace-format' by gettext, is more Perl-ish and better for unbiased translators, the printf based interpolation, labelled as ‘perl-format’ (and identical to 'c-format', I think), may be preferred in this case. The 'perl-brace-format' doesn't need TRANSLATOR comments to explain what placeholders are, and placeholders are easier to reorder. On the other hand translator needs to know to not translate contents of placeholders. "This is the {color} {thing}.\n" With 'perl-format' / 'c-format' the translator might need to know how to change order of placeholders, but he or she should know how to do it translating strings from C code. "This is the %s %s.\n" Also, if Perl code shares translation strings with C code, as in most cases here, then printf format is needed to do translation only once. tldr; I am reversing my opinion, and agree with your solution. > > Interdiff bellow. One thing I have noticed in the interdiff is using *translated* strings in hash content (translation takes time, and might not be necessary), that is: $hashref = { KEY => __('value'), } ... $hashref->{KEY} ... instead of marking value for translation, and doing translation only on print, when it is necessary $hashref = { KEY => N__('value'), } ... __($hashref->{KEY}) ... > > Vasco Almeida (14): [...] I'll try to review those later. Thank you for your work, -- Jakub Narębski