Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Feature (devel): Toggle text direction option #5680

Closed
DorpsGek opened this issue Jul 28, 2013 · 8 comments
Closed

-Feature (devel): Toggle text direction option #5680

DorpsGek opened this issue Jul 28, 2013 · 8 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

sbr opened the ticket and wrote:

OpenTTD support both LTR and RTL languages. In order to tests the GUI in RTL mode, it's necessary to switch to a language in that direction like Arabic or Hebrew. However testing the GUI in a language I don't understand isn't really convenient.

- toggle-text-direction_00codechange-help-menu-use-dropdown-items_3b2f9d049236.patch
This patch build the Help dropdown of the main toolbar by using some DropdownListStringItems instead of relying to a range of strings. This new construction is more flexible to adjust the dropdown content depending of the activated settings.

- toggle-text-direction_01change-empty-dropdown-list-item-as-separator_3b2f9d049236.patch
This patch use an empty DropdownListItem to make a proper separator instead of an empty string.

- toggle-text-direction_10feature-toggle-text-direction-option_3b2f9d049236.patch
This patch allow to switch the text-direction without changing the current language. If the 'gui.developer' setting is set in openttd.cfg, a new entry 'Toggle text direction' is added to the Help dropdown of the main toolbar.

Please find attached these three patches against r25633.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5680
@DorpsGek
Copy link
Member Author

sbr wrote:

- toggle-text-direction_11add-hotkey_3b2f9d049236.patch
This patch add CTRL+ALT+T as hotkey to toggle the text direction.

Please find attached a patch against r25633.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5680#comment12446

@DorpsGek
Copy link
Member Author

Rubidium wrote:

You could, relatively easily, drop the attached file into the language folder and compile OpenTTD with that. Then you'll have an English "translation" with the RTL bit set.

It will also work in the intro game editor and survive restarts.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5680#comment12462

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 1, 2013

sbr wrote:

I used to have a patch at the start of my patch queue that declared English (US) as RTL.

Adding an 'English (RTL)' language file is clearly less intrusive than my proposition. However it should only be present in the language dropdown if the 'gui.developer' setting is set.

I thought a more general solution, that is not tied to any particular language, could benefit to those who develop/tests the GUI.
Toggling the text direction with the hotkey is really convenient comparing to a language change in the Game Options. As it's protected by the 'gui.developer' setting this feature is hidden to most of the users.

The menu entry + hotkey could easily be added to the scenario editor and only the hotkey to the intro game.
I'm unsure about the persistence of the text direction change.

EDIT: the menu entry is present in the scenario editor, only the hotkey is missing.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5680#comment12464

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 2, 2013

sbr wrote:

-- toggle-text-direction_00codechange-help-menu-use-dropdown-items_dba5e699d261.patch
States in english.txt that about menu entries doesn't form a range anymore.

-- toggle-text-direction_01change-empty-dropdown-list-item-as-separator_dba5e699d261.patch
Unchanged.

-- toggle-text-direction_02cleanup-remove-unused-straboutmenuseparator-in-all-languages_dba5e699d261.patch
STR_ABOUT_MENU_SEPARATOR was removed from english.txt. Also remove it in all other languages.

-- toggle-text-direction_10add-toggle-text-direction-function_dba5e699d261.patch
Only add the ToggleTextDirection() function to toolbar_gui.cpp.
Declare it in toolbar_gui.h to be able to use it globally.

-- toggle-text-direction_11add-global-hotkey_dba5e699d261.patch
Defines Ctrl+Alt+D (Control Alternative Direction) as a global hotkey to ToggleTextDirection().

-- toggle-text-direction_12add-help-menu-entry_dba5e699d261.patch
Add the menu entry in the About/Help toolbar menu if 'gui.developer' is set.
This is the only patch who depend on the toggle-text-direction_0* patches.

Please find attached these six patches against r25644.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5680#comment12465

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 2, 2013

Alberth wrote:

Adding an 'English (RTL)' language file is clearly less intrusive than my proposition. However it should only be present in the language dropdown if the 'gui.developer' setting is set.

I thought a more general solution, that is not tied to any particular language, could benefit to those who develop/tests the GUI.
Toggling the text direction with the hotkey is really convenient comparing to a language change in the Game Options. As it's protected by the 'gui.developer' setting this feature is hidden to most of the users.

So who is "those who develop/tests the GUI" exactly? In my view, they would be developers only. Such persons have no problems with one extra test-language.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5680#comment12467

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 3, 2013

sbr wrote:

So who is "those who develop/tests the GUI" exactly?

Less than ten persons I guess.

In my view, they would be developers only. Such persons have no problems with one extra test-language.

Maybe it's just me who'll benefit from the toggle-text-direction feature. It's fine for me to keep it at the start of my patch queues (although I'll certainly remove the help menu entry and only use it with the hotkey). If others want it they could as well import the patches in their development checkouts. Or use the language file provided by Rubidium; probably most of the developers already do that.

This patches responded to a very specific/personal need and the ratio "code maintenance/benefit to users" is clearly unfavorable to their integration; let's close this task.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5680#comment12475

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 3, 2013

Alberth wrote:

I also once considered to add the RTL english file to OpenTTD. Like your patch, it would be useful for testing. However, then you have this weird additional language that nobody understands or uses.
Your patch is better in the sense that it is hidden from users, but on the other hand, it also means the code is never used, and may become broken without anyone noticing.
This may be one of the areas that is too much edge case to be useful for adding.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5680#comment12476

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 3, 2013

Alberth closed the ticket.

Reason for closing: Won't implement

Closed by request of the author.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5680

@DorpsGek DorpsGek closed this as completed Aug 3, 2013
@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) wontfix patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant