Topic on User talk:Shirayuki

Markup for incomplete translations

8
Tacsipacsi (talkcontribs)

Hi! I see that you introduced |1= syntax for multiple pages. This is important and thanks for it, but it would be even more important if not only outdated, but also missing translations were marked in the wikitext. This is a new feature, enabled this week, but doesn’t automatically apply to pages in order not to break the whole wiki because of errors like missing |1=s. To enable it on a given page, you can tick “Use latest syntax version for this page” at the very bottom of the mark for translation page (after thoroughly checking the page for issues like unnamed parameters or use of translate tags where wikitext is not allowed, like HTML attributes; in the latter case, you can use <translate nowrap> instead of <translate> to disable marking both missing and outdated translations). While enabling the markup for untranslated texts is not a strict necessity, it greatly improves accessibility, so it would be great if you could migrate at least pages you touch anyway. Thanks in advance!

Shirayuki (talkcontribs)
Nikerabbit (talkcontribs)

I would like to add, that when splitting paragraphs, I recommend using this formatting:

<translate><!--T:1--> Text.</translate>
<translate><!--T:2--> Text.</translate>

In the above, untranslated or outdated sentences will get <span> wrapping.

If you do it like this:

<translate>
<!--T:1-->
Text
</translate>
<translate>
<!--T:2-->
Text.
</translate>

Untranslated or outdated sentences will get <div> wrapping and this breaks the paragraph flow. For example see the first paragraph in Development policy/fi which is split into two.

Shirayuki (talkcontribs)

I am using the style below to find translation unit markers quickly.

For this style, can the extension add <span> wrapping instead of <div>?

<translate>
<!--T:1-->
Text</translate>
<translate>
<!--T:2-->
Text.

<!--T:3-->
Text.
</translate>
Nikerabbit (talkcontribs)

Translate cannot know which one to add. It uses line breaks in the content as heuristics. If there are no line breaks, then it uses spans.

Tacsipacsi (talkcontribs)

@Nikerabbit: Do all line breaks count, i.e. before the unit ID, right after the unit ID and at the end? I looked at the code a while ago, and I recall that the line break check occurs after some preprocessing. Am I wrong?

@Shirayuki: The span syntax should be used only when the translation units actually form one paragraph and have no syntax that should be at the start of the line. See the last paragraph of Help:Extension:Translate/Page translation administration/lb#Anatomie vun enger iwwersetzbarer Säit for a bad example: it contains an unordered list syntax (*) and a definition list syntax (:), both of which are only valid at the very beginning of the line and thus they break if they are embedded in a <span> (with no line break after the open tag).

Nikerabbit (talkcontribs)

All line breaks count.

Shirayuki (talkcontribs)
<translate>
<!--T:1-->
* block text.</translate> <translate><!--T:2--> inline text.</translate> <translate><!--T:3--> inline text.</translate>
<translate>
<!--T:4-->
* block text.
</translate>

Actual result (untranslated or outdated):

  • block text.

inline text. inline text.

  • block text.