MediaWiki talk:Gadget-TranslationAdder.js/Archive1

Hello, you have come here looking for the meaning of the word MediaWiki talk:Gadget-TranslationAdder.js/Archive1. In DICTIOUS you will not only get to know all the dictionary meanings for the word MediaWiki talk:Gadget-TranslationAdder.js/Archive1, but we will also tell you about its etymology, its characteristics and you will know how to say MediaWiki talk:Gadget-TranslationAdder.js/Archive1 in singular and plural. Everything you need to know about the word MediaWiki talk:Gadget-TranslationAdder.js/Archive1 you have here. The definition of the word MediaWiki talk:Gadget-TranslationAdder.js/Archive1 will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofMediaWiki talk:Gadget-TranslationAdder.js/Archive1, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

language names

Can it be made to convert language names to language codes? Most users know the former better, I think.—msh210 23:02, 12 April 2009 (UTC)Reply

I thought about this too, it could, though I'd rather not include the names of all the ISO languages in the script (there are almost a WT:BP-load of them :p). I think a reasonable compromise might be to include the names of the first 100 languages in WT:STATS - and while I might make the input box slightly wide, I'll still leave iso code in the instructions. Conrad.Irwin 23:15, 12 April 2009 (UTC)Reply
It will now convert ISO 639-1 language names into the respective codes. Conrad.Irwin 11:49, 14 April 2009 (UTC)Reply

default

There was a BP suggestion (but I'm responding here as I can't really open BP on this machine) that this be turned on by default for users. I might suggest that that would lead to vandalism; perhaps, if such a thing is possible, turn it on by default for autoconfirmed users only?—msh210 23:02, 12 April 2009 (UTC)Reply

Such a thing is possible, and that might be a better first-step. I still think it would be an interesting experiment to see whether a more structured input field leads to higher quality editing - though whether we want to even try is a question for the community at large. Conrad.Irwin 23:17, 12 April 2009 (UTC)Reply

enabling ttbc

Is it possible to add an option around the editing translation boxes to allow adding in a translation to be checked format, maybe inside the More section ?? Serpicozaure(talk) 13:21, 14 April 2009 (UTC)Reply

We'd first need to fix {{ttbc}} to accept language codes. Conrad.Irwin 13:42, 14 April 2009 (UTC)Reply
That's easy, and a fine idea. Done. Robert Ullmann 16:31, 14 April 2009 (UTC)Reply

Handling of wikisyntax for the {{trans-top}} header

The script can not find the translation table in the wikitext if the translation table header contains some wikisyntax. For example, when someone write

{{trans-top|(''biology'') frog}}

instead of expected

{{trans-top|(biology) frog}}

See abort (as a verb) where such a trans-top is used.

Relevant code

When util.getTransGloss is called on the header "(<i>biology</i>) frog", then it returns "() frog" because <i> is not a text node.

for (var j=0; j< head.length; j++)
{
  if (head.nodeType == 3)
    ret += head.nodeValue;
}

Then, in util.matchGloss the "() frog" is splitted by spaces, which results in a "()" word. That word is not found in the wikiline provided by util.getTransTable so the script reports Could not find translation table...

Solution

It seems that it can be fixed by changing util.getTransGloss to get the text recursively. There are probably some nested tags in the translation headers somewhere (like '''''bold and italic'''''), so recursion would be the most error proof solution:

getTransGlossText: function (node) {
  var ret = '';
  var children = node.childNodes;
  for (var i=0; i<children.length; i++)
  {
    if (children.nodeType == 3)
      ret += children.nodeValue;
    else if (children.tagName.match(/^(i|b)$/i)) // recurse into I and B tags
      ret += util.getTransGlossText(children);
  }
  // All characters except a-zA-Z0-9 are changed to spaces.
  // Handles differences between the HTML output and the corresponding wiki text.
  return ret.replace(/\W/g, ' '); 
},

getTransGloss: function (ul) {
  ...
  if(children.className && children.className.indexOf('NavHead') > -1)
    return util.getTransGlossText(children);
  ...
}

Maybe I missed the real cause, since I don't know Javascript, how to debug the code and run the modified version.
Karelklic 19:17, 14 April 2009 (UTC)Reply

Hi, thanks for the suggestion. Somethings just come up here, but I'll look in more detail later. My hope was to be as simple as possible and ignore all wikitext - even if I get "(biology)" it won't match the wikitext which will look like (biology) or (biology) or (biology). I think I will get the text recursively and then replace out all ascii chars. Or I could just use .innerText (or .textContent, or both...). If you want to get your own local copy for debugging, just create User:Karelklic/editor.js and modify your monobook.js like User:Conrad.Irwin/monobook.js. Conrad.Irwin 19:57, 14 April 2009 (UTC)Reply
Thanks. You are right about the "(biology)" problem.
I updated the proposed solution. Now it works with abort, stick, and it should work even with Template:legal as we do not recurse into SPANs.
Karelklic 23:52, 14 April 2009 (UTC)Reply
Cool, I'll do a quick test, and then upload it. Thank you very much! Conrad.Irwin 00:06, 15 April 2009 (UTC)Reply
Committed changes. Conrad.Irwin 00:15, 15 April 2009 (UTC)Reply

Problem

I tried to add a Korean word, but it kept blanking itself and would not enter anything. Now all of the boxes on every page are expanded and have a "ko" in them, and when I shrink them and remove the "ko", they ignore me and revert. How can I get it to shrink again? —Stephen 14:44, 15 April 2009 (UTC)Reply

