Help talk:Extension:Translate/Page translation administration

Example templates made by the community: --Nemo 19:35, 22 March 2013 (UTC)
 * m:Template:Langcat for calling right category,
 * m:Template:Localized media,
 * m:Template:TNT for templates.

Lists
Short messages make it more likely getting a hit from the translation cache. That breaking a sentence is not okay, is not hard to understand but why this example? &lt;translate> &lt;/translate>&lt;translate> &lt;/translate> Why not making each point a single translation unit without giving the translator the option forgetting to include the bullet point, which is markup, IMHO and therefore should not be part of a translation unit: The reason you are using bullet-lists is that each point usually does not rely on another one. They can be freely moved around. That's why the HTML output is an -element = unordered list. -- Rillke (talk) 15:25, 30 October 2013 (UTC)
 * General principles
 * Headings
 * Images
 * Tables
 * Categories
 * Links
 * Templates
 * &lt;translate>General principles&lt;/translate>
 * &lt;translate>Headings&lt;/translate>
 * &lt;translate>Images&lt;/translate>
 * &lt;translate>Tables&lt;/translate>
 * &lt;translate>Categories&lt;/translate>
 * &lt;translate>Links&lt;/translate>
 * &lt;translate>Templates&lt;/translate>
 * It seems to me that this is exactly what the page currently says. :) It can only afford one example so it makes a middle way/generic one. Sometimes the whole list has to be in one unit, sometimes it's better to leave the bullet inside the unit for clarity, etc. --Nemo 15:33, 30 October 2013 (UTC)


 * I still prefer the first markup which is much simpler (only one pair of translate tags) and preserve the fact that they ar list items.
 * However when marking the page, the Yranslate tools should isolate each item in a separate item like this:

&lt;translate> &lt;translate> &lt;/translate>
 * General principles
 * Headings
 * Images
 * Tables
 * Categories
 * Links
 * Templates
 * i.e. Treat list item (eithier bulleted and unordered, or numbered and ordered) as well as as definition lists (and indented blocks) based on the prefixes "*", "#", ";" and ":" as separate paragraphs that make a separate translation. Treat them exactly like "==Headings==". Make sure that this separate blocks are kept into separate translation unit as they are never the same paragraph (though they may still be phrases in the same full sequence, even when their final punctuation is often dropped when it is an implied full stop for non-verbal sentences).
 * This would facilitate a lot the translation of long lists (without having to scroll vertically in the translate tool while looking at the source language at top but filling translation at bottom), and would allow the source to insert/remove some items or reorder them and wtill benefit from the translation memory.
 * Verdy p (talk) 02:29, 24 January 2014 (UTC)

Proposal: adding and
Something missing: I's like to have the following syntaxes supported and recgnized by the tool when marking pages:

 &lt;!--T:ins&gt; some wiki text to insert in translated subpages &lt;/--&gt; &lt;T:del&gt; some wiki text to remove in translated subpages &lt;/&gt;

These two kinds of pseudo-elements could be outside of translate tag pairs, but if they are, the "T:ins" would be visible as "$placeholders" in translation units, and the "T:del" would be invisible (they are only in the source, never in translations).


 * Notes
 * Insertions are placed within special HTML comments in the source, but not the deletions; see below why.
 * But if these pseudo-tags are integrated in the MediaWiki parser as regular tags the tags and contents of T:ins will be silently discarded, but only the T:del tags will be discarded, preserving their content: it will no longer be necessary to mask the T:ins into pseudo HTML comments and the special HTML comments for "T:id" used in source pages should become an "id=" attribute of the open "translate" tag (this would avoid cluttering the translation source pages with many line breaks.
 * The usage of abbreviated close tags should be deprecated using regular  instead of just.
 * The "translate" and "tvar" tags should also be integrated as regular tags, so that they are silently discarded when transcluding a page.
 * Later MediaWiki could intepret all these tags directly to perform what Template:TNT currently performs (i.e. locating a translation subpage during template transclusion, and resolving language fallbacks): Media-Wiki should also integrate the "Special:MyLanguage/" prefix so that they become directly usable instead of using the utility template:TNT or this utility template would no longer need a Lua module but would simply add this special page prefix to the invoked template.

Commented example of usage of and   pseudo-elements
The purpose of this is to allow using for example a "TNT|" prefix in a source translation which would be removed from all generated subpages named with the /code suffix.

Let's say we want to make the following template "Mytemplate", translatable using a "/layout" subtemplate (we want to create "MyTemplate/en" or "/fr" and so on from the "MyTemplate" used as the source):



We would first adapt this source page as:



This means:
 * delete " " before the base template name
 * insert " " after the nase template name

When marking the source page for translation it becomes:



Or it could also be:



(so that if the "T:ins" is in the middle of a translate element, it will have an identifier usable in placeholders for editing translation units (here it would be the $1 placeholder)

Mediawiki still interprets this base source page without the full "T:ins" tag and its content, as it is within HTML comments, and will drop the leading "T:del" tag and its ending short tag (just like it drops the leading and final "translate" tags but keeps their contents), but not its content. So it will render for the base source page as if it was still like:



When saving the generated "/en" subpage for English, it becomes exactly like the original untagged and untranslated version:



When we translate the English unit "some text..." into French "un peu de texte...", the generated "/fr" subpage becomes:



Then we can invoke  directly. Note that due to the fact that "TNT" is no longer referenced in the subpages, there will never be any self-recursion if we invoke  to use the English version directly.

It then becomes possible to design the base template so that it will automatically use Template:TNT where needed and without risk that it self-recurses within the translated subpages that TNT will attempt to locate and load, because the invokation of TNT is deleted in subpages !!!

Verdy p (talk) 03:29, 24 January 2014 (UTC)