From OpenStreetMap Wiki
Jump to: navigation, search

Aseerel4c26's refactoring

relates to this edit.

At first glance, turning this page into a series of switch statements makes a whole lot of sense. However, iD lets translations customize everything, including the keyboard shortcuts. For the Vietnamese localization, I chose shortcuts that make sense in Vietnamese and don't conflict with unlocalizable shortcuts (like B H and M). So C is for Split, G is for Combine, and R does nothing. Unfortunately, that means Vi:iD/Shortcuts can't make use of the template you've created. – Minh Nguyễn (talk, contribs) 08:17, 7 June 2013 (UTC)

Different shortcuts per language? Ohh, what the hell. ;-) Okay, no, I did not think of this. Thank you for the notice! Of course that (uncommon) speciality should be mentioned in the shortcut pages (I did so now for English). And, sure, then my approach is not useful for all languages which have different shortcuts from English. However, for all other languages (that is: all other which have a page here), which do not use different shortcuts we could use it.
Well, we could insert switches also for the keys ... but that would get even more complicated then. Similar to this (not using key R in Vietnamese):
   |#default=* {{key press|R}} – {{#switch:{{lc:{{Langcode}}}}
    |#default=rotate object
    |de=Objekt drehen
Do you think I should revert to the old English page?
Side note: language specific shortcuts are uncommon, but that does not mean that it is not a good idea. I am very used to English shortcuts (also in German UIs). Well, why not translate shortcuts... --Aseerel4c26 (talk) 22:32, 7 June 2013 (UTC)
No need to revert, as long as translators of this page double-check before reusing the English shortcuts. Since the Vietnamese page shares nothing in common with the English one, there's no need to have the wikitext match. I personally am used to the English shortcuts, too, but I figured newcomers would find translated shortcuts easier to master. I also got really annoyed by the editor maximizing every time I wanted to move something. :^) – Minh Nguyễn (talk, contribs) 09:26, 10 June 2013 (UTC)

A even more templatified suggestion

Why not use the template function?
* {{key press|Q}} – {{{keyQ|Definition in EN}}}
in other language:
{{TemplateName|keyQ=Definition in other Language}}
this is easy and hundreds pages use it. --Reneman (talk) 10:05, 23 June 2013 (UTC)
I don't understand what you mean, could you please explain? Which template? template:key press is used. You mean to create a template for each key? "Why not …"? Well, feel free to improve or suggest anything, hmm! :-) --Aseerel4c26 (talk) 13:12, 23 June 2013 (UTC)
see Map Features or other pages, use the same ;)
The englisch Languagepage is the template, this is simple. All new elements are now visible in all languages​​. --Reneman (talk) 13:56, 23 June 2013 (UTC)
Ah, yes, thanks for the example, did not know the structure of that page (in fact I did not know that page...). I will think about it's pros and cons.
--Aseerel4c26 (talk) 23:29, 23 June 2013 (UTC)
as I said, this method is frequently used in this wiki. It has the advantage that EN is default, and that every country can clearly edited in his side. Read in German
--Reneman (talk) 11:50, 24 June 2013 (UTC)
The Way with a function {{#switch:{{lc:{{Langcode}}}} is very good for one Template, example {{d}}. :) --Reneman (talk) 11:55, 24 June 2013 (UTC)

pro (reneman - template with translations as parameters):

  • no watchlist spam for all if a translation is changed
  • if all translations should be invalidated simply the parameter name is changed in the English version. All translations would switch to English then.
  • much less text on one page, a better overview of one language in edit mode
  • may be easier to understand how it works
  • preview of translations is possible the usual way (switch method does not allow to preview translation texts without manually copying any pasting outside of the switch)


  • no watchlist spam means also no building of a small "community" of translators/editors of one topic
  • could be even more hard to understand how it works
  • no easy comparison of all translations in edit mode (may give suggestions when translating)
  • hard to add a new translation for a new entry on an already translated page. Need to look up the parameter name on the English page and insert this new parameter into the translation page.

Let's stick with the current method (it is not bad, is it?) for this page - much work now to reorganise. Maybe I will use the other method for new pages. I am not convinced yet. Thank you anyway, Reneman! :-)

By the way: 1. You are confusing language and country. :-P 2. Your use of {{MyLang}} (look in edit mode - a new template for you!) does not work for me - I only see your German text in edit mode. Maybe we should not overdo it with templates ... --Aseerel4c26 (talk) 21:11, 24 June 2013 (UTC)

I don't understand what you mean. The Template:MyLang shows the translation as hovertext. The idea is that the text is originally written in his own language, to save also. So you can make it, and other users of their own language a little easier herself. Read in German
--Reneman (talk) 21:27, 24 June 2013 (UTC)
Ah, {{MyLang}} shows a text on hovering, I think that did not work an hour ago. I tried it but I did not see the text (maybe I did not stop moving the mouse pointer long enough since it takes about 350 ms to appear). Thanks. --Aseerel4c26 (talk) 22:12, 24 June 2013 (UTC)