If a hard refresh and clicking "less" doesn't fix it. Then remove your cookies for wiktionary. 86.170.66.66 19:29, 15 April 2009 (UTC)Reply
I managed to get it to work for Portuguese (Nazism), which resulted in the box shrinking back. But when I tried to do Yiddish, it blanked the entry and returned "Could not find translation entry for 'yi:נאציזם'. Please reformat". I had to enter the Yiddish manually. —Stephen 03:34, 16 April 2009 (UTC)Reply
Attempting to enter the Yiddish caused the same problems as the Korean. Now the box is expanded again and won’t contract. I tried refreshing and clicking "less", but it makes no difference. So far I haven’t found anything that looks like a Wiktionary cookie. —Stephen 03:43, 16 April 2009 (UTC)Reply
Nazism was an unfortunate choice of page, as the code to handle {{trreq}} had not yet been written. This should now be fixed. Sorry. (Are there any other templates I'm likely to come across, modulo {{ttbc}}) Conrad.Irwin 11:21, 16 April 2009 (UTC)Reply

language codes

noted you added support for language codes with - in them, but you haven't (yet) got the general case. You want something like:

{2,3}(-{1,7}|) or {0,8} would be okay

it is 2 or 3 letters, optionally followed by - and 6-7 more, that may contain -. Limit is 10. I usually just use {2,10}, although that allows "--abc" and other such nonsense (;-). We have zh-min-nan for example. (Although in that case we want to use cmn.) And, e.g., be-x-old (which, perhaps fortunately, has no wikt ;-) Robert Ullmann 14:43, 15 April 2009 (UTC)Reply

Thanks. Will do. 86.170.66.66 19:29, 15 April 2009 (UTC)Reply

Undo stack problems

If I enter and preview an addition, then undo, then enter and preview again, all three page editing buttons are disabled, and I'm stuck until I reload the page. Enter and preview, in the page controls to cancel, enter and preview again, and the buttons are disabled also.

Just a heads-up. I can do some more testing and produce a more detailed report if it would help. Tested in Safari 4 public beta (for Mac). Michael Z. 2009-04-15 19:23 z

I had timing problems in firefox. Maybe it's a similar issue. I've got a windows Safari 4 to play with, so I'll have a play now. 86.170.66.66 19:27, 15 April 2009 (UTC)Reply
I've set them to always be enabled, which while not ideal, is the only solution I've found. .disabled is being correctly set to "false" but the browser doesn't seem to notice. Conrad.Irwin 19:52, 15 April 2009 (UTC)Reply

Problem remaining with IE7

The add translation tool now works for IE7 but a problem remains: it does not add the entry in alphabetical order. For example, I added the Dutch translation to "hyperbolic" and it appended it to the end of the list, on the right side, whereas on Firefox it would (in the preview) show up in the correct place, between Czech and French, on the left side. —AugPi 02:18, 16 April 2009 (UTC)Reply

Another problem: when I tried adding a second Dutch translation ("oudheidkunde") to "archaeology" in IE7, it would also append it to the end of the list, on the right side, ignoring the pre-existing Dutch translation on the left side. Then I tried Firefox which merged the new term with the old one, separated by comma: correctly. Also, the superscripted link to nl.wiktionary should not be positive (blue) but negative (red) because there is no "oudheidkunde" entry in nl.wiktionary. —AugPi 02:45, 16 April 2009 (UTC)Reply

Now, I noticed that the AutoFormat bot corrected my "hyperbolic" edit. —AugPi 02:53, 16 April 2009 (UTC)Reply

Now fixed. Yes, the sorting isn't perfect precisely because only AutoFormat knows what the real order is :D. Should now be a good enough guess that it looks right, and appends new translations to existing language sections. Conrad.Irwin 10:23, 16 April 2009 (UTC)Reply

Disabling

Does the permanent disable code assume that one has WT:PREFS enabled? I don't, and adding the code above hasn't done what it says it would, tho the disable button above did work. — Carolina wren discussió 04:04, 16 April 2009 (UTC)Reply

No, the "Preferences" referenced there is specific to editor.js, that's really bizarre because the button just runs that code once. (The advantage of putting it in your javascript is that it runs it every time you log in). Conrad.Irwin 10:10, 16 April 2009 (UTC)Reply

Importing script to other Wiktionaries

First, thanks a lot for a great great script ... I've never added this many translations before! Just wondering, how much work is it to import this script to other Wiktionaries? Would one have to do heaps of changes to it? --Eivind (t) 08:17, 16 April 2009 (UTC)Reply

The first few hundred lines are boilerplate code that you can copy straight off. The hard bit is creating the plugins, at the moment there are two plugins one which adds translations (it's awfully in need of repair already ;D), and one which balances them (which is pretty nice still). If you were to transfer it to another Wiktionary (I have no time to do that currently, as my wiki-time is devoted to getting it working better here), you would need to write new plugins. Writing plugins isn't that hard in principle, you just need to create objects with three properties (redo, undo, edit and summary) and call "new Editor().addEdit()" with it. The "redo" and "undo" function modify the HTML page to provide a preview to the user, and the "edit" function edits the wikitext to provide the change; the complicated bit is ensuring that the HTML modifications accurately reflect the change - though "new Editor().page.parse()" will use the API to parse wikitext which can help. It would take a day or two of competent javascripting from someone who knows the formats used on the Wiktionary intimately. Conrad.Irwin 10:09, 16 April 2009 (UTC)Reply
If I find a time for it, I plan to add it to the French Wiktionary... It's a matter of time. :( --AglarEdain 06:33, 17 April 2009 (UTC)Reply
Cool. If you want to ask questions about it, I'm normally in irc://irc.freenode.net/#wiktionary as cirwin. Conrad.Irwin 09:00, 17 April 2009 (UTC)Reply
I adapt this tool for Lithuanian Wiktionary. That is great script. --Vpovilaitis 08:39, 22 May 2009 (UTC)Reply
Great! What changes did you have to make? Conrad.Irwin 21:39, 22 May 2009 (UTC)Reply
In Lithuanian Wiktionary are use translation line (in exampl for english translation of word run:
{{env1}} {{t+|en|run}}

)

for this reason was needed to change line parsing code and new translation line formating code, include Lithuanian names of languages and its changing to 2-3 simbol codes. And was needed translate messages and interface to Lithuanian language. You can see this code lt:Naudotojas:Vpovilaitis/editor.js. --Vpovilaitis 14:05, 24 May 2009 (UTC)Reply

Error message

When trying to add "benzoile" as the Italian translation of benzoyl I get error message "Could not find translation table for 'it:benzoile'. Please improve glosses". SemperBlotto 22:01, 16 April 2009 (UTC)Reply

Fixed, though I need to do more work on this. Conrad.Irwin 09:15, 17 April 2009 (UTC)Reply

Reporting working for Safari 3

Hello.

Firstly, I want to report the jscript works fine with my Safari Version 3.2.1 (5525.27.1) running on Mac OS X 10.5.6 (9G55).

Secondly, I work to add French translations everywhere they're lacking (supposing I'm able to understand the definition) AND I WANT TO THANK YOU!

Until now, adding translations was hard work... Since then, with the great help of your awesome script, it's still work but it's easier. I think I will be able to work twice faster, maybe three times.

I can only find one criticism: The blue window is not so much easy to target on its top-left corner for new users. And it's only a small detail.

Really, thank you. May I say I love you. No, it's exagerated. But I really appreciate your concern about translation adders.

Best regards.

--AglarEdain 06:29, 17 April 2009 (UTC)Reply

I've tried getting the window to flash bright green briefly, maybe this will make it easier to spot without hurting the eyes of other people too much. Conrad.Irwin 09:16, 17 April 2009 (UTC)Reply
On my computer (XP running Internet explorer, the save buttons and greenbox appear underneath the stuff at the top of the page. These buttons should be included with the preview buttons and stuff, not shunted aquardly somewhere else.
If you clear your cache (ctrl+shift+F5) they should now appear above stuff in the top-left of your window, it's still not close to the preview stuff because I wanted to emphasise that you can make many changes and then one save. Conrad.Irwin 14:20, 17 April 2009 (UTC)Reply

It has stopped working

I now get the left/right balancing arrows, but not the option to add a translation. SemperBlotto 08:31, 20 April 2009 (UTC)Reply

Now fixed. Sorry. Conrad.Irwin 09:38, 20 April 2009 (UTC)Reply
Thanks - now OK - and can confirm it works with IE8. SemperBlotto 09:45, 20 April 2009 (UTC)Reply

Language metadata thoughts

As we've discussed to keep the GUI sharp we really want to store facts about many languages in the Wiktionary: namespace just as we now store full English names for language codes. These facts I shall call "metadata".

There are a few basic differences in the major languages that will affect the GUI, and a whole bunch of exceptions we will have to put off until later.

  • Does this language use a script other than Latin?
  • If so which script?
  • If so provide a transliteration field in the GUI.
  • (exception: multiple scripts)
  • Does this language have grammatical gender for nouns?
  • If so which genders?
  • Provide these gender options in the GUI.
  • (exception: genders for other parts of speech)
  • Does this language have plurality of nouns? (Chinese and Japanese don't)
  • If so provide a field for the plural.
  • (exception: what about countable/uncountable)
  • Does this language have optional diacritics or vowels? (Hebrew, Latin)
  • If so provide a field for the full spelling and the basic spelling.

Any thoughts? — hippietrail 12:52, 20 April 2009 (UTC)Reply

In the near future I'd like to store these in the script itself, there is already some metadata there, the two further options are either to store them in some custom storage on the toolserver, or to store them in Template space so that other on-wiki can use them. It's not high priority for me at the moment, I'd rather support nesting and editing first, but if you want to implement this, I'll be happy to merge the changes. Conrad.Irwin 13:01, 20 April 2009 (UTC)Reply
Have a look at my metadata version of editor.js at User:Hippietrail/editor.js - it checks when you change the language code whether the new language has certain features and it automagically shows/hides the more/less section depending on whether the language uses either transliterations or optional vowels or diacritics. The text of the more/less button is not yet synched or I would be bold. The step after that is to make individual fields such as gender and plural hide/show. — hippietrail 01:17, 23 April 2009 (UTC)Reply
Looks nice, though I wonder whether, if the user has explicitly opened the "More" box, it should stay open; and whether clicking More explicitly should show all the hidden components - just in case we have an error in our metadata. Conrad.Irwin 09:01, 23 April 2009 (UTC)Reply

feature request

(Low priority.) If the only change is rebalancing, can it refuse to save (since AF will do the same, and also make other fixes, so don't waste the edit)? (I guess I should say, "Can the Save box only appear if a translation is added, not on rebalancing", but I'm not sure.)—msh210 17:37, 21 April 2009 (UTC)Reply

I was going to tinker with not showing the balance buttons until a translation had been added - yes, I think that's a good idea. Conrad.Irwin 17:44, 21 April 2009 (UTC)Reply
How about a third button that automatically balances? And how about a standard balancing algorithm so that AF and editor.js do it the same way perhaps? — hippietrail 03:56, 22 April 2009 (UTC)Reply
As it will (normally) require just one ← or → I don't see too much problem with the user doing it and it makes my life much simpler. I'm not saying I won't do this, but at the moment there are many more pressing things to resolve; if you want to implement it, please feel free. Conrad.Irwin 09:14, 22 April 2009 (UTC)Reply

Bug reports and feature requests for JavaScript extensions should be on Bugzilla

Hey guys it's really too hard to track bugs and features on talk pages. That's why I fought for our right to use the Wikipedia Bugzilla for stuff exactly like this. Please make use of it, it's very handy and it's being neglected:

hippietrail 01:10, 23 April 2009 (UTC)Reply

The main problem with bugzilla is that you don't instantly get to see all previous related discussion; and if you couple that with the need to create an account to use it, the techy-orientated interface, and the effort involved in getting CCs on a subset of bugs; my net feeling is that talk pages are much more suited to this kind of discussion. Yes, if we had a dedicated development team, that would be better - but as we don't, and bug reports come solely from people who can edit wiktionary, I feel that such discussion should be on the talk pages. Conrad.Irwin 08:58, 23 April 2009 (UTC)Reply

Your metadata improvements

Awesome! The GUI upating on change of language is lovely.

But there are bugs. When I try to "preview" additions I get a bunch of alerts with source code which I guess are exceptions being thrown for some errors.

This is fun to hack with you! — hippietrail 08:31, 24 April 2009 (UTC)Reply

Ach, no those were there for debugging - sorry. You can remove them if you want, there does seem to be a problem when gender for a language is undefined though. Conrad.Irwin 09:21, 24 April 2009 (UTC)Reply
Aha. Undefined gender, undefined language, or both? Examples? — hippietrail 09:58, 24 April 2009 (UTC)Reply
I've been thinking about your reservations with having all the metadata in one data structure. To keep it centralized and make it possible for consumers to get just what they want I might be able to make a data server on the ToolServer. I'll keep the full set of data there and you can call it for which languages and fields you want. Then you can from time to time cut and paste that into your code. Seems like a bit of trouble but it's the only way I can think to keep it centralized and minimal for more than one application. Now to reenable my toolserver account... — hippietrail 07:55, 25 April 2009 (UTC)Reply
That would make sense, it would also be useful if languages were divided into a few (largish) chunks, so that you can request lots of meta-data at a time. One chunk could be ISO 639-1, and then perhaps by letter for ISO 639-3. Conrad.Irwin 09:18, 25 April 2009 (UTC)Reply
You mean request all languages which have ISO 639-1 codes? I could set it up as an actual database in which case it could be queried by any field really. It would be a pretty small and straightforward database so should be pretty fast and it would be read-only. But I think I'll do it as a Perl program first since I don't like databases until I really need their functionality (-: — hippietrail 12:19, 25 April 2009 (UTC)Reply

Edittools for editor.js

I guess it would probably not be too easy to implement but Connel did hack Edittools to work with the search box once.

It's especially needed for languages that use non-Latin script and need rare diacritics for transliterations. Keyboard layouts don't have both )-: — hippietrail 11:08, 24 April 2009 (UTC)Reply

Doesn't your operating system offer something that works everywhere? It seems a waste of resources to duplicate OS functions which are not specific to Wiktionary, like international text entry.
If you use a Mac, you can enable multiple keyboard layouts in System Preferences > International > Input Menu, and switch between them with the keyboard menu. Also enable the Keyboard Viewer to help learn the layouts, and the Character Palette for access to all of Unicode. If you're determined, you can make custom keyboard layouts with Ukelele (I have made two that I use all the time). Michael Z. 2009-04-24 14:23 z
I have four keyboard layouts installed. I am not aware of any keyboard layout which includes for example both Devanagari and the Latin letters with the diacritics needed for the IAST transliteration. Many of these diacritics are not available on any keyboard layout at all.
Rare character input as such is not an operating system function but a function of EditTools, which has filled this need and has been expanding for several years now on the English Wiktionary and has spread to many other wikis besides. But it does not allow entering rare characters into the editor.js fields, just the main text editing area. — hippietrail 15:53, 24 April 2009 (UTC)Reply
There's no reason to restrict specialized text entry to wiki sites. It could certainly be useful on other websites, in your word processor, email program, etc. This is properly a function of the OS.
If you're using a Mac, then I can help create a keyboard layout for Devanagari + IAST. Perhaps the caps lock key can toggle between two modes. If IAST transliteration is deterministic, then another option is to create a text filter which converts any selected text to IAST, prompted by a Services menu item or keyboard shortcut. I'd have to do a bit of research, but I'm sure this is possible. Michael Z. 2009-04-24 16:20 z
Edittools exists precisely because people don't want to/don't know how to reconfigure their computer just to (in practice) use wiktionary. Yes, it would be great if everyone had all the keyboard layouts they need to hand; no it's not practical to assume them will . Similar functionality to what you describe exists under Windows and Linux, but people are generally reluctant to tweak configuration (bizarre, I know). I don't have the time to put edittools there myself, but it shouldn't be too hard to steal User:Connel MacKenzie/keypad.js and modify it. (Though a much better {for everything} solution would be to move all of edittools into a javascript file that is include on edit pages and when the user clicks some button to show it). Conrad.Irwin 09:25, 25 April 2009 (UTC)Reply
I planned to write that I'm not complaining about Edittools. But the more I think about it, the more I feel that this kind of work could be problematic in principle. I did go to some trouble to hide this and reduce other interfering page clutter in my Wikipedia user style. A developer spends energy duplicating OS functions for the project, and then I have to spend further energy hiding his work because it is obtrusive. We are working against each other. Edittools is unfinished or inadequate unless it works in every single text-entry field in Wiktionary, for both readers to search and editors to edit, but if it were completed, then it would sorely interfere with the site.
I do sympathize with the nightmare that changing even minor settings can become for Windows users. But the more specialized a computer user's needs, the more they need to use technical solutions to fulfil them. If they need to type Devanagari, then it may just make sense for them to learn how to bring up the Character Palette or Devanagari keyboard layout. Our resources are better spent helping them use their computers, then making a half-baked copy of software that they already have (great respect to our developers, but we don't have the resources and software framework of Apple or Microsoft).
I'm not able to help Windows users, but I am willing to help create a Mac keyboard layout if it will make a big difference for a Mac editor here. Michael Z. 2009-04-25 18:33 z
You are more than welcome to develop and announce on Wiktionary all the keyboard layouts you like. I can't afford a Mac. I don't know which OS our major Devanagari contributor, Dijan, uses or how he currently enters his scripts and transliterations. If you look through the edittools list you will see which alphabets, scripts, and sets of diacritics are used here. We use scripts including Arabic, Armenian, Bengali, Cyrillic, Devanagari, Ethiopian, Georgian, Glagoitic, Greek, Gujarati, Han, Hebrew, Hiragana, Kannada, Katakana, Khmer, Lao, Latin, Malayalam, Oriya, Punjabi, Sinhala, Tamil, Telugu, Thai, Tibetan. I've probably forgotten a couple. Some are used for more than one language and sometimes need different transliteration diacritics in different languages. And of course there are the pronunciation systems too. Others are not in great use here yet and might not have evolved one standard set of transliteration diacritics. Maybe if you ask on the Beer Parlour which of those would be most appreciated for our Mac-owning contributors you would know where to start first. Good luck. — hippietrail 00:08, 26 April 2009 (UTC)Reply
As I've mentioned before (a while ago now), edittools should be moved into Javascript and there should be a way to enable it for all text boxes. Whether or not it is useful to you is irrelevant, the fact that almost every Wikimedia project uses it should convince you that it is, if totally "incorrect" from a technical point of view, a necessity for users. The chances are, if it were well written javascript, it could be a standalone library that any site could easily include to provide highly multilingual input. It is on my todo list, but it's a long way down. Conrad.Irwin 00:35, 26 April 2009 (UTC)Reply
Well, I'm in favour of Conrad's plans, where do I vote? When I edit a page, EditTools bloats the requested HTML from 24 kB to 245 kB – that's one thousand percentMichael Z. 2009-04-26 16:21 z

Found in the wild...

See the recent history of cyclical.—msh210 17:27, 27 April 2009 (UTC)Reply

Meh. You any good at user-interface design? - because apparently I'm not :(. Conrad.Irwin 23:17, 27 April 2009 (UTC)Reply

"Please reformat" error

Hi. Am I doing something wrong? I get an error saying "Could not find translation entry for '...'. Please reformat" every time I try to add a translation not to the first table. In eat, for example. It's the same in Opera 9, Firefox 3, IE8. Hard refresh doesn't help. --Vahagn Petrosyan 08:57, 28 April 2009 (UTC)Reply

My apologies, I broke it a few days ago without noticing. (Why the function for searching for strings behaves differently from the function for searching for regular expressions only the language "designers" know). It should now be fixed if you clear your cache (ctrl+shift+F5). Conrad.Irwin 09:21, 28 April 2009 (UTC)Reply
Thanks! --Vahagn Petrosyan 10:03, 28 April 2009 (UTC)Reply


CHINESE

How do I add a translation under "Chinese"? You're excellent translation adding device will only let me add "Mandarin", but Chinese is the name that most people add translations under.

Fix {{zh}} or make a new language template, {{zh-real}} that will return Chinese. Please be patient, there are many other things I need to fix, and I have little time to fix them. (If you know javascript, you can probably help) Conrad.Irwin 09:14, 29 April 2009 (UTC)Reply

I use {{zh-cn}} or {{zh-tw}} sometimes. But if the entry has Simplified Chinese and Traditional Chinese both, I use {{zh-ts}} instead of this tool.--Dingar 01:59, 30 August 2009 (UTC)Reply

Script guessing for several languages

Hi. For {{cv}}, {{kk}}, {{ky}}, {{lez}}, {{mn}}, {{os}}, {{tg}}, {{tt}} languages {{Cyrl}} script should be automatically guessed. Can you add that?
And another small thing: I think it would be nice if the "Undo" button would fill back the boxes with the translation which is being undone. I, for example, almost always use Undo when I notice a typo after pressing "Preview translation". This way one wouldn't have to repeat the content. --Vahagn Petrosyan 08:33, 3 May 2009 (UTC)Reply

Aha! Language metadata is my territory now. I'll add them right away. — hippietrail 10:12, 3 May 2009 (UTC)Reply
Mongolian was already there but I've added the others too. Did you notice we can now also display just the appropriate fields for gender, plural, transliteration, and alt forms too? If you let me know those traits of the languages I'll add that as well. — hippietrail 12:10, 3 May 2009 (UTC)Reply
Nice! Here are some traits I know:
{{az}} - leave nothing
{{crh}} - leave nothing
{{cv}} - leave only transliteration
{{kk}} - leave only transliteration
{{ky}} - leave only transliteration
{{os}} - leave only transliteration
{{tg}} - leave only transliteration
{{tk}} - leave nothing
{{tt}} - leave only transliteration
{{uz}} - leave nothing --Vahagn Petrosyan 16:02, 3 May 2009 (UTC)Reply
Just to be sure I haven't misunderstood are you saying that noun of these languages have plurality for nouns? I thought that was rare outside East Asia. — hippietrail 22:49, 3 May 2009 (UTC)Reply
OK done except for plurality until I hear some more. — hippietrail 23:28, 3 May 2009 (UTC)Reply
Plurality had to be kept, of course. Now it's all correct. Thanks! --Vahagn Petrosyan 07:52, 4 May 2009 (UTC)Reply

Some testing

Hoi, I added a few translations and found the following

  • When there is whitespace in front and at the end of a new translation, the software fails.
  • When you remove this whitespace manually, the "other" magic does not happen

Thanks, GerardM 08:04, 4 May 2009 (UTC)Reply

Hi, I will fix this by just stripping the whitespace from front and back, but I am confused by what you mean by "other magic"? Conrad.Irwin 09:13, 4 May 2009 (UTC)Reply

Feature request: add translation requests via the GUI

It would be really nice if there were a way to request translations with editor.js adding {{trreq}}.

I'm not sure how to add it elegantly to the current GUI though. It would be better if the GUI wasn't there all the time but just had a couple of buttons that would bring up the rest of the GUI. — hippietrail 06:21, 7 May 2009 (UTC)Reply

I'd put it under "More" as a seperate button, probably alongside a "TTBC" checkbox (as requested at the top of the page). If we decide to do anything other than translations, then we will need some way of turning the buttons on and off - the good thing about the translations is that the editing form is hidden.Conrad.Irwin 09:39, 7 May 2009 (UTC)Reply
I just had an idea. How about keeping the edit form hidden until a big shiny new edit button between the arrow buttons on the table is clicked? The pages looks incredibly cluttered on a small screen with several small translation sections and a huge edit box in each one. — hippietrail 22:01, 7 May 2009 (UTC)Reply
One of the aims of having the translation interface was to encourage people to add translations - already one of our strongest areas, but still very very incomplete. While this is possible, I think it would defeat part of the purpose; I envisage (at a later stage) having some kind of interface at WT:EDIT where people can choose which interfaces are visible by default. Conrad.Irwin 22:57, 7 May 2009 (UTC)Reply

log issue

If you already saved the page, and try to save another edit on the same page, the log at the top left disappears. Thus you don't know what the script is actually doing. -- Prince Kassad 14:39, 8 May 2009 (UTC)Reply

Fixed. Conrad.Irwin 02:19, 10 May 2009 (UTC)Reply

Need for extra comments

editor.js currently just adds the edit comment "Assisted" with notes on which languages were added. But it should have in the "More" GUI a place to add a specific comment as well. For instance I just added several translations to alphabet from Wikipedia and I wanted to note that's where I got them from. — hippietrail 23:45, 8 May 2009 (UTC)Reply

This can be added, I was waiting for you to commit your changes to alt-form generation before I played around too much. Conrad.Irwin 17:50, 9 May 2009 (UTC)Reply
Ah OK I wondered why you hadn't been doing much. It's a rainy Sunday morning so I might get that done soon. — hippietrail 22:48, 9 May 2009 (UTC)Reply

Automatic transliteration

Hi, Conrad. I see you’ve added automatic transliteration to your TODO list. I don’t know how you’re planning to do it, but is it conceivable that some day the same functionality could also be used in inflection templates like {{ru-noun}} or {{hy-verb}} and everywhere else? --Vahagn Petrosyan 11:58, 10 May 2009 (UTC)Reply

Well, in theory, yes. In practicality, not unless someone writes an extension (not that hard) and it then gets implemented on Wiktionary (very much harder, thanks to politics). It would also be possible to create some kind of Javascript that could create a button that when you clicked it, could transliterate some text in the edit box. In the general case, complete transliteration may not be possible automatically, but I think in a majority of cases a very good guess can be made. Are there any common problems that you can for-see an attempt like this running into? My current plan is to do something like User:Conrad.Irwin/ipa2sampa.js with a few hacks for specific problems in specific languages. Conrad.Irwin 12:53, 10 May 2009 (UTC)Reply
At first, I thought it was better to rigidly bound transliteration feature to inflection templates like {{ru-noun}}, so that there was no way of changing the automatic transliteration result. That way we would be consistent with our transliteration standards because right now there are as many de-facto transliteration schemes, as there are editors. But now I see Javascript button is the way to go. With such button it’ll be possible to transliterate not only the inflection lines, but also Synonyms, Related terms, declension tables, etc., like in շեն. As to the problems that could arise, I don’t know Javscript, so can’t answer.
By the way, is User:Conrad.Irwin/ipa2sampa.js working? I've imported it, but I don’t see new buttons. I think I can use it for transcribing Armenian letters into IPA in pronunciation sections. The correspondence in armn2ipa.js will be regular 95% of the time. --Vahagn Petrosyan 14:36, 13 May 2009 (UTC)Reply
No, it doesn't do anything, sorry - just proof-of-concept code. You say armn2ipa is 95% regular, how regular is Armenian -> transliterated Armenian? Conrad.Irwin 15:02, 13 May 2009 (UTC)Reply
It’s 100% regular. But only if it is possible to take into accout this hack: the letter ու consists of two Unicode characters and should be transliterated as u. But whenever it’s constituent characters (independent letters themselves) are encountered separately, they should be transliterated as: ո - o, and ւ - w. Also, Georgian transliteration is 100% regular. So are Ukrainian, Belarusian, Bulgarian, Russian (no matter what Wiktionary:Russian transliteration says right now) and a dozen of other Cyrillic alphabets. --Vahagn Petrosyan 15:31, 13 May 2009 (UTC)Reply

Sort order broken for accented character

I'm just entering a couple of words from my Guatuso grammar. It turns out the Ethnologue/ISO/Wiktionary name for Guatuso is "Maléku Jaíka". editor.js just put "Maléku Jaíka" after "Maltese" which is wrong but it would be a bit of a pain to do either localised or accent-stripped sorting of language names in JavaScript. — hippietrail 07:20, 13 June 2009 (UTC)Reply

The order is the same for AutoFormat, so it's "correct" in a way. By this order, Maléku Jaíka sorts after Malto and before Mam, and Ömie sorts all the way after Záparo, but still before ǃXóõ. If you try to change the order, AutoFormat will fix it anyway. -- Prince Kassad 08:25, 13 June 2009 (UTC)Reply
I know it's a minor issue depending on your perspective but it's correct only in a "sorting by binary value" way which is meaningless to dictionaries and dictionary users. On which platform does AutoFormat run? If on *nix at least it shouldn't be hard to fix. And which programming language is it in? My next/previous extension sorts correctly using Perl running on Linux. It uses the underlying *nix UTF-8 locale which I think uses some official Unicode collation algorithm. This is not easy to achieve for editor.js but should be pretty easty to achieve for AutoFormat. I can help if need be. — hippietrail 08:41, 13 June 2009 (UTC)Reply
I won't fix this. If you want the order to be correct, fix AutoFormat which will re-sort the entry after a few minutes if it is wrong on save. (Solution two, change the language name to Guatuso :p) Conrad.Irwin 09:35, 13 June 2009 (UTC)Reply

Could not find {{trans-mid}}, please correct page

Hi! First, thank you for this wonderful tool. Here is what brings me here: in the molt entry, when I push the <-- button in one of the translation tables, editor.js tells me that it can't find {{trans-mid}}. However, I fail to see anything wrong in the wikicode. Is this a bug? — Xavier, 15:20, 21 June 2009 (UTC)Reply

Indeed, I can confirm this bug. It's not high priority since AutoFormat corrects any such translation tables, but it should be fixed. -- Prince Kassad 15:31, 21 June 2009 (UTC)Reply
Should now be fixed, I'd forgotten that number points to the start of the line, while the other points to the new-line character just before it. Conrad.Irwin 17:11, 21 June 2009 (UTC)Reply
Fixed, thank you! — Xavier, 21:48, 27 June 2009 (UTC)Reply

Missing genders for Norwegian Bokmål

Thanks for this great tool. One problem however: The gender check boxes disappear when I enter "nb" (Norwegian Bokmål) as language! (Should have the same genders as Norwegian.) Håkon 07:30, 23 June 2009 (UTC)Reply

That's my fault. editor.js gets its data about which genders a language has from my language metadata server on the Toolserver. I probably wasn't sure whether Bokmål had 2 genders like Danish or 3 genders like Nynorsk. I'm on holiday and behind a firewall right now but I'll try to fix it as soon as I can. — hippietrail 01:44, 24 June 2009 (UTC)Reply

Printable version

Form of the tool is shown on printable version. Can somebody disable displaying of it while printing? --Alexander Widefield 15:45, 27 June 2009 (UTC)Reply

now fixed if you clear your cache (ctrl+shift+F5). Conrad.Irwin 23:04, 3 August 2009 (UTC)Reply

t-balance

An interesting diff.​—msh210 22:13, 29 June 2009 (UTC)Reply

blank translations allowed

See recent history of ].​—msh210 23:19, 2 August 2009 (UTC)Reply

Fixed if you clear your cache (ctrl+shift+F5). (I think I introduced that regression when adding warnings about commas). As to the section above, I had hoped to have fixed that error shortly before you made that report - but I struggle to replicate it; if it is a persistent problem I can have another look - but otherwise I'll just shuffle it under the carpet for the moment (though if someone with more patience than me wants to replicate the conditions necessary for it, please let me know). Conrad.Irwin 22:36, 3 August 2009 (UTC)Reply


autostripping accents for pagenames

Slovene could use this... replacing the accented characters manually is a bit of a drag. I'm not sure of all the possible combinations, but Slovene has five (or six) vowels (a, e, i, o, r (yeah), u) and 3 accents, acute á grave à and circumflex â. So theoretically 36 possible changes, counting lowercase and capitals and assuming each vowel can take each accent (which they probably can't, but just to be safe, you know).

