This page is a translated version of the page Newsletters/Translation and the translation is 16% complete.

Newsletters são uma forma de os wikimedianos se manterem informados sobre tópicos específicos nos quais estão interessados. Fornecer newsletters em outros idiomas além do inglês, amplia seu público potencial, já que muitos wikimedianos não entendem inglês. Outros podem ler em inglês, mas ainda preferem ler notícias em sua língua nativa.

A partir de 2014, existem ferramentas disponíveis que tornam a preparação e entrega de um newsletter multilíngue relativamente fácil:

  • A extensão Translate para tradução estruturada do conteúdo do seu newsletter;
  • O Assemble multilingual message módulo Lua para reunir todas as traduções de uma página em um texto a ser enviado através de wikis;
  • A ferramenta MassMessage para entrega global fácil de uma mensagem para uma seleção de páginas (ou assinantes) nos wikis da Wikimedia.

A maioria dos processos, ferramentas e dicas descritos nesta página foram criados e coletados pela equipe de Tech News. Você pode ler a postagem do blog para obter mais detalhes sobre como o newsletter técnico é preparado, traduzido e entregue em vários idiomas todas as semanas.

Se você encontrar dificuldades para configurar seu newsletter multilíngue, pode pedir ajuda a User:Guillaume (WMF).

Preparando e entregando newsletter multilíngue: Como funciona

In short, this is how the process goes:

  • When your content is stable, tag it and mark it for translation, and reach out to Wikimedia translators to ask for their help.
  • When your translations are ready, use the Lua script to combine all your translations into a composite text.
  • Use the MassMessage tool to send that composite text to your subscribers. If a translation is available for a wiki's content language, the text will be posted in that language. Otherwise, it will be posted in the default language (English).

This page focuses on assembling and delivering the newsletter and its translations. For more information about page translation and the Translate extension, see:

Initial setup

There are a few things you need to do the first time you want to send a multilingual newsletter. You'll only have to do this once.

Import the Lua script on your source wiki

Many newsletters are prepared on Meta and can use Module:Assemble multilingual message directly.

If your newsletter and its translations are living on another wiki, you need to import Module:Assemble multilingual message into that wiki. It's best to use transwiki import from Meta to preserve attribution and the history.

Create a sandbox page

The sandbox page is where you'll use the Lua script to automatically assemble the translations. For example, Tech/News/Sandbox is where the multilingual version of Tech News is assembled. For the moment, simply create a page for your newsletter with boilerplate text (please avoid main namespace).

Regular process

The process that follows is the one you'll go through every time you send an issue of your newsletter. The process is very detailed to make it easier to get started; once you've done it a couple of times, you probably won't need it any more.

Mark the content of your newsletter

You probably have content on your page that you don't want to include in the newsletter you send. This typically includes headers, navigation templates and categories.

The Lua script uses Labeled section transclusion to identify the actual content you want to send. Choose a marker like my-nifty-newsletter and tag your content outside of the <translate></translate> tags like so:

<section begin="my-nifty-newsletter"/><translate>The content of your newsletter starts here.
...
The content of your newsletter continues here.
...
The content of your newsletter ends here.</translate><section end="my-nifty-newsletter"/>

This is something you need to add to each issue of your newsletter, but once you've added it once it's a simple matter of copy-paste to add it to the next one.

Generate the multilingual message

 
The Lua script pulls all translations together to assemble the multilingual newsletter, ready for delivery.

At this point, you should have:

  • the Lua script
  • the sandbox page
  • the translatable newsletter you want to distribute; in the example below, we'll call it "My nifty newsletter/2014/August"

The process goes like this:

  1. Go to your sandbox page, and open the edit window.
  2. Add the following code:
    {{#invoke:Assemble multilingual message|assembleMessage|marker=|page=|}}.
    • marker= is where you add the marker you used above to tag your content;
    • page= is where you add the translatable page you want to send;
  3. After the page, add the list of language codes of the languages in which your page has been translated. For instance, add |es|fr|uk if your page has been translated to Spanish, French and Ukrainian. Do not add "en" for the English version: as the default language, it is automatically included.
  4. Your code should now be something like:
    {{#invoke:Assemble multilingual message|assembleMessage|marker=my-nifty-newsletter|page=My nifty newsletter/2014/August|es|fr|uk}}.
  5. Save your edit.

Voilà! This one line of code should now have generated a whole bunch of wikitext, that consists of a giant #switch parser function containing all the translations.

Send the multilingual message with MassMessage

 
The multilingual newsletter is delivered to subscribers across wikis by MassMessage; if a translation is available for the wiki's language, that translation is posted.

The Lua script does all the hard work: it goes through all the translations you give it, and assembles them together to generate a ready-to-send message:

  1. On the sandbox page, copy the whole content generated by the script;
  2. Open Special:MassMessage and paste the copied content into the field labeled "Body of the message"
  3. Scroll to the bottom, and add links to your userpage/usertalkpage before the timestamp (~~~~~). (A 3-tilde or 4-tilde signature would just be signed by "MediaWiki message delivery".)
  4. Fill out the other fields as you would do for a monolingual newsletter (see help about mass messages)

Known limitations

Lua script

  • You can't use tables for your newsletter's layout. Tables mess up the {{#switch used to select the appropriate language when the newsletter is posted. As a general rule, you should avoid tables and other complex formatting for newsletters, as they're easier to get wrong (see the general tips for newsletter authors).

Errors in one translation will break the assembled message when sent

  • If one of the translations has a markup error, such as an un-closed [[wikilink, it will break the assembled newsletter by showing all languages at once when you send it (to your test distribution list). To find the broken translation, add each language one at the time in the Assemble module.

See also