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

Add language debugging mode #3755

Closed
bhousel opened this issue Jan 13, 2017 · 5 comments
Closed

Add language debugging mode #3755

bhousel opened this issue Jan 13, 2017 · 5 comments
Labels
localization Adapting iD across languages, regions, and cultures

Comments

@bhousel
Copy link
Member

bhousel commented Jan 13, 2017

This is an idea from today's show-and-tell which would help translators a lot.

It would be great to be able to switch iD into a mode where instead of the translation strings, you just see the translation keys. This in itself isn't too hard to do by changing what the code in locale.t() does.

The tricky part is that there are probably lots of components of iD that are only entered once and never updated again. When switching the language, we'd really need to rebuild the ui from scratch. This code is in ui/init.js and is really not designed to be rerun. It might be ok to preserve some of the map state and throw out all that stuff and reenter it - I don't know. It's like how iD can switch in and out of the walkthrough, but probably more complicated.

This would enable #3120 too (switching languages on the fly).

@bhousel bhousel added localization Adapting iD across languages, regions, and cultures wip Work in progress labels Jan 13, 2017
@bhousel
Copy link
Member Author

bhousel commented Jan 26, 2017

So, I did this today:

screen shot 2017-01-26 at 11 48 18 am

It's kind of weird but it works.. Is this something that would be useful to people doing translations?

The idea is that now iD can switch languages on-the-fly, and I added a special language called _tkeys_ that shows the keys instead of the strings.

Right now toggling languages can only be done through the dev console (we can add a proper field to pick the language later, closing #3120):

id.ui().restart('it')
id.ui().restart('ru')
id.ui().restart('zh')
id.ui().restart('_tkeys_')

cc @1ec5 @manfredbrandl @slhh @tyrasd

@1ec5
Copy link
Collaborator

1ec5 commented Jan 27, 2017

Yes, that could be useful for zeroing in on an incorrect translation I spot while using iD. I sometimes use a similar mode when translating MediaWiki (example), although fortunately Transifex’s search engine is much more usable than Translatewiki.net’s.

More commonly, I need to go in the other direction while translating in Transifex: figuring out where a string marked for translation is used within iD. For that purpose, I usually head over to this repository’s commit history and root around for the relevant change. (Thank you for descriptive commit messages!) One way to improve this workflow would be a mode where untranslated UI elements are highlighted prominently or greeked (replaced with lookalike ¢ħª®ä©ţǝ®§ or emoji).

@magol
Copy link

magol commented Jan 27, 2017

Another improvement is if you add a link to the Git commit in the transifex comment for each string. In that way, i can easy go directory to the relevant commit.

@bhousel
Copy link
Member Author

bhousel commented Jan 27, 2017

Thanks for the feedback @1ec5 and @magol...

There isn't a great way to go from Transifex back to iD, aside maybe from looking at the key itself and then doing a search in the iD source code. Even that is not great because it requires some familiarity with how the code draws the UI.

E.g. search for this key, or some part of it:

screenshot 2017-01-27 10 19 58

Anyway I'll close this for now, and you can use the method above to switch languages until we close #3120

@bhousel
Copy link
Member Author

bhousel commented Apr 12, 2017

BTW for anyone following this issue, I just setup the master mirror (#3912) so that it also pulls the latest translations from Transifex. That means that every 10 minutes that mirror will have the latest code from master along with the latest translation strings applied on top of that code.

I hope it will be helpful so that translators can see the effects of their work pretty quickly. This will be useful because when #3921 lands, there will be a lot of translation work to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localization Adapting iD across languages, regions, and cultures
Projects
None yet
Development

No branches or pull requests

4 participants