They're all optional (ie only used in dictionaries and stuff) and shouldn't appear in pagenames. Thanks :) — opiaterein01:43, 4 August 2009 (UTC)Reply

Don't forget <ẹ> and <ọ>, and combining diacritics as accents on them! Also, combining diacritic would be used for <r̀> and <r̂>. Also, sometimes inverted breve is used instead of circumflex, so adding those as alternative cases would be advised.. --Ivan Štambuk 01:57, 4 August 2009 (UTC)Reply
I've never seen the more complicated ones, I just wanted to make sure at least the basics were covered :D — opiaterein02:22, 4 August 2009 (UTC)Reply
Should I remove the under-dot from ẹ and it's other accented forms? I'm not sure if an error (like the inverted breve) should be ignored as that will presumably make occurrences of it harder to find in addition to providing a reason to perceive it as correct instead of an error. Conrad.Irwin 22:49, 4 August 2009 (UTC)Reply
Ok, I've partly answered my own queries by looking at w:Slovene_language#Prosody. I am taking it on faith, and using the following:
áÁàÀâÂȃȂȁȀéÉèÈêÊȇȆȅȄíÍìÌîÎȋȊȉȈóÓòÒôÔȏȎȍȌŕŔȓȒȑȐúÚùÙûÛȗȖȕȔệỆộỘẹẸọỌ
aAaAaAaAaAeEeEeEeEeEiIiIiIiIiIoOoOoOoOoOrRrRrRuUuUuUuUuUeEoOeEoO

