Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon May 20, 2013 5:48 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ] 
Author Message
PostPosted: Tue Dec 13, 2011 9:18 am 
Offline
Engineer
Engineer
User avatar

Joined: Tue Jan 27, 2009 11:48 pm
Posts: 10
Hi,

I was wondering if a small change could be made to the webtranslator interface.

Specifically, if the two inputs used for the "original" and "translation" strings could be converted to a TEXTAREA element.

Image

Long strings are harder to visualize in the inputs present at this time. Small strings are fine, as you can see from the screenshot.


Attachments:
wt.png [43.82 KiB]
Not downloaded yet
Top
 Profile  
 
PostPosted: Tue Dec 13, 2011 7:44 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
It also has the benefit of turning on the spell checker by default in most browsers. As it is now, I have to right click and enable it each time. But I guess there is a Firefox plugin also for that. :-)

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
 Profile  
 
PostPosted: Tue Dec 13, 2011 8:03 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon May 31, 2004 9:21 am
Posts: 1223
Sadly, there is a good reason it is not a textarea. There are a few issues with it, among which that newlines are not allowed, that strings can be hard to read and translate, that you need to use your mouse to translate (you can now just hit enter etc), and a few more.

So as far as WT3.0 goes, this will never be changed. I still have plans for WT3.1, but as for now they are just that: plans.

Still, valid suggestion. Just not easily implementable, so postponed ;)

_________________
The only thing necessary for the triumph of evil is for good men to do nothing.


Top
 Profile  
 
PostPosted: Tue Dec 13, 2011 8:07 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
If the enter key is the only problem you can fix that with some javascript.


Top
 Profile  
 
PostPosted: Wed Dec 14, 2011 8:45 am 
Offline
Engineer
Engineer
User avatar

Joined: Tue Jan 27, 2009 11:48 pm
Posts: 10
I use the mouse anyway when translating. I never ever thought that I can just hit "enter" to do anything with my translation. :D Besides, using the mouse gives me a second or two to make a short review of what I just translated, instead of hitting enter automatically.

TrueBrain wrote:
Sadly, there is a good reason it is not a textarea. There are a few issues with it, among which that newlines are not allowed, that strings can be hard to read and translate, that you need to use your mouse to translate (you can now just hit enter etc), and a few more.

Why are the strings harder to read and translate?

Also, are you not sanitizing the input for newlines anyway? I can easily send a newline character, even if it is an input and not a textarea.

So, a simple replace can filter out newlines, and a small bit of JS can submit the result when "enter" is pressed.

Textareas are resizable on some (most?) browsers, so you can drag it a little bit if you're out of room. And you can constrain the resize values. All it takes are a few lines of CSS.

Any more protests? :D


Top
 Profile  
 
PostPosted: Wed Dec 14, 2011 1:02 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon May 31, 2004 9:21 am
Posts: 1223
TrueBrain wrote:
Sadly, there is a good reason it is not a textarea. There are a few issues with it, among which that newlines are not allowed, that strings can be hard to read and translate, that you need to use your mouse to translate (you can now just hit enter etc), and a few more.
(..)

Yexo wrote:
If the enter key is the only problem you can fix that with some javascript.

No, it is not the only problem.

kkmic wrote:
(..)
Any more protests? :D

I am sorry if I gave the idea this was up for debate :) During early testing it become obvious that simply a textarea is not a good solution, and I concluded a long time ago that this is also not easy solvable, so (again): it won't be done for WT3.0, and it is planned for WT3.1.

In the mean time, both of you are of course completely free to start WT3.1 (or WT4 for all I care) :)

_________________
The only thing necessary for the triumph of evil is for good men to do nothing.


Top
 Profile  
 
PostPosted: Wed Dec 14, 2011 2:22 pm 
Offline
Engineer
Engineer
User avatar

Joined: Tue Jan 27, 2009 11:48 pm
Posts: 10
I must quote myself:
kkmic wrote:
Why are the strings harder to read and translate?

I mean, textareas are designed for long strings, right? (emphasis on long). Would you mind explaining a bit on why they are technically not suitable for the current version of WT? Come on, don't be shy :p

On the bright side, is the WT code public somewhere? I could take a look at it if it is.


Top
 Profile  
 
PostPosted: Wed Dec 14, 2011 2:52 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6117
Location: The Netherlands
kkmic wrote:
I mean, textareas are designed for long strings, right?

From a HTML point of view, textareas are for multiline text and input boxes are for single line text.

As a string is a single line text...

Still, input boxes may be persuaded to behave as textareas by means of some css. Not sure of that though.
What you'd have then is a string displayed over multiple lines, while still being unable to use newlines in them.
I may have to figure out if this works and report back on that :)

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
 Profile  
 
