Make text on the page click-translatable
sami_k - February 5, 2008 - 11:33
| Project: | Localization client |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Been using the client, works nicely. Thanks for writing it! I wanted to suggest something. If you change the t() function to put a div around the text, say Text, then you can use jquery to attach an event to that text. The event would simply highlight the text on mouseover, say put a yellow background, and onclick would put the text in the source box. This would significantly improve the usability of the interface.

#1
We thought about this but choose this interface instead. Because many t()-ed strings will not end up on the interface (eg. sent out in emails), or are escaped when displayed (eg. menu items), so the result would probably look broken. If you have good results with such an approach, let me know though, since this would definitely be easier, if only we would know where can we apply that div.
#2
Well could we not take a hybrid approach and support both cases? Because I do find that in some cases the text in the left column is more cumbersome to find than text that I am looking at.
#3
As said, we can screw up your JavaScript string translations, your emails, etc. by wrapping each string in a div. Unfortunately we don't know what string goes out to the web interface and what goes elsewhere. Feel free to experiment with this and prove me wrong :)
#4
#5
Great idea... i wished this is already inside last weekend. Like Firebug "Inspect" feature...
#6
How about a flag approach, where we set a variable to enable string translations and then disable it. It won't be a production feature, but rather a development feature? That way it may break certain things, but only at development time...