And also removing: u'\u0301\u0300\u0302\u0311\u030f\u0323' (COMBINING ACUTE ACCENT, COMBINING GRAVE ACCENT, COMBINING CIRCUMFLEX ACCENT, COMBINING INVERTED BREVE, COMBINING DOUBLE GRAVE ACCENT, COMBINING DOT BELOW). Let me know if this is problematic or overkill. Conrad.Irwin 23:15, 4 August 2009 (UTC)Reply

Yessir... the only characters that have non-optional accents are č, š, ž and their majuscule forms.
All of them might be overkill, I don't think I've ever seen the ones with double acute/grave used, but it's probably possible in some dialects, so... better to have it than not, I guess. — opiaterein23:17, 4 August 2009 (UTC)Reply
There ya go then, (I'll still say clear your cache (ctrl+shift+F5) because I like the template). Conrad.Irwin 23:28, 4 August 2009 (UTC)Reply
Lol thanks man :) — opiaterein23:41, 4 August 2009 (UTC)Reply

seroius bug with multiple translations

There appears to be a pretty serious bug when you want to add multiple translations at the same time, and the new translations happen to be in a row of three (say, there's a Finnish and a Slovak translation, and you want to add German, Greek and Serbian, and the midpoint is not in this group). Then the following two things can happen when trying to add the third translation:

1. The third translation would end up in-between the first two. In this case you simply get an error.
2. The third translation would end up at the beginning or at the end of the group. In this case the translation will be shown correctly in the table, but it will not be saved when you click Save.

It used to work before so this seems to be a regression. It should be fixed as soon as possible. -- Prince Kassad 13:05, 21 August 2009 (UTC)Reply

Urm, that sounds bad. I will look at it when I get the time, hopefully this week-end but I can make no promises. Conrad.Irwin 22:39, 21 August 2009 (UTC)Reply
I tried adding Swahili Swedish and Tajik to WT:SAND in a few orders, and I got no error message, and it saved correctly. Can you be more specific with where you found problems? Conrad.Irwin 23:37, 23 August 2009 (UTC)Reply
Indeed it doesn't work with that combination. Try the following combination for the first bug (where it breaks with an error): kum, lez, lbe (in that order). This always seems to work for me. (Also, try adding lez first and then all the others, which seems to not work at all for me either) -- Prince Kassad 03:54, 24 August 2009 (UTC)Reply
Should now be fixed, if you clear your cache (ctrl+shift+F5). Conrad.Irwin 16:09, 30 August 2009 (UTC)Reply

small bug with {{trreq}}

Adding the trreqs doesn't work if the language is one of the ones that can have stripped accents and stuff. LT, SL, HE... etc. The error given is the "don't use wiki markup" one. Enjoy :) — opiaterein20:05, 2 September 2009 (UTC)Reply

D'oh, I should have foreseen that. Now fixed, {{clear your cache}}. Conrad.Irwin 23:46, 2 September 2009 (UTC)Reply

Stopped working

The editor's stopped working for me. I've cleared my cache, I've cleared all my temporary files and cookies, I've purged, and I still can't get it to appear. It works on Safari but not on IE8. —Internoob (TalkCont.) 17:42, 5 September 2009 (UTC)Reply

Maybe I'm having this same problem. The error I'm getting is "Could not find translation entry for 'ca:parkour'. Please reformat". It worked immediately before, on this edit, but stopped after that. — opiaterein22:19, 5 September 2009 (UTC)Reply
Your problems are now sloved if you clear your cache (ctrl+shift+F5). (Internoob: I forgot to test in Internet Explorer recently, and as a result was using osome techniques that fail to work there). (Opiaterein: When it detects there is a trreq in the HTML it looks for the trreq in the wikitext, but on parkour the trreq was nested under the heading and so it tried to look for {{trreq |Chinese}}, which of course does not exist in the wikitext). Conrad.Irwin 23:45, 6 September 2009 (UTC)Reply

closing the page editing box

The editor does not allow any more translations to be added after the X in the small box that appears in the top-left corner is clicked until the page is reloaded. Could you fix this please? BTW, the editor works in chrome 3. --Yair rand 05:35, 21 September 2009 (UTC)Reply

This should now be fixed if you clear your cache (ctrl+shift+F5). Conrad.Irwin 00:56, 23 September 2009 (UTC)Reply
Works great, thanks :) --Yair rand 04:20, 23 September 2009 (UTC)Reply

Err

After I added the Hindi definition to laudable and then tried to balance the table, it gave me this rather lengthy error message: ERROR: Enjoy :D — opiaterein14:51, 21 September 2009 (UTC)Reply

After a couple of edits to poetry, I'm hypothesizing that the problem only comes after already adding translations. — opiaterein15:25, 21 September 2009 (UTC)Reply
Hm, I don't notice this bug on water. Can you reproduce this in any way? -- Prince Kassad 17:22, 21 September 2009 (UTC)Reply
This was fixed just after I woke up this morning - it came to me in a dream :). Conrad.Irwin 19:10, 21 September 2009 (UTC)Reply


Bug in trreq / "presence" interaction

If I request a translation with {{trreq}} then accidentally close the "presence" window without committing my change, then once more attempt to request a translation for the same language I get an error telling me I can't request a translation twice for the same language. — hippietrail 04:33, 5 October 2009 (UTC)Reply

Fixed. Conrad.Irwin 13:59, 5 October 2009 (UTC)Reply

Gender help

I just used this tool for the first time, and stumbled over the lack of a link to help for the gender checkboxes. A precisely targetted page would be great, but failing that it would be at least useful to link to Wikipedia:Grammatical gender. (I was adding a Dutch translation, but needed to look up what "common gender" meant before I could be sure that "neuter" was really what I wanted.) Hv 11:55, 30 October 2009 (UTC)Reply

Hi, I've added a sentence to the instructions above (which you can get to by clicking the "Add Translation" link on every page). I don't know enough about it to make any authoritative assertions - perhaps someone could create Appendix:Gender or similar (though perhaps the definitions on common and neuter are good enough?). Conrad.Irwin 13:27, 30 October 2009 (UTC)Reply

Great, IMO

Hello. Your tool is just great. It helps a lot. I wish we could have this on the French Wiktionnaire (we want it, but we would probably have to adapt the code to our syntax, and nobody has done that - I for example don’t know much about javascript, even less about AJAX and interaction with Mediawiki…). Keep developping such magical things ! --Eiku (t) 22:49, 5 November 2009 (UTC)Reply

Hi, I think two other users so far have shown interest in porting it to fr.wikt - I `think` you'd be able to get away with just changing a bit of code in the "Util" object, and a lot of code in the TranslationAdders block - but I don't have the time to fully support this on any other Wiktionaries myself (I believe it's being used on lithuanian wiktionary, but they forked the code much earlier, when the code was arguably easier to understand and contained less very en.wikt specific features, and I think their template syntax is closer to ours than yours is). I'm very happy to lend a hand to anyone who wants to port it, I'm often to be found in #wiktionary on freenode, or this talk page, or by email. Conrad.Irwin 00:08, 6 November 2009 (UTC)Reply

t-balance gone??

Is my computer acting weird or is there a glitch? o.O 50 Xylophone Players talk 22:31, 16 November 2009 (UTC)Reply

I think it was changed so you can only t-balance while you're adding a translation. --Yair rand 22:33, 16 November 2009 (UTC)Reply
Yes, there were several instances where people would just click the arrows for no benefit - if you want to use them without adding a translation, then add a translation and click undo, the buttons will still be available. Conrad.Irwin 12:00, 17 November 2009 (UTC)Reply
Okay, thanks for telling me. 50 Xylophone Players talk 17:26, 17 November 2009 (UTC)Reply


Table labelling

There seems to be a small bug with the new table labelling feature. Whenever I click on the "±" icon, it brings me straight to the top of the page. --Yair rand 04:09, 17 November 2009 (UTC)Reply

Should now be fixed. Conrad.Irwin 11:58, 17 November 2009 (UTC)Reply


trans-top with vertical bar and no gloss

When the table top contains a vertical bar without gloss such as {trans-top|}, clicking the +/- sign opens the field in the gray bar but the field is not blank, it contains the first translation. This situation is immediately visible on the web page because the gray translation bar contains only the +/- sign but does not contain the word "Translations". --Panda10 22:46, 22 November 2009 (UTC)Reply

Old/Middle French

Hi, for fro and frm could you add the same options as for French. That is, masculine, feminine, plural (no neuter or common). Mglovesfun (talk) 14:38, 4 December 2009 (UTC)Reply

Finally done. Conrad.Irwin 00:27, 20 December 2009 (UTC)Reply

Translation sections inside a template

There seem to be some kind translation sections inside a template e.g. Template:color-colour (verb) in the verb section of color for which the tool does not work. Could this be fixed in the future or should these kind of template-translations be avoided ? Matthias Buchmeier 10:52, 4 March 2010 (UTC)Reply

It cannot be fixed, {{trans-see}} is a better way of dealing with this. One or the other should be converted to an {{alternative spelling of}} entry. (And in a perfect world, we should consistently chose one form of English for all words in this category). Conrad.Irwin 11:15, 4 March 2010 (UTC)Reply

legal/policy issues

Is there a legal problem with this in that it doesn't tell people that their edits are licensed? (In particular, are, in fact, their edits therefore not licensed?)

Also, it doesn't warn anonymous people that their IP addresses are going to be publicized. While this is probably not illegal, I wonder whether it's against WMF policy, considering that edit pages always so warn.​—msh210 18:20, 19 March 2010 (UTC)Reply

The terms of use are linked to at the bottom of every page, and it clearly explains the licensing stuff, so it's probably not a problem. --Yair rand 02:30, 26 March 2010 (UTC)Reply

#wikimedia on freenode, 21 Apr 2010 (times are off by several minutes from U.S. CDT):

 <msh210> Hi, all. Is there a WMF-wide policy for its projects that they warn an anon that his edit will reveal his IP address?
 <killiondude> Not that I've heard of.
 <bastique> It's in the MediaWiki software messages.
 <msh210> bastique, well, yes, except that enwikt has a JS-based way of editing pages that bypasses the action=edit page.
 <bastique> well, they should probably adjust that.
 <msh210> No, the point is that it makes it easy for peopel to edit. That is, the whole point is to bypass the edit page.
 <bastique> No, there's no policy.  It's good practice.
 == derp has changed nick to derp|brb
 <msh210> Oh, okay, thanks.
 <msh210> May I please copy-paste this conversation to enwikt, Cary, Killiondude?
 <bastique> only if you change my name
 <bastique> to...
 <killiondude> I don't mind.
 <bastique> Guest183832
 <msh210> Meaning, I can't quote you by name? That sorta defeats the purpose...  :-/  (I.e., I trust what you say largely because of who you are.)
 <msh210> thx killiondude
 <bastique> :)  Of course you can quote me
  * msh210 confused
 <killiondude> bastique likes to joke. :-p
 <msh210> ah, ok. got it.
 <bastique> :-ð
