Re: Right-To-Left (RTL) languages and Wine
Shachar Shemesh shac...@shemesh.biz writes: On 29/09/10 21:59, James Mckenzie wrote: And Microsoft Office appears different in RTL rather than LTR. I used to work with someone that had the Arabic version of these programs and it would switch from RTL when typing in Arabic to LTR when typing in a Latin-based language. I'm sorry, but you are confusing several issues here. The question is not whether to implement BiDi (yes, provided we find the working hands to do it) or mirroring (yes, except I don't think we need to bother with mirroring the window decoration UI components that Windows does, and I have not heard anyone else weight in on this issue lately). Mirroring is essentially implemented now, modulo some remaining bugs. And yes, the window decorations get mirrored too, it would actually be harder to not do it. -- Alexandre Julliard julli...@winehq.org
Re: Right-To-Left (RTL) languages and Wine
On 24/09/10 23:00, Alexandre Julliard wrote: Paul Vrienspaul.vriens.w...@gmail.com writes: I see you made great steps in getting the RTL stuff working. The Hebrew version of native winmine shows the menu's right-aligned now! What are the plans/ideas for the Wine builtin programs with respect to RTL languages? I mean, how are we going to make the distinction between LTR or RTL when builtin apps are run? The apps that are ready for it will have to call SetProcessDefaultLayout when appropriate. I don't think we want to use the version resource for this, the mechanism is badly designed and would be painful to use. If I might recommend something, I suggest not to use SetProcessDefaultLayout at all. Just localize whatever needs localization through the resources and that's it. Even for menus, the resources have an option to define the menus as RTL. The automatic mirroring process is, simply put, a broken idea, badly implemented (I'm talking about Windows here, not Wine). I'm not even sure that the Windows built-in applications use this hack, but even if some do, that is no reason to go down that path. Just my 2cents Shachar -- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com
Re: Right-To-Left (RTL) languages and Wine
Shachar Shemesh shac...@shemesh.biz writes: If I might recommend something, I suggest not to use SetProcessDefaultLayout at all. Just localize whatever needs localization through the resources and that's it. Even for menus, the resources have an option to define the menus as RTL. Most applications are not dialogs, so you can't mirror the application window through resources. For instance with notepad, you'd most likely want the edit control to be RTL too, not just the main menu. -- Alexandre Julliard julli...@winehq.org
Re: Right-To-Left (RTL) languages and Wine
On 29/09/10 18:21, Alexandre Julliard wrote: Shachar Shemeshshac...@shemesh.biz writes: If I might recommend something, I suggest not to use SetProcessDefaultLayout at all. Just localize whatever needs localization through the resources and that's it. Even for menus, the resources have an option to define the menus as RTL. Most applications are not dialogs, so you can't mirror the application window through resources. For instance with notepad, you'd most likely want the edit control to be RTL too, not just the main menu. Did I mention that the automatic mirroring is a broken idea implemented in a broken way already? At the moment, the edit control does not even properly support BiDi. I do not have a Hebrew localized version of Windows on hand, so it's a bit hard for me to check how that works, but even if we had a BiDi text control, the only effect this localization would have is to set the default direction of the control. The user would then switch it anyways. Aside from notepad, for which the difference is very small, and most people would regard a default LTR control as the correct behavior anyway, what other applications are you concerned over? Shachar -- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com
Re: Right-To-Left (RTL) languages and Wine
Shachar Shemesh shac...@shemesh.biz writes: Did I mention that the automatic mirroring is a broken idea implemented in a broken way already? What do you consider broken about it? Aside from notepad, for which the difference is very small, and most people would regard a default LTR control as the correct behavior anyway, what other applications are you concerned over? Pretty much all of them. For example, Wordpad has combo boxes in the toolbars, those won't be RTL without changing the process layout. Winefile and Regedit have treeviews that would need mirroring, etc. -- Alexandre Julliard julli...@winehq.org
Re: Right-To-Left (RTL) languages and Wine
On 29/09/10 20:25, Alexandre Julliard wrote: Shachar Shemeshshac...@shemesh.biz writes: Did I mention that the automatic mirroring is a broken idea implemented in a broken way already? What do you consider broken about it? Everything. The concept is that a RTL layout is just a LTR layout reversed. This is almost never the case. Almost always, some controls need to still be LTR (URL edit control, tree view of, basically, Latin registry keys, etc.) Defaulting to a mirrored UI means you need to base your redesign on something substantially different than the original, which I do not see as a good move. Microsoft's implementation of this idea is just as crappy as the core concept. The UI often contains images that are part of it. In order to keep the thing even slightly okay, Windows automatically mirrors every image (yes, EVERY image) displayed into a DC which has the RTL attribute set. The MSDN page discussing this has hilarious images of the Microsoft logo reversed. Their OFFICIAL recommendation is to create localized Hebrew/Arabic resources of the images, which are mirrored at the source, so that after the UI second mirroring they turn out okay. Two wrongs don't make a right indeed. All in all, it is my experience that starting with the LTR layout requires less work and is less error prone than starting with a mirrored LTR layout. This aside from the problems I've mentioned before on this list, of the utter stupidity of having some windows on the same desktop with a close button on the left and some on the right. I know no one who finds this convenient. Don't get me wrong. I'm not saying we shouldn't implement this (except the window decoration part, that i think we should not implement). I'm just saying that I would rather if Wine's built in applications not participate in this madness. Aside from notepad, for which the difference is very small, and most people would regard a default LTR control as the correct behavior anyway, what other applications are you concerned over? Pretty much all of them. For example, Wordpad has combo boxes in the toolbars, those won't be RTL without changing the process layout. Winefile and Regedit have treeviews that would need mirroring, etc. First, I'm not sure what the proper way to RTLize regedit should be. See above. Less specifically, however, all controls that have BiDi settings can have those settings set through the resource for that control, without setting it for the entire application. In those cases that the layout is not control by a resource, we are pretty much in deep #...@$!@# anyways because of the reasons stated above. Whether it is Yaron doing the localization or someone else, they must have some way to change the layout in a way that is not merely mirroring, and whatever way that is, it will require being able to tell the system which controls need RTL and which don't. Shachar P.s. I am going over the built in wine applications, and would like to point out for whoever is thinking of localizing clock that clocks in RTL speaking regions still rotate in the same direction. -- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com
Re: Right-To-Left (RTL) languages and Wine
Shachar Shemesh shac...@shemesh.biz writes: Less specifically, however, all controls that have BiDi settings can have those settings set through the resource for that control, without setting it for the entire application. In those cases that the layout is not control by a resource, we are pretty much in deep #...@$!@# anyways because of the reasons stated above. Whether it is Yaron doing the localization or someone else, they must have some way to change the layout in a way that is not merely mirroring, and whatever way that is, it will require being able to tell the system which controls need RTL and which don't. You can't do that in resources, apart from simple dialogs. Many controls are created directly in the code, so you need to change the source. Whether this is to set the process-wide layout or to set WS_EX_LAYOUTRTL individually on appropriate windows will depend on the app, but it needs code changes either way. -- Alexandre Julliard julli...@winehq.org
Re: Right-To-Left (RTL) languages and Wine
Alexandre Julliard julli...@winehq.org wrote: Sent: Sep 29, 2010 11:25 AM To: Shachar Shemesh shac...@shemesh.biz Cc: Paul Vriens paul.vriens.w...@gmail.com, 'wine-devel@winehq.org' wine-devel@winehq.org Subject: Re: Right-To-Left (RTL) languages and Wine Shachar Shemesh shac...@shemesh.biz writes: Did I mention that the automatic mirroring is a broken idea implemented in a broken way already? What do you consider broken about it? Aside from notepad, for which the difference is very small, and most people would regard a default LTR control as the correct behavior anyway, what other applications are you concerned over? Pretty much all of them. For example, Wordpad has combo boxes in the toolbars, those won't be RTL without changing the process layout. Winefile and Regedit have treeviews that would need mirroring, etc. And Microsoft Office appears different in RTL rather than LTR. I used to work with someone that had the Arabic version of these programs and it would switch from RTL when typing in Arabic to LTR when typing in a Latin-based language. As AJ has stated, there is more to do than just 'mirroring' to get RTL into Wine. I remember this was quite difficult to get into OpenOffice.org as well when I was testing it (I think I still have Hebrew and Arabic test files for Writer in OpenDocument (.odt) format.) James McKenzie
Re: Right-To-Left (RTL) languages and Wine
On 29/09/10 21:59, James Mckenzie wrote: And Microsoft Office appears different in RTL rather than LTR. I used to work with someone that had the Arabic version of these programs and it would switch from RTL when typing in Arabic to LTR when typing in a Latin-based language. I'm sorry, but you are confusing several issues here. The question is not whether to implement BiDi (yes, provided we find the working hands to do it) or mirroring (yes, except I don't think we need to bother with mirroring the window decoration UI components that Windows does, and I have not heard anyone else weight in on this issue lately). The question is whether Wine's built in application should set a specific flag to do automatic mirroring. Since Word is not a Wine built in application, what it does is irrelevant for this discussion, not because we don't intend to support it, but because it is undisputed we do. Shachar -- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com
Re: Right-To-Left (RTL) languages and Wine
On 29/09/10 21:52, Alexandre Julliard wrote: You can't do that in resources, apart from simple dialogs. Many controls are created directly in the code, so you need to change the source. Whether this is to set the process-wide layout or to set WS_EX_LAYOUTRTL individually on appropriate windows will depend on the app, but it needs code changes either way. Okay. No dispute about that. Shachar -- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com
Re: Right-To-Left (RTL) languages and Wine
On 9/29/10 2:29 PM, Shachar Shemesh wrote: On 29/09/10 21:59, James Mckenzie wrote: And Microsoft Office appears different in RTL rather than LTR. I used to work with someone that had the Arabic version of these programs and it would switch from RTL when typing in Arabic to LTR when typing in a Latin-based language. I'm sorry, but you are confusing several issues here. The question is not whether to implement BiDi (yes, provided we find the working hands to do it) or mirroring (yes, except I don't think we need to bother with mirroring the window decoration UI components that Windows does, and I have not heard anyone else weight in on this issue lately). The question is whether Wine's built in application should set a specific flag to do automatic mirroring. Since Word is not a Wine built in application, what it does is irrelevant for this discussion, not because we don't intend to support it, but because it is undisputed we do. Thank you for the clarification on what the thread was all about. I thought it was a general RTL/LTR conversation. Pardon the interruption. Everyone on the thread does have a valid point though and I'll continue to watch rather than shout out a comment where it is not needed. James McKenzie
Re: Right-To-Left (RTL) languages and Wine
On 07/30/2010 10:02 AM, Alexandre Julliard wrote: Paul Vrienspaul.vriens.w...@gmail.com writes: On 07/29/2010 08:13 PM, Alexandre Julliard wrote: That depends on the situation. In some cases it can be set globally through the version resources, in other cases it will have to be set on an individual resource basis, or specified directly in the code. When you say 'globally' do you mean everything running under (one) wineserver? No, I mean globally for a process, this is always per-process. If you put the magic string in the version resources the whole process is RTL, making all the windows automatically WS_EX_LAYOUTRTL and mirroring all the UI. That's the correct approach for Wine builtin apps, once WS_EX_LAYOUTRTL works properly. Hi Alexandre, I see you made great steps in getting the RTL stuff working. The Hebrew version of native winmine shows the menu's right-aligned now! What are the plans/ideas for the Wine builtin programs with respect to RTL languages? I mean, how are we going to make the distinction between LTR or RTL when builtin apps are run? -- Cheers, Paul.
Re: Right-To-Left (RTL) languages and Wine
Paul Vriens paul.vriens.w...@gmail.com writes: I see you made great steps in getting the RTL stuff working. The Hebrew version of native winmine shows the menu's right-aligned now! What are the plans/ideas for the Wine builtin programs with respect to RTL languages? I mean, how are we going to make the distinction between LTR or RTL when builtin apps are run? The apps that are ready for it will have to call SetProcessDefaultLayout when appropriate. I don't think we want to use the version resource for this, the mechanism is badly designed and would be painful to use. -- Alexandre Julliard julli...@winehq.org
Re: Right-To-Left (RTL) languages and Wine
Paul Vriens wrote: Hi, I've been in talks with a Hebrew translator for some time now and I'd like to have Wine being able to start doing more RTL stuff. I'm looking for example at http://bugs.winehq.org/show_bug.cgi?id=1158 If I run an English winmine.exe on an Arabic box (thanks to the testbot) the main window will shows as normal LTR window layout with the menu's left justified as well. So eventhough the locale is set to Arabic it doesn't turn 'everything' into RTL. If we don't change the resource files for the RTL languages, that same logic will give us LTR Wine applications or am I wrong here? An English app running on a Hebrew Windows does not automatically get entirely reversed. There are two parts to this question, and I believe that Wine should handle those parts differently. One part are the Windows decorations - close button, minimize, maximize, etc. Under Windows, if an application is reversed, so are these. I believe Wine should not attempt to replicate this behavior for the following reasons: * It is a broken design decision. Its implications are that on the same desktop, some windows have their close button on the left, others on the right. In my experience, this does nothing to enhance the user's experience. * It is difficult to implement. The decorations on Wine windows are drawn by the X window manager. We would have to convince each window manager to reverse the window decorations on our say so. I am not aware of such an API existing, which means lots and lots and lots of bugs. * As an aggregate of the above two - the window decorations are, today, not defined by Wine to be part of the windows experience, and as such, if the Windows behavior is broken, we need not replicate it. The other part is the actual content of the window. Here there is a need to support exactly what Windows is doing, as that is the API. As a side note, I'll add that I think that is broken too. Mirroring should not be done automatically, and reading the MSDN article that Dmitry references just shows how many ways it can, indeed, break. That said, Wine did commit to being bug-compatible with Windows, so that part should, *eventually*, be implemented. I do agree with Alexandre that there are many things more pressing on the BiDi front to handle. Shachar -- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com
Re: Right-To-Left (RTL) languages and Wine
On 07/29/2010 08:13 PM, Alexandre Julliard wrote: Paul Vrienspaul.vriens.w...@gmail.com writes: I've been in talks with a Hebrew translator for some time now and I'd like to have Wine being able to start doing more RTL stuff. I'm looking for example at http://bugs.winehq.org/show_bug.cgi?id=1158 If I run an English winmine.exe on an Arabic box (thanks to the testbot) the main window will shows as normal LTR window layout with the menu's left justified as well. So eventhough the locale is set to Arabic it doesn't turn 'everything' into RTL. If we don't change the resource files for the RTL languages, that same logic will give us LTR Wine applications or am I wrong here? That depends on the situation. In some cases it can be set globally through the version resources, in other cases it will have to be set on an individual resource basis, or specified directly in the code. When you say 'globally' do you mean everything running under (one) wineserver? As said, I guess our Wine programs should be RTL if a user is running with the appropriate locale. Other programs should run RTL or LTR depending how they are coded. I don't think we are quite ready to enable RTL globally though, it's still pretty broken. I'm currently trying to improve it. Great, I saw the commits before I saw this email. Thanks. -- Cheers, Paul.
Re: Right-To-Left (RTL) languages and Wine
Paul Vriens paul.vriens.w...@gmail.com writes: On 07/29/2010 08:13 PM, Alexandre Julliard wrote: That depends on the situation. In some cases it can be set globally through the version resources, in other cases it will have to be set on an individual resource basis, or specified directly in the code. When you say 'globally' do you mean everything running under (one) wineserver? No, I mean globally for a process, this is always per-process. If you put the magic string in the version resources the whole process is RTL, making all the windows automatically WS_EX_LAYOUTRTL and mirroring all the UI. That's the correct approach for Wine builtin apps, once WS_EX_LAYOUTRTL works properly. -- Alexandre Julliard julli...@winehq.org
Re: Right-To-Left (RTL) languages and Wine
On 07/30/2010 10:02 AM, Alexandre Julliard wrote: Paul Vrienspaul.vriens.w...@gmail.com writes: On 07/29/2010 08:13 PM, Alexandre Julliard wrote: That depends on the situation. In some cases it can be set globally through the version resources, in other cases it will have to be set on an individual resource basis, or specified directly in the code. When you say 'globally' do you mean everything running under (one) wineserver? No, I mean globally for a process, this is always per-process. If you put the magic string in the version resources the whole process is RTL, making all the windows automatically WS_EX_LAYOUTRTL and mirroring all the UI. That's the correct approach for Wine builtin apps, once WS_EX_LAYOUTRTL works properly. Ok, thanks for that explanation. Do you know if dialog resources also inherit WS_EX_LAYOUTRTL? After reading http://msdn.microsoft.com/en-us/goglobal/bb688119.aspx (Activating Mirroring for Dialog Resources) it's not very clear to me (my thought is that it doesn't inherit). -- Cheers, Paul.
Re: Right-To-Left (RTL) languages and Wine
Paul Vriens paul.vriens.w...@gmail.com writes: Ok, thanks for that explanation. Do you know if dialog resources also inherit WS_EX_LAYOUTRTL? A quick test suggests that they don't. -- Alexandre Julliard julli...@winehq.org
Right-To-Left (RTL) languages and Wine
Hi, I've been in talks with a Hebrew translator for some time now and I'd like to have Wine being able to start doing more RTL stuff. I'm looking for example at http://bugs.winehq.org/show_bug.cgi?id=1158 If I run an English winmine.exe on an Arabic box (thanks to the testbot) the main window will shows as normal LTR window layout with the menu's left justified as well. So eventhough the locale is set to Arabic it doesn't turn 'everything' into RTL. If we don't change the resource files for the RTL languages, that same logic will give us LTR Wine applications or am I wrong here? -- Cheers, Paul.
Re: Right-To-Left (RTL) languages and Wine
Paul Vriens paul.vriens.w...@gmail.com writes: I've been in talks with a Hebrew translator for some time now and I'd like to have Wine being able to start doing more RTL stuff. I'm looking for example at http://bugs.winehq.org/show_bug.cgi?id=1158 If I run an English winmine.exe on an Arabic box (thanks to the testbot) the main window will shows as normal LTR window layout with the menu's left justified as well. So eventhough the locale is set to Arabic it doesn't turn 'everything' into RTL. If we don't change the resource files for the RTL languages, that same logic will give us LTR Wine applications or am I wrong here? That depends on the situation. In some cases it can be set globally through the version resources, in other cases it will have to be set on an individual resource basis, or specified directly in the code. I don't think we are quite ready to enable RTL globally though, it's still pretty broken. I'm currently trying to improve it. -- Alexandre Julliard julli...@winehq.org
Re: Right-To-Left (RTL) languages and Wine
On Thu, Jul 29, 2010 at 1:13 PM, Alexandre Julliard julli...@winehq.org wrote: Paul Vriens paul.vriens.w...@gmail.com writes: I've been in talks with a Hebrew translator for some time now and I'd like to have Wine being able to start doing more RTL stuff. I'm looking for example at http://bugs.winehq.org/show_bug.cgi?id=1158 If I run an English winmine.exe on an Arabic box (thanks to the testbot) the main window will shows as normal LTR window layout with the menu's left justified as well. So eventhough the locale is set to Arabic it doesn't turn 'everything' into RTL. If we don't change the resource files for the RTL languages, that same logic will give us LTR Wine applications or am I wrong here? That depends on the situation. In some cases it can be set globally through the version resources, in other cases it will have to be set on an individual resource basis, or specified directly in the code. I don't think we are quite ready to enable RTL globally though, it's still pretty broken. I'm currently trying to improve it. Perhaps it's a good candidate for the 1.4 release criteria? -- -Austin