On lundi 18 septembre 2017 13 h 20 min 25 s CEST Martin Sebor wrote: > On 09/18/2017 12:26 PM, Steve Ellcey wrote: > > This patch is for PR target/79868, where some aarch64 diagnostics are > > said to be not translatable due to how they are implemented. See the > > bug report for more details on why the current setup of passing > > the string 'pragma' or 'attribute' doesn't work. > > > > This patch fixes it, unfortunately by increasing the number of calls we > > have to 'error' (16 calls become 32 calls), but that seems to be the > > most straight forward way to get translatable strings. > > I haven't looked at all of them but from the few I have seen it > seems that rephrasing the messages along the following lines would > be a way to get around the translation issue and without increasing > the number of calls (though not without the conditional): > > error (is_pragma > ? G_("missing name in %<#pragma target\(\"%s=\")%>") > : G_("missing name in %<target(\"%s=\")%> attribute"), > "arch"); > > The additional benefit of this approach is that it would also make > the quoting consistent with what seems to be the prevailing style > of these sorts of messages. (It would be nice to eventually > converge on the same style/quoting and phrasing across all back > and front ends.)
Indeed! That's even better as the message uses words the user sees in the source code whatever his/her locale language is. With your proposal, I know I must not translate "target" because it clearly is part of the programming language. With the former message, I would have translated "target" as part of the human language message. Your approach is clearly better. Frederic