If you think it is necessary, I am happy for this to display a notice if you can show me how it should look - probably best to show it on the save dialog, there's nothing trackable at the "preview" stage, and that way all kinds of edit get the warning. Conrad.Irwin 22:57, 21 April 2010 (UTC)Reply

Anglo-Norman

No rush, but Anglo-Norman should allow m, f and pl like French, Old French (etc.) Mglovesfun (talk) 18:48, 21 April 2010 (UTC)Reply

I've had a go. Doesn't seem to be working. Unfortunately my ability to count brackets is not up to yours. Mglovesfun (talk) 22:29, 7 June 2010 (UTC)Reply
What you did looks right, and it seems to work for me now. (I cheat, by the way, http://toolserver.org/~enwikt/langmetadata.fcgi?fields=hw,sc,wsc,g,p,alt&sort=1&format=js :p). Sorry for not getting round to this for so long. Conrad.Irwin 22:41, 7 June 2010 (UTC)Reply
It means I should be able to add other languages that use only m, f and pl. Mglovesfun (talk) 11:22, 8 June 2010 (UTC)Reply

Possible bug

How about this. Is it a bug, or more likely clever vandalism? Mglovesfun (talk) 16:07, 27 April 2010 (UTC)Reply

It's a bug I thought I fixed a few months ago... Thanks for sharing. (I'll see whether I have permissions to edit the meta-data stuff for anglo-norman). Conrad.Irwin 17:33, 27 April 2010 (UTC)Reply

Language code 'nb' needs a fix

When adding translations for Norwegian Bokmål, the interwiki code used is 'nb'. There is no 'nb' dictionary, however, so the code 'no' should be used with the 't' template in stead, which is a dictionary for both Norwegian Bokmål and Norwegian Nynorsk. --Harald Khan Ճ 17:01, 28 April 2010 (UTC)Reply

Done, belated. Conrad.Irwin 12:27, 16 May 2010 (UTC)Reply

zh translation

Conrad, I have just added a Chinese translation to I need gasoline I got this:

* Chinese:
*: Chinese:
*: Mandarin: {{t|cmn|我需要汽油|tr=wǒ xūyào qìyóu|sc=Hani}}

It has an extra *: Chinese: on the 2nd line. Please have a look and fix if you can. --Anatoli 03:15, 8 June 2010 (UTC)Reply

Maybe the Arabic nesting doesn't show this behaviour, i.e. it doesn't generate extra lines. --Anatoli 06:11, 8 June 2010 (UTC)Reply
Done. The problem was that it misread the Mandarin translation as having a language code of "zh-Hani", I've now fixed it. (And the Chinese under Chinese problem you noticed before). Thanks. (you may need to clear your cache (ctrl+shift+F5)) Conrad.Irwin 09:55, 8 June 2010 (UTC)Reply
Thanks! Great effort! Working well now. --Anatoli 14:39, 8 June 2010 (UTC)Reply

fix me

-- Prince Kassad 10:43, 8 June 2010 (UTC)Reply

already done. Conrad.Irwin 11:21, 8 June 2010 (UTC)Reply

Missing colon

--Harald Khan Ճ 12:41, 8 June 2010 (UTC)Reply

Now fixed. Thanks. Conrad.Irwin 13:00, 8 June 2010 (UTC)Reply

funny businesses

Added 3 translations for Arabic, which had trreq and a nested Egyptian Arabic trreq underneath. Pretty neat, what happened Enjoy :) — opiaterein13:07, 8 June 2010 (UTC)Reply

multiple nested translations bug

Hi Conrad,

I noticed a bug (happened several times to me). When I add more than one translation using nesting (Serbo-Croatian/Cyrillic, Serbo-Croatian/Roman), the 2nd translation doesn't nest any more (the feminine forms appeared on the same line as "Serbo-Croatian"). The preview looked allright, though, which was confusing (you need to refresh to see the problem). Here's an example edit: I'm a Muslim into sh, which I fixed later. --Anatoli 05:14, 17 June 2010 (UTC)Reply

--Anatoli 05:17, 17 June 2010 (UTC)Reply

I tried to replicate the behaviour but the preview didn't show nesting and only one translation was nested, see above. --Anatoli 05:21, 17 June 2010 (UTC)Reply
I've fixed part of the problem - I'll see if I can still get it to misbehave now. Would it be useful to guess /Cyrillic or /Roman (you can miss out the language name to save time) based on whether the text contains a letter A-Š or А-Ш ? Conrad.Irwin 16:32, 17 June 2010 (UTC)Reply
Ok, I think that's now fixed, if you clear your cache (ctrl+shift+F5), thank you very much for noticing! Conrad.Irwin 16:58, 17 June 2010 (UTC)Reply
Thanks for addressing this problem. I haven't tested but it sounds good what you suggest (both suggestions). Please include lower and upper case letters. --Anatoli 07:38, 19 June 2010 (UTC)Reply

It looks betters but works well if I finish Cyrillic, then move to Roman - back and forth is not very good:

Perhaps this could be a sample for Serbo-Croatian translations, which covers both scripts and both major dialects: translations of president into sh:

* Serbo-Croatian:
*: Cyrillic: {{t|sh|пре́дсједнӣк|m}} (''Ijekavian''), {{t|sh|пре́дсједница|f}} (''Ijekavian''); {{t|sh|пре́дседнӣк|m}} (''Ekavian''), {{t|sh|пре́дседница|f}} (''Ekavian'')
*: Roman: {{t|sh|prédsjednīk|m}} (''Ijekavian''), {{t|sh|prédsjednica|f}} (''Ijekavian''); {{t|sh|prédsednīk|m}} (''Ekavian''), {{t|sh|prédsednica|f}} (''Ekavian'')

--Anatoli 00:57, 21 June 2010 (UTC)Reply

Needed improvements

Hello, I tried but there are still a few features to add:

  1. A button to create a ====Translations====\n{{trans-top}}\n{{trans-bottom}}\n paragraph.
  2. The possibility to choose de saving box location (the mouse is usually far from the top left when it appears).
  3. Make this box disappear after the backup.
  4. Warn if the entry already exists.
  5. Remove the genders boxes for the verbs, adverbs, conjunctions and interjections.
  6. Extract the code to be able to share it as a gadget in the other wikis.

Best regards. JackPotte 12:36, 11 September 2010 (UTC)Reply

I have some experimental code for 1., it needs work before it is stable enough to use on Wiktionary. 2. is an advanced feature, maybe better to define a keyboard shortcut for the save button. 3. Not much point, it's deliberately out-of-the-way. 4. Hadn't thought of that, good idea. 5. Yes — I keep meaning to do that, is it safe to remove them from everything except Nouns and Adjectives?. 6. Most of the code is extractable, but it will never work as a drop-in replacement for anything - it has loads of English Wiktionary specific stuff. See User:Conrad.Irwin/editor_docs for how to adapt this to other wiki's - please feel free to publicise that page. And encourage anyone who is interested to get in touch. Conrad.Irwin 23:41, 23 September 2010 (UTC)Reply
Thank you very much. JackPotte 17:58, 24 September 2010 (UTC)Reply
For 1. it already exists for synonyms under the form of this FF JS tool. JackPotte 16:53, 26 September 2010 (UTC)Reply

Some issues today?

I get "Could not connect to the server." I don't see anyone using the assisted method for translations. --Anatoli 05:10, 22 September 2010 (UTC)Reply

Hi Anatoli — There was a problem with Wikimedia's API on that day: https://bugzilla.wikimedia.org/show_bug.cgi?id=25238. Should now be working again. Conrad.Irwin 22:00, 23 September 2010 (UTC)Reply
Thank you, Irwin. Back in business. :) --Anatoli 22:25, 23 September 2010 (UTC)Reply


Question

(The code of the editor is incomprehensible to me, so I figure I should just ask here...) Is there any way to attach functions to be called after "Save Changes" is clicked, or any way to have it modify pages other than the page that the user is currently on? --Yair rand (talk) 19:39, 7 October 2010 (UTC)Reply

Do you mean that editor.js should modify (I think firstly create) the added translation page? To add some characters (like for the category system), or to get and modify another page (in JavaScript or like Commonhelper)? JackPotte 00:13, 8 October 2010 (UTC)Reply
At the moment, no, such a callback would be easy to add — why do you want it? If you want to modify other pages just use JsMwApi directly — the complexity of the editor stuff comes from trying very hard to maintain consistency between the DOM and the wikitext. (See: User_talk:Conrad.Irwin/Api.js#.edit()) Conrad.Irwin 10:12, 8 October 2010 (UTC)Reply
For a rhymes editor or an etymology editor one would need to have the DOM consistent with the newly changed wikitext of the page being viewed at the same time as having another page (the entry for the rhyme while at the rhymes list or vice-versa, or the descendants/derived terms section of the entry for the word being added to an etymology) modified at the time of saving. A callback at the save could have a function using JsMwApi to modify the other page, while making sure the page isn't modified if the user doesn't end up clicking save. --Yair rand (talk) 20:14, 8 October 2010 (UTC)Reply
You should now be able to have an after_save: parameter on the edit object you pass into addEdit. let me know how you get on. 22:29, 19 October 2010 (UTC)
Hm, it doesn't seem to be working... --Yair rand (talk) 03:40, 20 October 2010 (UTC)Reply
There appears to be a typo in the code: "thiz.withCurrentText(cleaup_callbacks);". (I'd rather not fix it myself as I don't have a clue how the script works or what fixing this will do...) --Yair rand (talk) 00:27, 26 October 2010 (UTC)Reply
I've fixed the typo, thanks for taking the time to debug it. Please go ahead and make changes in future — assuming you are watching this talk page you get to know quickly enough when things break :). Conrad.Irwin 13:27, 26 October 2010 (UTC)Reply


new bug?

* Chinese:
*: Mandarin: {{t|cmn|標準|sc=Hani}},{t|zh|标准|tr=biāozhǔn|sc=Hani}}
  • Chinese:
    Mandarin: 標準标准 (biāozhǔn),{t|zh|标准|tr=biāozhǔn|sc=Hani}}

