万维词典

主题:TADDER

(Redirected from Wiktionary:TADDER)

Usage

General

After you have made an edit with one of the installed tools (instructions for which are listed below) a blue box appears in the top left corner containing:

  • Save page
  • Undo
  • Redo

No changes made to the page are recorded until you press Save.

Editing translations

You should see a line at the end of the table something like

  • Help         :                       Preview translation More
    ◻ masc. ◻ fem. ◻ neuter ◻ common gender ◻ plural
  • The first box is the ISO 639-1 or ISO 639-3 language code (for common languages you can put in the language name, and it will give you the code).
  • The second box is the translation to add. This should normally be one word, if you attempt to add many separated by commas you will get a warning. If you want to request a translation set the word to {{trreq}}.
  • The gender tick-boxes are normally only needed for nouns, "common gender" tends to be used for languages where male and female have combined into one class, whereas "neuter" is a separate gender that is neither male or female.
  • Clicking Preview will try to make the edit, and display the Save page button in the top left.
  • Clicking more opens the extra options (really intended only for advanced users)
  • The second line contains gender check boxes, normally only one should be ticked. Though occasionally more are needed.
    • Transliteration: (tr=) The word as it might be transliterated into the Latin alphabet.
    • Qualifier: This is used if the translation only applies in a certain specific context, or under specific conditions. For example: (informally) and (literally).
    • Page name: (alt=) the name of the page when the word includes diacritics that are only normally found in a dictionary. This box may be automatically filled in for some languages (even when it is hidden).
    • Script template: (sc=) this only needs to be specified if you want something different from what it suggests.
    • Nesting: For languages that aren't already present in the translation table, the new language line may be nested under a language family heading. Or you may add translations with orthographic nesting. The syntax for this box is either: "Family Heading", "Family Heading/Language name" or "/Alphabet name".

Balancing translations

After adding a translation, two buttons will appear in the middle of the table:

  • Clicking "←" moves the first translation on the right to the end of the left list.
  • Clicking "→" moves the last translation on the left to the start of the right list.


Table Labelling

If you enable this feature, each translation table has a ± in the corner.

  • Clicking on this brings up an edit box for the table's header.
  • Type what you want in, normally the first few words in the definition (without linking or formatting)
  • Click "Preview" - if you are not happy with the result, click ± again - otherwise click "Save" in the top corner

WARNING: This feature has not been well tested in all browsers yet. Please notify me on this talk page if you have any problems.

You don't have the current version of the translation table gloss editor.


Disabling

Logged in users
Go to Special:Preferences and the Gadgets tab, then check "Disable translation table editor buttons"
Logged out users
You don't have the current version of the editor.
NB. Logged in users can disable it here temporarily, using the first method is recommended.

Adding definitions

The "Toolbox" section of the sidebar on the left includes a button labelled "Add definition". Clicking this will cause a "Definition" box to follow the mouse. Type in a definition and click on an area of a definition list to add the new definition to that list. Clicking anywhere outside of a definition list while the "Definition" box is following the mouse will cause the box to disappear.

Adding rhymes

You should see a line at the bottom of each "syllables" section of each rhymes page that looks something like this:

Add new rhyme:                   Add

Typing in a rhyme and clicking "Add" will preview the addition of the new rhyme to the rhymes page. Clicking the "Save page" button in the blue box that appears in the top left corner will then save the change to the rhymes page, and update the entry of the newly added rhyme(s) to link back to the rhymes list in their pronunciation section(s). The rhymes adder can be disabled by going to the "Gadgets" tab of Special:Preferences and selecting "Disable the rhymes editor".

Coding

This code adds an input box below the translation table and passes an edit-object to the Editor.js-script when the user press "preview". It stores settings in cookies for every time the user press save on the blue editor-popup.

At the basic level, edits can be made by passing an edit object to the editor. Edit objects consist of a "redo" function which modifies the page HTML to reflect the edit, an "undo" function which does exactly the opposite of "redo", an "edit" function which performs the edit, and a "summary" string to be added to the edit summary.

TODO

Bugs/Enhancements
  • Handle API errors.
  • A field for additional edit summary
  • Reset checkboxes and fields when language code is changed
Features
  • Edit existing translations.
  • Add translation gloss.

Discussion

Old discussion is at here, please feel free to copy it back to this page if it still needs attention.

Mobile browser support?

Is it easy to do this? Where would I start?--So9q (talk) 14:42, 30 August 2019 (UTC)