PostPosted: Thu Dec 15, 2011 8:11 am 
Offline
Engineer
Engineer
User avatar

Joined: Tue Jan 27, 2009 11:48 pm
Posts: 10
FooBar wrote:
Still, input boxes may be persuaded to behave as textareas by means of some css. Not sure of that though.

I did not stumbled upon any page using this technique. Then again, maybe I just did not noticed.

The idea sounds interesting. Please feel free to share if you find a solution.

I'm still waiting for a reply from TrueBrain. And an answer on why is not OK (technically speaking) to simply remove newlines from the text. Or what are the other technical issues.

EDIT:
Found this on StackOverflow. It says it cannot be done. But there are other solutions posted there. The last one posted has potential. Of course, sanitizing still needs to be done. But then again, it should be done regardless


Top
 Profile  
 
PostPosted: Thu Dec 15, 2011 10:55 am 
Offline
Engineer
Engineer
User avatar

Joined: Mon May 01, 2006 9:09 am
Posts: 95
I'll save TrueBrain from having to quote himself over and over agian.


TrueBrain wrote:
I am sorry if I gave the idea this was up for debate :) During early testing it become obvious that simply a textarea is not a good solution, and I concluded a long time ago that this is also not easy solvable, so (again): it won't be done for WT3.0, and it is planned for WT3.1.

In the mean time, both of you are of course completely free to start WT3.1 (or WT4 for all I care) :)


Is it so hard to take no for an answer? He clearly stated that his decision was not up for debate, and that he has good reasons NOT to use a textarea (clearly there is something more to it than JUST the newlines)

_________________
Lead Manager of OpenDUNE


Top
 Profile  
 
PostPosted: Thu Dec 15, 2011 11:37 am 
Offline
Engineer
Engineer
User avatar

Joined: Tue Jan 27, 2009 11:48 pm
Posts: 10
I have read the part with "it cannot be done". I am still waiting for the "why it cannot be done" part.

Come on, we're a community here. I'm not expecting my ideas to get an enthusiastic welcome. I'm not even expecting that they will be approved. But I expect to be told why.

I understand that there is a technical issue that determined TrueBrain to chose this approach. It was the best option he could think of. It may be even the best option ever (which it means that there is no room for improvement). All that I am asking for is a basic answer for the "why" question. I might even be able to lend a hand.

Isn't OpenTTD a community-driven project? I understand that WT may be in a different case, but would it really hurt to help someone who wants to help?


Top
 Profile  
 
PostPosted: Thu Dec 15, 2011 11:52 am 
Offline
Moderator
Moderator
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 12811
Location: The Netherlands
Xaroth wrote:
I'll save TrueBrain from having to quote himself over and over agian.


TrueBrain wrote:
I am sorry if I gave the idea this was up for debate :) During early testing it become obvious that simply a textarea is not a good solution, and I concluded a long time ago that this is also not easy solvable, so (again): it won't be done for WT3.0, and it is planned for WT3.1.

In the mean time, both of you are of course completely free to start WT3.1 (or WT4 for all I care) :)


Is it so hard to take no for an answer? He clearly stated that his decision was not up for debate, and that he has good reasons NOT to use a textarea (clearly there is something more to it than JUST the newlines)

Much appreciated but TrueBrain is capable enough to deal with it himself. And kkmic has a fair point wanting to know why.

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
 Profile  
 
PostPosted: Thu Dec 15, 2011 12:27 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon May 31, 2004 9:21 am
Posts: 1223
I already explained you why it shouldn't be done (mind the wording!):

- Textareas allow newlines
- Translations are hard to read
- You need your mouse to translate
- Use-cases showed it is a poor solution
- Months ago it has been established this is not the way to go.

Now before I will go into each point giving you more verbose information on the how and why, I first want to tell you something.

I have a day job, and next to it I (for free) work on OpenTTD. Much of my time (and effort) goes into programming, and making cool new features. Although I don't mind questions and suggestions like you made from time to time, I do not have the time to answer all of them in full in the way the user would like to. Believe me, they always want to know more and more. Like you. Not meant in any offensive way, but the list above is not enough for you to leave it at that. From your perspective, I completely agree. Just realise that WT is not designed over night, and a lot of thought has gone into it. The nature of a human defines that he always knows better (mostly in a good way), and so that the author of an application must have missed something obvious. Hell, even I do :) Just understand that I get questions like this a lot, and often. It is most often easier for me being rude and saying: no, because I say so, to stop the endless questions, endless "why?", etc etc. So just be aware that such questions consume a lot of time from my side, time I could have spend better (in my opinion), mostly because I do not get paid for this!