there's no space between the two translations and one opening curly bracket is dropped. --Anatoli 01:55, 20 June 2010 (UTC)Reply

I think it's actually a very old bug - did you "undo" and "redo" this edit? If so, it should be fixed now. Conrad.Irwin 11:02, 20 June 2010 (UTC)Reply
I didn't use undo/redo but thanks for fixing. --Anatoli 00:58, 21 June 2010 (UTC)Reply

Not savin'

Might just be me, I'm on Firefox 3.5.2, but nothing at all is happening when I hit 'save'. I've tried it on several entries, but nothing works. — opiaterein13:45, 20 June 2010 (UTC)Reply

Newly noticed development - After I add one translation (which displays in the little dotted green box) no subsequent translations added will be displayed. — opiaterein15:18, 20 June 2010 (UTC)Reply
Sorry that was particularly moronic of me. Now fixed. Conrad.Irwin 20:37, 20 June 2010 (UTC)Reply


Removal of translations

It should be possible to remove existing translations in some way. When you have entries that are not nested, but should be; and you also want to add new translations, you have to edit manually. --Harald Khan Ճ 17:00, 21 June 2010 (UTC)Reply

I've been thinking about this, though I probably won't be able to do anything about it for some time. Conrad.Irwin 11:44, 30 June 2010 (UTC)Reply


Check out this edit, it seems when adding two terms (or more) terms to replace {{trreq}} it lists them on separate lines for no reason I can understand. Mglovesfun (talk) 13:44, 29 January 2011 (UTC)Reply

Now fixed. It was caused by the : after {{trreq}} 69.181.44.79 20:06, 2 April 2011 (UTC)Reply

added translations starting with a capital letter

I see in recentchanges a bunch of translations added using this script which start with a capital letter even though, it seems (not that I know the languages in question, usually), they should not. Is there a way for the script to test for this and either issue a warning to the editor or tag the translation (with some to-be-devised tag specific for this purpose or with {{ttbc}})? I'm thinking specifically of a test for: Is the word a proper noun or capitalized in English, or both a translation into German and a noun? (Any languages besides German capitalize all nouns, or any other part of speech?)​—msh210 (talk) 17:55, 15 February 2011 (UTC)Reply

There's a similar test for translations separated by commas — I'll see what I can do. Conrad.Irwin 07:40, 2 April 2011 (UTC)Reply
Ok. So "iff the page title starts with a lowercase letter, and the language is not german, and the translation starts with an uppercase letter" warn the user. It's hard to tell which part of speech is currently being edited (though I want to add that at some point so I can hide the genders and numbers). This is obviously not a very precise check, but I think it covers the majority of cases, albeit slightly conservatively. Conrad.Irwin 08:40, 2 April 2011 (UTC)Reply
To Msh210 (Any languages besides German capitalize all nouns, or any other part of speech?) - no, only German (and Luxembourgish). Worth noting that capitalisation rules from language to language, like pronouns can be capitalised in a polite writing, etc. Conrad, I see have you covered Cyrillic based languages, Greek and Armenian as well. Thanks for that! Sometimes words are obviously copied from Wikipedia where articles titles are capitalised. --Anatoli 11:44, 2 April 2011 (UTC)Reply
Thanks. I've added lb to the list of languages exempt from the check. As it's possible to override the warning (though maybe scary) I hope people will still be able to add pronouns correctly. Conrad.Irwin 19:27, 2 April 2011 (UTC)Reply

Accelerated adding of usage examples

What do think about employing the {{usex}} template for adding of usage examples? Using a template to tag and standardize syntactic elements of the data-base might IMHO greatly help future bot-operated maintenance of the project. Matthias Buchmeier 12:04, 1 April 2011 (UTC)Reply

As I now figured out added usex is a feature of User:Yair rand/editor.js and not yours, so never mind my post. Matthias Buchmeier 12:32, 1 April 2011 (UTC)Reply

nb

This edit done at my request should now either be undone or changed. nb should no longer be changed into no, as per WT:Grease pit#nb=no. Njardarlogar 13:57, 2 April 2011 (UTC)Reply

Done. Conrad.Irwin 18:52, 2 April 2011 (UTC)Reply
I think wikt_lang needs a fix? Njardarlogar 19:32, 2 April 2011 (UTC)Reply
Thanks... Coding with no caffeine is still fail. 69.181.44.79 20:04, 2 April 2011 (UTC)Reply

Problem at sniper

I am unable to add Norwegian translations to the second meaning of sniper. Get the error message Could not find translation entry for 'nn:asdasd'. Please reformat. The other meanings give no such error. Njardarlogar 12:49, 9 April 2011 (UTC)Reply

When playing around, I seem to be able to replicate the error consistently when the languages already in the list are *not* in alphabetical order, and I try to add a new language. Editing the entry and rearranging the translations seem to make the error go away. \Mike 01:59, 18 June 2011 (UTC)Reply

Red outline for AdderWrapper errors?

There's an interesting point in mw:Style guide/Error handling and validation#Field Local Error Notification, suggesting that input fields be given a red outline when there's a problem with the input. It might make sense to have that as the default behavior when an error is passed through the AdderWrapper. --Yair rand 19:39, 25 May 2011 (UTC)Reply

Language names support for all languages, autocompleting language

Inputting language names instead of ISO codes is only supported for languages in ISO 639-1, but I think it would be helpful to allow users to give just the language name for all languages, making use of the {{langrev}} subtemplates. Having the form autocomplete the language names would probably also be helpful, so what do you think of adding this above the bit above where langInput.onchange is set:

var langNameToCode={}
function langAutoFill(e){
	e = (e || event).keyCode;if((e >= 33 && e <= 40) || e == 8 || e == 46 || e == 27 || e == 16){
		return;
	}
	var t = this, v = t.value;
	if(v.substr(0,1) != v.substr(0,1).toUpperCase()){
		return;
	}
	JsMwApi()({action:'query',generator:'allpages',gapnamespace:10,gapprefix:'langrev/'+v,gaplimit:3,prop:'revisions',rvprop:'content'},function(r){
		if(r.query && r.query.pages && t.value == v){
			var l={}, ll={}
			for(var i in r.query.pages){
				var rqp = r.query.pages;ll = rqp.title < ll.title?ll:rqp;l = rqp.title > l.title?l:rqp;
			}
			if(!r && ll.title.indexOf(l.title) == 0){
				langNameToCode=l.revisions;
				if(l.title != "Template:langrev/"+v){
					if (t.setSelectionRange){
						t.setSelectionRange(, t.value.length);
					} else if (t.createTextRange) {
						var z = t.createTextRange();
						z.moveEnd('character', 0 - z.move('character', ) + t.value.length);
						z.select()
					}
				}
			}
		}
	})
}
langInput.onkeyup = langAutoFill;

and replacing the langInput.onchange line with

langInput.onblur = function(){
	if(langNameToCode){
		this.value=langNameToCode
	}
	updateScriptGuess.call(langInput)
}

? --Yair rand 14:15, 17 July 2011 (UTC)Reply

Rhymes

In this edit, (diff), why does it use lang=Old French not lang=fro? Mglovesfun (talk) 16:38, 8 September 2011 (UTC)Reply

The problem was that Old French doesn't have an ISO 639-1 code, so the script couldn't just grab the language code from the list of codes built in to editor.js. I've changed the script so that it pulls the language code out of the {{langrev}} subtemplates when the language doesn't have an easily available code. --Yair rand 20:32, 8 September 2011 (UTC)Reply

trreq problem

It seems the sorting mechanism bugs out when it would sort a language right before a {{trreq}}, and will refuse to add the translation. Cf. machete, where I had to remove the Latvian trreq before I could add the translation. -- Liliana 16:24, 23 December 2011 (UTC)Reply

diff

I thought the editor barred stuff with parentheses and whatnot? I see too many of these with qualifiers in the damned page names. — 01:06, 16 January 2012 (UTC)Reply

Problem when adding Cyrillic and Latin variants of sh terms

These diffs: diff, diff, diff, as well as these diff, diff, diff, classify the terms in the wrong drawer/language. There were prior instances of this problem, but I'm lazy to find them right not. If it is needed, I will. Cheers, --BiblbroX дискашн 18:34, 16 February 2012 (UTC)Reply

spaces

Hi Conrad, I have noticed that the recent behavior of accelerated translations is not to add spaces between the , and the {{t}}-template anymore, when new translation are appended. Is this change intentional? Matthias Buchmeier (talk) 16:52, 14 March 2012 (UTC)Reply

Nevermind, I've seen that the missing spaces feature is not active anymore. Matthias Buchmeier (talk) 16:57, 14 March 2012 (UTC)Reply

Page name tooltip

The tooltip for the "Page name" input box is "The word with all of the dictionary-only diacritics". Isn't that box supposed to be the translation with all of the diacritics and such removed? --Yair rand (talk) 11:48, 4 September 2012 (UTC)Reply

Macedonian

Regarding this diff: didn't it supersede Macedonian with Serbo-Croatian? Because they aren't the same nor does anyone knowledgeable that I know treat them so. --biblbroksдискашн 10:36, 23 October 2012 (UTC)Reply

Oops! I keep getting Macedonian and Montenegrin confused! Sorry about that. —CodeCat 12:14, 23 October 2012 (UTC)Reply
No problem. Cheers, --biblbroksдискашн 15:18, 24 October 2012 (UTC)Reply

Possible useless code

Hello. I'm trying to adapt this great script to Catalan Wiktionary and I've come up with a possible useless code that could bring a bug in future:

for (var i=0; i < cb.length; i++)
{
thiz.elements].checked = values];
}

As I'm using 1 less input fields than checkbox fields, I've found a undefined error when looping last check field (I think that values] never has any meaningful content for thiz.elements].checked). Do you think those 4 lines can be deleted? -Aleator (talk) 00:18, 11 January 2013 (UTC)Reply

need help for http://nds.wiktionary.org

In the http://nds.wiktionary.org we want also to have, that the users can input a translation without using the edit- (ännern-) button, like it is in the englisch Wiktionary possible. I have copy all translate templates, but it does not run. I think, it has something to do with the editor.js, that I could not found in the English wiktionary. Can you help me please?

I have renamed the templates: Översetten-Start (trans-top), Ö-Afstand (trans-mid), Översetten-Enn (trans-bottom) and Ö... (t...), but the changes are only translations of the name of templates, categories etc., but not in the codes itself. Can you please give me your answer on my userdiscussion page in the nds.wiktionary (: --Joachim Mos (talk) 14:00, 23 March 2013 (UTC)Reply

A while ago, I tried to adapt en.Wikt's translation-adder to de.Wikt (see de:Benutzer:-sche/uebersetzung.js). I eventually got it to work, but it was a lot slower here than there (so AFAICT it was never deployed). I, too, would be interested in more info. - -sche (discuss) 18:58, 23 March 2013 (UTC)Reply

Edit request

Please add the following code:

if (txt == 'no')
					return error("Please use the codes nb for Bokmål and nn for Nynorsk");

near the bit where it says "Please choose a foreign language". The language code "no" should not be supported for translations. --Njardarlogar (talk) 07:31, 27 March 2013 (UTC)Reply

I've made the change, but will explicitly note that I do not intend it to prejudice any decision by the community to combine the Norwegian lects at some later time back into no. - -sche (discuss) 01:36, 30 May 2013 (UTC)Reply

Minor edits?

I noticed that when I use the editor, my changes are marked as minor edits. That is probably because I have it set to default to minor in my preferences. But I don't think it's very desirable, adding a translation should always count as a major edit. Could this be changed? —CodeCat 23:18, 12 May 2013 (UTC)Reply

trreq language

I noticed that the editor adds {{trreq}} with the language name instead of the language code. While both are officially valid, language codes are normally preferred. Can this be changed? —CodeCat 14:26, 23 May 2013 (UTC)Reply

I've been irked by this a few times lately too. Often when I'm requesting translations I get an error message that it can't find the entry but it's very random and when I edit manually and find the mix of codes and language names for other trreq's I wonder if that's the cause. I wish I could read this callback spaghetti magic code and I would fix it myself (-; — hippietrail (talk) 05:30, 24 May 2013 (UTC)Reply
Hopefully the autosorting bot won't muck it up again and won't sort by the code, rather than by the name (lower case language code names appearing at the end of the table, obviously "fa" precedes "he", etc.). I think that was the reason why the code was changed for the name. --Anatoli (обсудить/вклад) 05:38, 24 May 2013 (UTC)Reply
I've reported a bug a long time ago. The problem exists with adding a translation where a neighboring language (alphabetically) has {{trreq}}, e.g. adding Macedonian (mk) when there is a Malayalam {{trreq}} (ml). I had to edit manually in such a case. --Anatoli (обсудить/вклад) 05:41, 24 May 2013 (UTC)Reply
Why don't we put the language name before {{trreq}}? That would solve the problem. —CodeCat 12:50, 24 May 2013 (UTC)Reply
Yes, it would probably solve the sorting problem (the new translation should replace {{trreq}}). Not the bug with {{trreq}} interfering with other languages though. --Anatoli (обсудить/вклад) 13:08, 24 May 2013 (UTC)Reply

,language utilities|lookup_language|BLAH|names}}:

