Re: RFC: Translating Wine's dialogs with PO files

2011-09-12 Thread Michael Stefaniuc
Hello Francois,

before I start: my comment below in no way implies that option 4 is the
way to go.

On 09/12/2011 07:28 PM, Francois Gouget wrote:
 Option 4 - Put the sizes in special PO files
 
 
 This would really be a very ugly hack.
 Like option 2 it requires that every control of a given dialog have a 
 unique id. Then for each of them we would create PO file entries of 
 the form:
 
msgctxt rc-filename:dialog-id:control-id
msgid x:y:width:height
msgstr 
You wouldn't need a special PO file. You could put that info into a
comment of the respective entry to translate using the #. comment.
http://www.gnu.org/s/hello/manual/gettext/PO-Files.html says:
Comment lines starting with #. contain comments given by the
programmer, directed at the translator; these comments are called
extracted comments because the xgettext program extracts them from the
program's source code.

This would avoid separate files, unique IDs for all the entries and
would be visible to the translator.

bye
michael

 We then put all these 'messages' in a sizes-lang.po file. Whenever a 
 control needs to be resized a 'translation' would be provided in the 
 relevant sizes-lang.po file.
 
 We would only keep the English RC file and when compiling the resources 
 for a given language wrc would check whether the sizes-lang.po file 
 contains a translation of the size data for the current control.
 
 Pros:
  * Maybe the easiest solution to put in place.
 
 Cons:
  * Totally ugly.
 
  * Probably awful to work with to change the layout of a dialog.
 
  * All the drawbacks of Option 2.




Re: RFC: Translating Wine's dialogs with PO files

2011-09-12 Thread Alexandre Julliard
Francois Gouget fgou...@free.fr writes:

 This is the next step in making full use of the PO files for translating 
 Wine. But how to get there is unclear, hence this RFC.

 The issue with dialogs is that in RC files all the dialog and control 
 sizes are hardcoded. For instance in the line below '208, 6, 56, 14' 
 represent the x-left, y-top, width and height of the button:

DEFPUSHBUTTON Save As, IDOK, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP 
 | WS_TABSTOP

 The problem is that once translated to French, for instance, the label 
 becomes 'Enregistrer sous' which is much longer and may require 
 enlarging the button. But RC files do not contain the information needed 
 to do that automatically. For instance they don't specify enlarging this 
 button requires enlarging the 'Cancel' and 'Help' buttons below too.

 So how do we solve this problem?

There's another option: design the dialogs with enough spare room that
most languages would fit, and maintain language-specific RC files for
the special cases that really can't be accommodated. Ideally, a tool
would be written to warn about a translation overflowing the available
space, so that it can be looked into. Not very satisfying, but a lot
simpler than the other options...

-- 
Alexandre Julliard
julli...@winehq.org




Re: RFC: Translating Wine's dialogs with PO files

2011-09-12 Thread Francois Gouget
On Mon, 12 Sep 2011, Michael Stefaniuc wrote:
[...]
  Like option 2 it requires that every control of a given dialog have a 
  unique id. Then for each of them we would create PO file entries of 
  the form:
  
 msgctxt rc-filename:dialog-id:control-id
 msgid x:y:width:height
 msgstr 
 You wouldn't need a special PO file. You could put that info into a
 comment of the respective entry to translate using the #. comment.
[...]
 This would avoid separate files, unique IDs for all the entries and
 would be visible to the translator.

This would be pretty tricky for a button like 'OK' which appears in a 
great many dialogs, each time in a different position. Also even if it 
is in the same position in two English dialogs, once translated it may 
need to be in different positions (due to other controls being resized). 
So that brings back the need for uniquely identifying a given control.


-- 
Francois Gouget fgou...@free.fr  http://fgouget.free.fr/
  Computers are like airconditioners
They stop working properly if you open WINDOWS




Re: RFC: Translating Wine's dialogs with PO files

2011-09-12 Thread Michael Stefaniuc
On 09/12/2011 08:14 PM, Alexandre Julliard wrote:
 Francois Gouget fgou...@free.fr writes:
 
 This is the next step in making full use of the PO files for translating 
 Wine. But how to get there is unclear, hence this RFC.

 The issue with dialogs is that in RC files all the dialog and control 
 sizes are hardcoded. For instance in the line below '208, 6, 56, 14' 
 represent the x-left, y-top, width and height of the button:

DEFPUSHBUTTON Save As, IDOK, 208, 6, 56, 14, BS_DEFPUSHBUTTON | 
 WS_GROUP | WS_TABSTOP

 The problem is that once translated to French, for instance, the label 
 becomes 'Enregistrer sous' which is much longer and may require 
 enlarging the button. But RC files do not contain the information needed 
 to do that automatically. For instance they don't specify enlarging this 
 button requires enlarging the 'Cancel' and 'Help' buttons below too.

 So how do we solve this problem?
 
 There's another option: design the dialogs with enough spare room that
So we need somebody that can design dialogs. From the scope it is a
similar job to the icon modernization/standardization done by Joel.
Which isn't a bad thing as our dialogs have a pretty inconsistent look
and feel.

 most languages would fit, and maintain language-specific RC files for
 the special cases that really can't be accommodated. Ideally, a tool
 would be written to warn about a translation overflowing the available
IMHO we need this tool first to ease the work of the person cleaning up
the dialogs; we don't want him/her to run away screaming after the first
few dialogs.

 space, so that it can be looked into. Not very satisfying, but a lot
 simpler than the other options...
And has the buy in of the Wine maintainer... SHIP IT! ;)

bye
michael