- Textareas allow newlines
This is a problem of suggestion. When you see a textarea, you want to press enter. In translations, enters are not allowed. So to imply you can press enter, will give user questions, will result in developers needing to spend time answering. This is unwanted. An inputbox does not give this suggestion. This comes with: a textarea in HTML is meant to have multiline input.

- Translations are hard to read
In textarea it becomes rather hard to read how your translation is doing. This is even worse for RTL languages. Early use-case tests showed it was much harder to translate with a textarea than an textbox.

- You need your mouse to translate
Just a minor user-friendly thingy.

- Use-cases showed it is a poor solution
For the few days I did have a textarea, many many issues were detected and found. It simply didn't work. And this I guess is the most prominent issue: it doesn't work. Not in the structure and design WT3.0 is in.

- Months ago it has been established this is not the way to go.
Meh, nuff said.

I see this thread mostly derailed in it being a technical issue. Although there are a few technical issues, they can always be resolved (over time) and are rarely a point of not adding anything. My points are mostly design-questions. To which the answer comes back every time I got asked (or asked myself): textareas do not work in WT3.0. It needs a design change. Something I planned for WT3.1, but WT3.1 is only in 'planning'. Mostly because I don't have time :'(

Right, I hope this reply clear things up for you a bit. I would like to end with what I already said:

Still, valid suggestion. Just not easily implementable, so postponed ;)

_________________
The only thing necessary for the triumph of evil is for good men to do nothing.


Top
 Profile  
 
PostPosted: Thu Dec 15, 2011 5:15 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6117
Location: The Netherlands
In reply to my earlier idea to have a multiline <input type="text">: that can't be done.

So textarea is really the only option, and you've just read why that didn't make it ;)

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
 Profile  
 
PostPosted: Fri Dec 16, 2011 8:19 am 
Offline
Engineer
Engineer
User avatar

Joined: Tue Jan 27, 2009 11:48 pm
Posts: 10
@TrueBrain: :bow:

Thanks for taking your time to get a detailed answer back. I have asked for one because I develop Web applications too and I was curious about what were the showstoppers that you have encountered with this particular issue.

Well, I still do not agree with everything you have said :D but hey... I do have that right :p

I guess it's because it mainly depends on the user and on the developer's past experience. But there's no point in escalating this question further, simply because I do not know the inner workings of the WT. I don't know it's architecture and the principles used to build it's foundation.

So, clearly it's not the case for me to ask question further.

I understand that there is no need for help regarding WT, but (since I don't know C/C++) my help offer is still on the table, should you need it.

Again, thanks for your answer.


Top
 Profile  
 
PostPosted: Fri Dec 16, 2011 9:02 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 2451
Location: home
kkmic wrote:
I understand that there is no need for help regarding WT, but (since I don't know C/C++) my help offer is still on the table, should you need it.
Well, as it was decided that the current WT is not the way to go, we do need a new WT ;)

The best way forward is probably to discuss this at IRC.

I don't know the technical details, but I do have a wish, namely providing translations to all NewGRFs too.
No idea how to achieve that though.


Top
 Profile  
 
PostPosted: Tue Jan 03, 2012 7:04 pm 
Offline
Engineer
Engineer

Joined: Thu Mar 15, 2007 6:50 pm
Posts: 12
I also am a little bit upset about the input field situation in the web translator. Today I got very long string to translate three times in a row, an beeing unable to see all of the string in a screen really sent my motivation far far away.

So after reading this thread, it seems that there will be no quick changes. So I crafted this little chrome extension which just overwrites the style used on the WebTranslator input boxes.

You can load the unpacked extension through the extensions tab in the options window.

You can check it out in the screenshow below. I know it is not the most beautiful thing you have ever seen, but it gets the job done mostly all of the time.

Feel free to modify the extension to suit your needs. It is really simple and straightforward.


Attachments:
long_str_inputs.png [81 KiB]
Not downloaded yet
wt3ex.zip [942 Bytes]
Downloaded 15 times
Top
 Profile  
 
PostPosted: Tue Jan 03, 2012 7:17 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon May 31, 2004 9:21 am
Posts: 1223
Crafty solution, nice :D

_________________
The only thing necessary for the triumph of evil is for good men to do nothing.


Top
 Profile  
 
PostPosted: Mon Jan 09, 2012 1:34 pm 
Offline
Engineer
Engineer
User avatar

Joined: Tue Jan 27, 2009 11:48 pm
Posts: 10
Simple, ugly, but effective.

Nice one!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.