On Wed, 14 Oct 2015, Martin Sebor wrote: > On 10/14/2015 01:40 PM, Joseph Myers wrote: > > On Wed, 14 Oct 2015, Martin Sebor wrote: > > > > > IMO, printing the aliased option's help text makes using the output > > > easier for users who find the undocumented option first, in that > > > they don't then have to go look for the one that does have > > > documentation, so I left that part in place. If you or someone > > > feels strongly that it shouldn't be there I'll remove it. > > > > Well, I think it might also encourage people to use the aliases, when for > > the most part we'd rather people used the canonical names (and so made it > > easier e.g. to search for other uses of the same option). > > This seems like a sensible argument. I think we're more likely > to achieve this goal if we're explicit about it than if we just > make it difficult for users to find what they're looking for. > To that end, the attached patch replaces the help text with > a suggestion to use the aliased option instead. For example, > for the --assert option, it prints: > > --assert Same as -A. Use the latter option instead.
The code isn't using _() around use_other_msg, meaning translations wouldn't be used. I think it would be more helpful for translators if you just put "Same as %s. Use the latter option instead." in a single string, surrounded by _(), to give them the maximum context for translation. I'm concerned about whether the code relating to adding '.' is genuinely universal to all languages. I think it would be better to make the English messages in the .opt files consistent regarding English punctuation, and let translators determine what punctuation to use consistently in their translations, rather than forcing '.'. <https://en.wikipedia.org/wiki/Full_stop#Full_stops_in_other_scripts> lists a range of other punctuation marks used in some languages for this purpose. This in turn implies adding '.' for documented options with aliases is also problematic. Most simply, avoid having documentation for aliases in .opt files and handle all aliases the same whether or not such documentation is there. Otherwise, a detailed comment for translators would be needed on the line above _("%s Same as %s.") to explain what each %s is and that translators should include appropriate punctuation in translations of this message if not in translations of option help texts. > I also added text indicating when using an option is diagnosed. > This results in, for example: > > -falt-external-templates No longer supported. Uses of this > option are diagnosed. Again, you need to avoid inserting '.'; ensure that translators have the information needed to insert their own punctuation if needed; and ensure that use_diagnosed_msg does actually get translated (i.e. surrounded by _(), or included directly in a so-surrounded string), not just extracted to the .pot file. -- Joseph S. Myers jos...@codesourcery.com