Unfortunately I do not know the gadget very well. It's kind of messy. (People have requested other changes that I couldn't figure out how to implement.) — Eru·tuon 19:25, 30 August 2019 (UTC)
I found out that MediaWiki:Common.js is not loaded on mobile, only MediaWiki:Mobile.js. commons.js loads MediaWiki:Gadget-AGprefs.js which loads the list MediaWiki:Gadgets-definition which includes translationadder. Adding TranslationAdder manually to Mobile.js should make it run there.--So9q (talk) 15:10, 31 August 2019 (UTC)
I think I need Interface Administrator rights and play with MediaWiki:Mobile.js to make this work on mobile.--So9q (talk) 18:35, 31 August 2019 (UTC)
You can experiment with Mobile.js in your username space, but note that ResourceLoader is disabbled by default on mobile. See mw:ResourceLoader/Writing a MobileFrontend friendly ResourceLoader module. --Vriullop (talk) 19:09, 31 August 2019 (UTC)
Thanks for the tip. I got it working :)--So9q (talk) 21:30, 31 August 2019 (UTC)
So9q, thanks a lot for trying to make this work! Your suggestion that involved editing common.js mostly worked for me. The appearance of the input boxes was a bit weird (they had no border), and I had to scroll to see the preview, but otherwise it worked.
I'm very interested in making it usable on mobiles without having to edit the personal common.js file. This may be very useful as a microcontribution for people in upcoming languages, especially in Africa.
If there is a concern that it will cause many unwanted edits, as Chuck Entz says at Wiktionary:Grease_pit/2019/August#Making_TranslationAdder.js_work_on_mobile_browsers, perhaps it can be enabled only for logged-in users first. --Amir E. Aharoni (talk) 19:11, 19 November 2019 (UTC)
Hi! Thanks for your reply. I hope to see more translations into upcomming languages, however since working on this above I concluded that wiktionary is not the right place to put my translation contributions. I now favour Wikidata Q-items and translate there instead as it is much better adapted to 1) handle a huge number of translations that the wt:Lua enabled templates simply cannot handle 2) has about just as many concepts as wiktionary albeit in a somewhat less userfriendly UI. We could make a simple translate WD Q-items mobile app that works on the basis of word-lists or something like that. I welcome you to join wikidata! —⁠This unsigned comment was added by So9q (talkcontribs) at 20:17, 19 November 2019 (UTC).
I actually agree that Wiktionary is far from having a very good structure, but at the same time Wikidata is a bit too young and too difficult for new users to contribute to. Also, despite the technical imperfection, Wiktionary has a lot of good content and an active and dedicated community. So at least for the foreseeable future both are useful. --Amir E. Aharoni (talk) 14:05, 20 November 2019 (UTC)
Hi, Amir, off topic FYI. I've been playing around to show Wikidata labels in translation tables. See ca:parlament. It's just a test, not sure how it will end up, maybe as a tool for helping with translations. --Vriullop (talk) 19:03, 25 November 2019 (UTC)
Off-topic, but good! --Amir E. Aharoni (talk) 20:15, 25 November 2019 (UTC)

Solved: How to test changes to the code?

Hi, I would like to work on this gadget. How would I go about testing my changes?

I put the code into my common.js. I did not find out where to disable the wikiwide TranslationAdder.js in any of the preferences (that is possible in the danish wiktionary under gadgets).

Now I have 2 translationadder-boxes. Any clues how to disable the wikiwide one?--So9q (talk) 09:28, 31 August 2019 (UTC)

I found the preference-setting to disabling the translationadder.js: "Enable the buttons that allow editing of translation tables.". Unfortunately it even disables my customized script in my common.js.
Does anyone know how to work around this?--So9q (talk) 10:58, 31 August 2019 (UTC)
The problem may be that you haven't loaded the dependencies before loading the translation-adder script. The gadget system automates this, but when you manually install the translation-adder gadget you have to manually load its dependencies. The list of dependencies is found at MediaWiki:Gadgets-definition. (User:Erutuon/scripts/gadgets-definition.js reformats the page to add links and make it a bit more readable.) I think the basic syntax is mw.loader.using([ /* dependencies as strings: 'ext.gadget.Editor', 'ext.gadget.LegacyScriptsNewNode', ... */ ]).done(function () { /* script requiring dependencies */ });. You can put the whole translation adder script into the "script" slot (in User:So9q/TranslationAdder.js), or put the importScript( 'User:So9q/TranslationAdder.js' ); statement there (in User:So9q/common.js), whichever makes more sense to you. Some of the dependencies might have their own dependencies though. — Eru·tuon 18:51, 31 August 2019 (UTC)
Thanks for you reply. It was dependency related and I solved it by adding them as needed based on error messages from the Chrome JS console. --So9q (talk) 04:04, 1 September 2019 (UTC)

Added literal translation field

Hi, I just added that here in my improved version.--So9q (talk) 14:54, 19 September 2019 (UTC)


本页面最后更新于2021-04-03 18:27,点击更新本页

本站的所有资料包括但不限于文字、图片等全部转载于维基词典(wiktionary.org),遵循 维基百科:CC BY-SA 3.0协议

万维词典为维基百科爱好者建立的公益网站,旨在为中国大陆网民提供优质内容,您还可以直接访问维基词典官方网站


顶部