What's the deal with this long string attached to each translation? --Anatoli (обсудить/вклад) 23:56, 29 May 2013 (UTC)Reply

It's a problem that has been reverted now, trying to find out why it happens. —CodeCat 00:01, 30 May 2013 (UTC)Reply
Thank you. --Anatoli (обсудить/вклад) 00:05, 30 May 2013 (UTC)Reply

Warnings for translation in the wrong script?

Can we give warnings to contributors using a wrong script (like Hindi in Roman letters, etc.), similar to the way when translations are capitalised (exception: German, Luxembourgian and proper nouns)? --Anatoli (обсудить/вклад) 00:56, 3 June 2013 (UTC)Reply

This is a great idea. It will be handy for the quite common mixing of Cyrillic and Latin letters in exotic languages such as Avar, Chechen, and Ossetian. The first two often have I, l, or 1 for the palochka and the latter often has the Latin æ for the Cyrillic letter of identical appearance. I believe some Latin letters are used amongst Cyrillic for a few Bosnian or Montenegrin words too. — hippietrail (talk) 07:05, 3 June 2013 (UTC)Reply
We would have to keep things in line with Module:languages though. —CodeCat 11:57, 3 June 2013 (UTC)Reply
It's just a feature request. Not sure about the implementation. We need a working script detection modules/template and language-specific rules. As Hippietrail suggested, the script could probably suggest to use "better" letters when some letters don't seem appropriate for a given language like it suggests to replace language code "no" for "nb" or "nn". --Anatoli (обсудить/вклад) 13:23, 3 June 2013 (UTC)Reply
I've written code to do this before in JavaScript though I've sadly lost it. First you need to split up the term into characters, being sure not to break surrogate pairs in two. Then you need an array with the start and end of each run of the same script for the entirety of Unicode. It sounds big but it's really not. Then to find the script for a character you do a binary search on this array. Binary search is very easy to program and very very fast. To create the array you need to process the Scripts.txt file provided on the Unicode site.
There are two script types that should be ignored, "Common" and "Inherited" though possibly you might be able to use even those when there are no other scripts in the term - this would indicate the term is not a word but some kind of symbol.
editor.js already includes a mapping of scripts to languages so given the language of the term and the scripts valid for it (sometimes more than one) you can find any mismatch. As a bonus it's also trivial to find any term using more than one script. I once had some Perl code that found all such terms in the dump file and I used to put them in a category.
Good luck! — hippietrail (talk) 06:48, 4 June 2013 (UTC)Reply

impf/pf parameters

Can the tool have the ability to add impf and pf parameters (or both), similar to how genders are added, please? It would benefit all Slavic and Georgian verbs, AFIAK. Example, a Russian translation of gnaw#Translations: грызть (ru) impf (gryztʹ). --Anatoli (обсудить/вклад) 00:16, 25 June 2013 (UTC)Reply

It can be done, but I think the way genders are specified might need some more thorough changes. It doesn't really make sense to use checkboxes because what you really want is to select individual genders, not any random combination of genders, numbers, imperfectivity and so on. So a radio button or a dropdown box would probably be better so that it's clear that the options are mutually exclusive. —CodeCat 01:01, 25 June 2013 (UTC)Reply
Well, one can mess up genders as well or put a wrong gender or two many genders, add gender to genderless languages or PoS's using the tool. One can add transliteration where it's not needed or write a translation in a wrong script. That's why we check and correct other people's translations. Or will it cause an error to a module, if there are errors? By putting impf/pf on a separate line with a short note (or better to wikilink to perfective/imperfective description) would probably notify the user that this is for verbs in some languages only. Adding validations is important but there are many more possible invalid possibilities the tool doesn't check for. (BTW, my edit toolbar has disappeared, signing manually). --Anatoli (обсудить/вклад) 01:27, 25 June 2013 (UTC)Reply
Of course, but that doesn't mean it isn't useful for the user interface to be logical. Using checkboxes when there is really only a limited number of sensible possibilities isn't good practice. What I would suggest is to have text boxes to enter the gender in "advanced" mode, but dropdown boxes or radio buttons that show only the genders that are valid for the language in "simple" mode. —CodeCat 01:31, 25 June 2013 (UTC)Reply
If you could make it happen, it would be great. Script validation and warnings (a topic above) would be another great enhancement to this tool, admittedly harder. --Anatoli (обсудить/вклад) 02:06, 25 June 2013 (UTC)Reply
Can these options be added, if there are no objections? E.g. Verb aspect (Slavic and Georgian verbs). imperfective (tick) perfective (tick). (According to Dixtosa (talkcontribs)'s categorisation, Georgian verbs also have this distinction, I'm not sure myself.) --Anatoli (обсудить/вклад) 00:08, 25 October 2013 (UTC)Reply
A while ago I tried to make some changes to the way genders are specified, but I ended up breaking the script a few times before I got it sort-of right. I'd rather avoid doing that again. I think Ruakh is a bit more comfortable editing it, but I think we also need to look at better ways to specify the genders. Radio buttons and checkboxes are inconvenient when a huge number of genders is involved, like say for Slovene (where there are over 10 possibilities). Maybe we should switch to using dropdown boxes? —CodeCat 00:13, 25 October 2013 (UTC)Reply
For me it's better than nothing but I prefer tickboxes, whatever is agreeable - better than having to add manually, especially if I want to add multiple translations into Slavic languages with both aspects. There are more/less buttons, so it shouldn't be a problem for those who hate too many options. Do the current options cover all Slovene possibilities? (Animate/inanimate are not really genders). BTW, what are Noun class:/ Plural class: options? --Anatoli (обсудить/вклад) 00:26, 25 October 2013 (UTC)Reply
The noun class is for languages that have numbered or named "genders" like the Bantu languages. Animacy isn't a gender, but it's specified as part of one and triggers agreement the same way, so I do think we should include it among the translations. —CodeCat 00:32, 25 October 2013 (UTC)Reply
As a design suggestion, we could use expandable sections, which could be hidden if not required. Like hiding verb aspects for non-Slavic translations and by default. No idea how hard it is.
With animacy, all Slavic gender possibilities would be big, not only Slovene. I'm neutral on adding this option to translations but I suspect there could be strong objections from others. Simply animate/inanimate tickboxes would allow multiple combinations, though. --Anatoli (обсудить/вклад) 00:43, 25 October 2013 (UTC)Reply
A tickbox wouldn't always work right. In Slovene, for example, only masculine nouns have animacy, so ticking it for a feminine or neuter noun wouldn't make sense. A dropdown box could just list all possibilities as mutually exclusive: m-an, m-in, f, n, m-d, f-d, n-d, m-p, f-p, n-p, pf, impf. —CodeCat 00:50, 25 October 2013 (UTC)Reply

Marking of Esperanto verbs as transitive or intransitive or both

All verbs in Esperanto should be marked as either transitive (tr) or intransitive (ntr) or both (ussualy marked with "X"). Could you add the possibility of specifying this to the script? Also, if the user is unable to provide with such a marking this should be considered an error in my view and followed up accordingly.--Liberumia (talk) 07:34, 23 August 2013 (UTC)Reply

I wonder if this should rather be in the {{qualifier}}. Transitive (tr) or intransitive (intr) are not currently part of verb headers but are used as context, as far as I know. --Anatoli (обсудить/вклад) 00:29, 25 October 2013 (UTC)Reply

Language codes should be checked for validity

And they are not. Resulting in things like this.

My recent additions to Module:JSON data may help in addressing this and another problem along the way… Keφr 18:05, 12 November 2013 (UTC)Reply

alt= gets added again when translations have stress marks/diacritics

I don't know what did it but see diff. Note that Ruakh's edit allowed to check for entries in FL wikis and +. --Anatoli (обсудить/вклад) 06:16, 12 January 2014 (UTC)Reply

