> On 28 Mar 2018, at 17:04, Christophe Fergeau <cferg...@redhat.com> wrote:
> 
> On Wed, Mar 28, 2018 at 02:44:56PM +0200, Christophe de Dinechin wrote:
>> In my proposal, that message is built in format_message with something like:
>> 
>>      int written = snprintf(buffer, size, "%s writing %s for file ‘%s'", 
>> what(), operation, filename.c_str());
>>      return append_strerror(buffer, size, written); 
>> 
>> It would be better to instead generate “L’écriture du format a été
>> interrompue pour le fichier ‘Hello.txt’”; which involves word
>> reordering and grammatical pairing (e.g. contractions, male/female,
>> etc). In order to do that, you can take a more subtle approach where
>> instead of translating pieces individually, you translate the complete
>> message, but still carefully ignore the parts that you know are
>> variable. So you could do instead:
>> 
>>      snprintf(translated, sizeof(translated), “%s writing %s for file 
>> ‘%%s’”, what(), operation);
>>      int written = snprintf(buffer, size, _(translated), filename.c_str());
>>      return append_strerror(buffer, size, written); 
>> 
>> In that case, obviously, you need to provide more translations:
>> - “write failed writing header for file ‘%s'” -> “l’écriture de l’en-tête du 
>> fichier ‘%s’ a échoué"
>> - “write failed writing frame for file ‘%s'” -> “l’écriture d’une image du 
>> fichier ‘%s' a échoué"
>> - “write interrupted writing frame for file ‘%s'” -> “l’écriture d’une image 
>> du fichier ‘%s’ a été interrompue”
>> … etc
>> 
>> What matters, however, is that you still have a finite number of
>> combinations, because you have a finite number of input strings.
> 
> The part I'm missing is how you extract this limited number of full
> strings that we'll need to translate into a po file (or equivalent). Is
> there a tool which will generate that list of strings from %s writing
> %s for file ... and the static strings which are passed as %s arguments to
> snprintf?

Would the answer to this question have any chance of tilting the balance back 
towards changing the type of ‘message’ to std::string in the Error class? If 
not, why are you even asking?

That being said, if you ask me if I believe that our code is presently in an 
“easily translatable” state, no, it is not. If you ask me if my patch is fixing 
that, it is not, and was never advertised as doing so. However, I’d argue that 
it moves the cursor from “impossible to translate” to either “tedious to 
translate” or “easy to translate with poor translations”.

Discussing whether we even need to make it “easy to translate with high quality 
translations” is an entirely separate conversation.


> 
> 
>>>>    WriteError(“can’t write header” + filename)
>>>> 
>>>> it suddenly becomes impossible to do localization?
>>> 
>>> so WriteError("can't write header" + filename) is actually *better* from
>>> a translation point of view, as you'd mark "can't write header" for
>>> translation and be done with it.
>> 
>> This would not work in German, where you’d want to have the file name 
>> somewhere in the middle, as in “Beim Schreiben der Kopfzeile für die Datei 
>> ‘Hello.txt' ist ein Fehler aufgetreten”…
> 
> My bad, I read your example too quickly and assumed you wrote
> "can't write header: " + filename, in other words that the filename was
> totally separate from the sentence. I was indeed not suggesting you can
> create a valid sentence by appending it to the end...
> This is easily worked around with a snprintf, or with boost::format
> though if we wanted to do the localization there..
> 
>> and your “better” argument, which was already slashed in microscopic
>> fragments by the German counter example, becomes all the more
>> difficult to reassemble.
> 
> This is not really helping the conversation to move smoothly…

That is helping me :-) And “move smoothly” this conversation most certainly 
does not.

> 
>> Christophe Christophe Christophe Christophe (since I have to repeat myself 
>> quite a lot, I thought I’d do it in the signature too ;-)
> 
> I'm fine with a link to the mailing list archives when I'm asking
> questions about something you've already explained, but which I missed..

Ah, you forgot that you raised this specific objection on IRC? Well, no link to 
IRC, sorry.

> 
> Christophe
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to