When this script asked the MediaWiki API to parse {{#invoke:links|remove_diacritics|лесовик|ru}} {{#invoke:links|remove_diacritics|лесови́к|ru}}, it got back a script error (because Module:links no longer has a remove_diacritics function; see this edit). So this script couldn't verify that лесовик and лесови́к were equivalent, so it erred in the direction of assuming they're different (since that's the safer assumption). —RuakhTALK 07:17, 12 January 2014 (UTC)Reply
I've reverted the above-linked edit for now, though we probably don't want to keep that function there permanently if this is the only thing using it. —RuakhTALK 07:24, 12 January 2014 (UTC)Reply
I've put a note in Module:links that this script is using it so it won't be removed. Could someone make an inventory of all the module functions and templates that our scripts use, and add notes to each of them? Scripts don't create transclusions, so there's no way to find out when they use something. —CodeCat 14:00, 12 January 2014 (UTC)Reply

Performance with some languages

Adding translations for some language takes for ever or times out, e.g. Cantonese, Amharic. --Anatoli (обсудить/вклад) 08:13, 21 January 2014 (UTC)Reply

Fixing getVanillaIndexOf()

Currently getVanillaIndexOf() doesn't support nested templates, which is also marked with FIXME. The solution is really simple:

getVanillaIndexOf: function getVanillaIndexOf(str, text, pos)
{
...
...
else if (pos == tpos)
	pos = getVanillaIndexOf('}}', text, pos + 2) + 2;

Let me know if you have any questions. Skalman (talk) 18:28, 8 February 2014 (UTC)Reply

Old East Slavic (orv)

I can't add translations into Old East Slavic (orv). Is anything wrong with orv:{g:,sc:"Cyrl"},? It's identical to other languages with the same structure, e.g. Rusyn (rue). --Anatoli (обсудить/вклад) 01:13, 18 March 2014 (UTC)Reply

Missing space

A very minor complaint, but "(e.g. Cyrl for Cyrillic, Latn for Latin)" should be " (e.g. Cyrl for Cyrillic, Latn for Latin)" like the other examples. Otherwise it gets squished up against the text input. Kaldari (talk) 07:49, 14 June 2014 (UTC)Reply

Wrong order Icelandic/Catalan

This edit has inserted Catalan after Icelandic. --Vriullop (talk) 15:18, 14 June 2014 (UTC)Reply

It inserted it in the right place. It's Icelandic that was misplaced. —CodeCat 15:19, 14 June 2014 (UTC)Reply
Oh, of course, I did not notice Icelandic was before French. --Vriullop (talk) 15:33, 14 June 2014 (UTC)Reply

broken

That last edit broke this. I can't enter translations anymore. —Stephen (Talk) 13:50, 22 June 2014 (UTC)Reply
I’m not having any problem. Have you tried refreshing your browser? — Ungoliant (falai) 17:25, 22 June 2014 (UTC)Reply
Well, four more edits were made after that, and it started working again. —Stephen (Talk) 18:08, 22 June 2014 (UTC)Reply

This stopped working for me few days ago. It works when I'm logged out. --Vahag (talk) 16:56, 30 July 2014 (UTC)Reply

What do you mean by "stopped working"? Keφr 17:17, 30 July 2014 (UTC)Reply
It's as if the gadget is disabled. These are the errors I get in JavaScript Console of Chrome. --Vahag (talk) 18:26, 30 July 2014 (UTC)Reply
Everything else works? Also, have you got the "Enable legacy global scripts on by default, disable at your own risk" gadget enabled? Keφr 18:46, 30 July 2014 (UTC)Reply
Yes, I have that gadget enabled. Orange links and green links are working. Targeted translations and this tool are not working. Sometimes, when I refresh a page, they appear. Here is the JavaScript Console for when they worked and this is for when they didn't. --Vahag (talk) 19:24, 30 July 2014 (UTC)Reply
I think I know the nature the error, but its location reported in your screenshot does not make sense. Try again now. Keφr 19:40, 30 July 2014 (UTC)Reply
It's working again, thanks. --Vahag (talk) 20:03, 30 July 2014 (UTC)Reply
Wonderfool. Now I have no idea how I actually fixed it. Or whether I did. Keφr 20:08, 30 July 2014 (UTC)Reply

Capitalized language codes

Some platforms (iOS) automatically capitalize text-field entry. So if I enter “uk” it turns to “Uk”, and the script returns a not-too-helpful, and technically inaccurate, “invalid language code” error message. This could confuse users, and requires extra steps. It would be better if the script automatically neutered all caps in the entry. Thanks. Michael Z. 2014-06-30 15:01 z

ERROR:TypeError: undefined is not a function

I tried to add a translation to board up. I used 'nl' as language code and 'dichttimmeren' as translation. I pressed the 'preview translation' button. I saw briefly a green dialog in the top left corner that changed to blue with the error message 'ERROR:TypeError: undefined is not a function'. Difool (talk) 21:49, 8 October 2014 (UTC)Reply

{{ttbc}} messes up this script. It worked after that template was removed. — Ungoliant (falai) 22:00, 8 October 2014 (UTC)Reply

Feature request: Add a warning akin to "You are editing while not logged in. Are you sure?"

Because I accidentally contributed a translation while I was not logged in and now that edit will forever belong to an IP instead of me. If I manually edited the page I'd have seen this reminder at the top of the page: You are not logged in. If you save your edits to this page, your IP address will be recorded in the page's history. For that and other reasons, you should create an account. But as I was using the Add translation tool, I saw no such warning. (Also; After I logged in, the Add translation tool disappeared from the page. It only returned just now, after what must have been more than a couple refreshes.) 3ICE (talk) 09:22, 8 November 2014 (UTC)Reply

Malay (ms) need to install this feature

I try to implement the code in my /vector.js but it's like not displaying the funtions. Gotta help me! Thanks... SNN95 (talk) 16:41, 21 January 2015 (UTC)Reply

Automatic addition of script templates

Can we disable the automatic addition of the sc= template, as in this? They are not needed anymore. User:Benwing removed all redundant sc=Armn, sc=Geor, sc=polytonic's, but they are being readded by this tool. --Vahag (talk) 11:50, 20 July 2015 (UTC)Reply

I can't edit this file, but you can remove the addition of sc= for particular languages by editing the metadata starting on line 2213 and e.g. removing sc:"Grek" from el, sc:"Armn" from hy, sc:"Arab" from ar, etc. Looks like this was already done by User:ObsequiousNewt for sc=polytonic. Alternatively, if you think it's safe to never add sc= for any language, remove the code (values.sc ? '|sc=' + values.sc  : '') + from line 1548. Benwing (talk) 11:15, 21 July 2015 (UTC)Reply
Thanks. I am almost sure it is safe to never add sc= for any language, but I will let more technically-experienced users decide that. PS You should be able to edit protected pages. @Atitarev, please nominate Benwing for adminship, if he agrees. I would do it myself, but my brand is toxic :) --Vahag (talk) 14:21, 21 July 2015 (UTC)Reply
@Vahagn Petrosyan, Benwing Yes, I will nominate as soon as I have a bit more time. I'd prefer to ask someone else right as I am very busy these days :). If no-one does, I will, Benwing definitely qualifies. --Anatoli T. (обсудить/вклад) 14:30, 21 July 2015 (UTC)Reply

Could not find translation table for ' '. Glosses should be unique

Hi, is it possible to use this gadget on other wikis? I try to use this in hywiktionary but it always says "Could not find translation table for 'es:hola'. Glosses should be unique". Please help us --ԱշոտՏՆՂ (talk) 11:53, 8 December 2015 (UTC)Reply

\

Rhyme editor bug

Hello. I found a small bug with the rhyme editor: when adding multiple rhymes and some of them fail, the failed rhymes will still be listed in the edit summary. Example edit: diff. Redboywild (talk) 17:09, 27 February 2016 (UTC)Reply

Feature request for rhyme editor

I would like to make the rhyme editor use {{l}} instead of plain wikilinks. I have already been using {{l}} in Icelandic rhyme pages (e.g. Rhymes:Icelandic/œht) for a long time, and the current rhyme editor will not order new words on these pages correctly. This will mean that {{l}} would be standard in rhyme pages, at least for languages other than English; I suppose we'll have to discuss whether we want it on English rhyme pages as well. – Krun (talk) 12:13, 14 March 2016 (UTC)Reply

Consistency is pretty important here. If there's going to be a switchover from plain links to {{l}}, a bot should fix all the pages in the namespace before the script is modified, in my opinion. --Yair rand (talk) 22:04, 14 March 2016 (UTC)Reply
Yes, that would probably be best. – Krun (talk) 22:06, 14 March 2016 (UTC)Reply

Request

Hi, Your translation editor has a bug: every time a user types "hr" into the language field, your software changes it to "sh". The languages may be similar in a lot of respects, but are essentially different. Please see that you correct that. Thanks! Ivi104 (talk) 13:38, 16 July 2016 (UTC)Reply

That's not a bug, it's a feature. Serbian and Croatian (as well as Bosnian and Montenegrin) are considered one language here, following linguistic consensus. —Μετάknowledgediscuss/deeds 16:24, 16 July 2016 (UTC)Reply

Bug when adding a translation after editing table header

Hello, in case someone is able to struggle with this script, I noticed that, if you try to add a translation after editing a table header, it will raise an error (ERROR:TypeError: children.className is undefined). You can test in the sandbox. — Automatik (talk) 00:48, 24 January 2017 (UTC)Reply

Wiki markup in the translation

Could we allow using the | character so that I can add sum-of-parts translations using inflected forms?

As an example, I'd like to put ] ] (лонхны хүзүү) as a translation for bottleneck, literally "bottle.GEN neck". Crom daba (talk) 18:30, 18 February 2017 (UTC)Reply

Done. DTLHS (talk) 18:49, 18 February 2017 (UTC)Reply

Vec.wiktionary

Hi, I'd ask some programmer to add a standard displaying of "masculine/feminine" choices after inserting the code vec (Venetian language), the same as when inserting Italian translations. It's very useful when working with this language. Thank you --Tn4196 (talk) 20:19, 26 March 2017 (UTC)Reply

RFM discussion: April 2016–March 2017

The following discussion has been moved from Wiktionary:Requests for moves, mergers and splits (permalink).

This discussion is no longer live and is left here as an archive. Please do not modify this conversation, but feel free to discuss its conclusions.


User:Conrad.Irwin/editor.js to something better

This hasn't been Conrad's personal project for many years, so we should give it a name that reflects its full status on Wiktionary. I don't know what name should be used, or if there is a naming scheme for these kinds of things. I know very little of our JS infrastructure overall. But I do think this should be renamed. —CodeCat 16:07, 13 April 2016 (UTC)Reply

First off, editor.js actually contains two different chunks of code: translation-related stuff and the actual Editor class. I think we should
  1. make an opt-in gadget out of the former replacing this and
  2. move Editor in a separate file and let it be imported always because other scripts may depend on them (I know my scripts do).
Both should be in the MediaWiki namespace of course. --Dixtosa (talk) 17:27, 2 November 2016 (UTC)Reply
We should definitely move the codes from editor.js and User:Conrad.Irwin/creation.js and User:Conrad.Irwin/iwiki.js to their corresponding gadget pages as soon as possible because scripts that are in users' namespace load unminimized. I have tested this and minimizing editor.js alone saves us 40kb (~half of it). If my instructions above are not clear let me know. -Dixtosa (talk) 19:40, 5 November 2016 (UTC)Reply
Yes, please move to mainspace. It should also be renamed but I don't know what to call it. Equinox 19:44, 5 November 2016 (UTC)Reply
Moved to MediaWiki:Gadget-TranslationAdder.js. Feel free to separate the non-translation stuff mentioned above into a separate gadget. - -sche (discuss) 06:44, 27 March 2017 (UTC)Reply


Bugs in rhyme editor

There is a display bug in the rhyme editor that messes up the page when entering the first rhyme in an empty section (try adding a four syllable rhyme at Rhymes:English/ɒtəbəl).

I’ve also found another bug that causes new rhymes to be saved at the end of a section rather than at the correct alphabetical position, even though the entire section is apparently correctly sorted for display purposes after adding a word; i.e., when adding a word, it seems to have worked correctly, but when the page is reloaded or the code examined, one can see the incorrect ordering. – Krun (talk) 16:33, 9 November 2017 (UTC)Reply

(@Yair rand – Krun (talk) 11:59, 10 November 2017 (UTC))Reply
@Krun: Should be fixed now. --Yair rand (talk) 11:48, 12 November 2017 (UTC)Reply
Thanks for your help, @Yair rand. I have now, however, encountered more errors. It seems that {{rhyme list begin}}/{{rhyme list end}} are causing words to be saved after the {{rhyme list end}} line. Also, alphabetization is not working correctly. It seems that numerical character-based sorting is being done. We should ideally be using language-specific alphabetization but, failing that, defaulting to the Unicode Collation Algorithm. (I tested the gadget with words starting with accented letters). – Krun (talk) 14:13, 29 November 2017 (UTC)Reply
(See Rhymes:Icelandic/iː for an example of incorrect alphabetization) – Krun (talk) 14:16, 29 November 2017 (UTC)Reply
(@Rua, DTLHS, Yair rand, Dixtosa, JohnC5, Atitarev) – Krun (talk) 15:15, 1 December 2017 (UTC)Reply
@Krun: Changed the sorting system to use Intl.Collator.compare, which uses the Unicode Collation Algorithm. --Yair rand (talk) 17:34, 3 December 2017 (UTC)Reply
@Yair rand Great, thanks! The bug with {{rhyme list begin}}/{{rhyme list end}} is still there though (placing new rhymes after {{rhyme list end}}, but only when saving). See . – Krun (talk) 13:12, 7 December 2017 (UTC)Reply

@Yair rand Alas, there is one more. Interwiki links seem to get in the way as well: – Krun (talk) 18:27, 27 January 2018 (UTC)Reply

Customized sortkey function for language names

I adopt TranslationAdder to run on Thai Wiktionary. Everything works well except language sorting. Here's environment is just sorting by A-Z but another language needs different sorting method. Could anyone point me out how to add customized sortkey function for language names. (I suggest to have this function by default for other wiki's sake.) --Octahedron80 (talk) 07:44, 8 October 2018 (UTC)Reply

Edit conflicts

It seems possible there is a bug when several editors edit a page at the same time, and only the changes by the latter editor are actually saved (the latter diff removes the earlier changes), as can be seen in Special:Diff/50329271, Special:Diff/50329303 and Special:Diff/50550375. SURJECTION ·talk·contr·log· 21:14, 23 October 2018 (UTC)Reply

Chinese Mandarin: transliteration han4yu3 → hànyǔ

Editors adding cmn translations may find it troublesome to input tonal diacritics. If it gives "hànyǔ" by inputting "han4yu3", it will be of a great help. -- Huhu9001 (talk) 07:31, 12 February 2019 (UTC)Reply