Help:Extension:Translate/Message Bundles/pt

Os conjuntos de mensagens contêm cadeias de carateres no formato JSON de valor chave que, representando um grupo de mensagens que podem ser traduzidos. Cada chave representa uma unidade de tradução e o valor é a fonte da unidade de tradução que pode ser traduzida.

Ao contrário das páginas traduzíveis, os conjuntos de mensagens não têm páginas de tradução.

Permitir a integração do conjunto de mensagens

By default, the message bundle integration is disabled, to enable it, update your LocalSettings.php to add:

$wgTranslateEnableMessageBundleIntegration = true;

To be able to set source language of the message bundles to be different that the default wiki language, set $wgPageLanguageUseDB:

$wgPageLanguageUseDB = true;

We also recommend allowing translation administrators the ability to change the content model of pages (editcontentmodel right).

See Manual:$wgPageLanguageUseDB for more details.

Criar um conjunto de mensagens

Para criar um conjunto de mensagens:

  1. Comece por criar uma página wiki.
  2. Paste JSON content where the key and value are both strings. The key is the translation unit ID, and the value is the translation unit source.
  3. Save the wiki page.
  4. Go to Page information for the newly created wiki page.
  5. Change the page content model to Pacote de mensagens traduzíveis. This is done on Special:ChangeContentModel.

Example of a message bundle:

{
  "@metadata": {
    "sourceLanguage": "fr",
    "priorityLanguages": [
      "es",
      "en"
    ],
    "label": "Example message bundle",
    "description": "This is an example message bundle description."
  },
  "greetings": "hello",
  "body": "This is the body of the bundle.",
  "salutations": "Good bye",
  "signed": "Abijeet Patro"
}

The content under @metadata is not translatable.

Declarar um idioma fonte

To define the source language for a message bundle, add an object with the @metadata key in the message bundle content, and add the sourceLanguage key.

For example to set the source language to French:

{
  "@metadata": {
	  "sourceLanguage": "fr"
  }
}

To update the source language, wgPageLanguageUseDB should be set to true.

Definir os idiomas prioritários

To define priority languages for a message bundle message group, define priorityLanguages inside the @metadata object in the message bundle content.

For example to set the priority language of a message bundle to Spanish, Italian, Hindi and Odia:

{
  "@metadata": {
	  "priorityLanguages": [ "es", "it", "hi", "or" ]
  }
}

Additionally, the key allowOnlyPriorityLanguages inside @metadata can be set to true to disable translations to non priority languages completely.

Definir uma etiqueta

Labels defined in the message bundle @metadata will be used in the group selector on Special:Translate and as the page display title.

{
  "@metadata": {
	  "label": "My message bundle title"
  }
}

Adicionar uma descrição

To add a description for the message bundle, define it in the @metadata section.

{
  "@metadata": {
	  "description": "This is a sample description for the message bundle"
  }
}

Estrutura do conjunto de mensagens

Assume a message bundle MB-2024 is created with the following structure:

{ 
  "@metadata": {
	  "sourceLanguage": "fr"
  },
  "key-a": "hello",
  "key-b": "This is the body of the bundle.",
  "key-c": "Good bye"
}

The above message bundle has the source language fr.

When the message bundle is created the following pages will be automatically created:

  • Translations:MB-2024/key-a/fr
  • Translations:MB-2024/key-b/fr
  • Translations:MB-2024/key-c/fr

If key-a is translated to English then, the page Translations:MB-2024/key-a/en will be created with the translation.

Message bundles do not have translation pages.

Traduzir um conjunto de mensagens

Os conjuntos de mensagens não aparecem em Special:PageTranslation. Elas podem ser traduzidas:

  • Clicando em ⧼⧽ no topo da página do conjunto de mensagens.
  • Going to Special:Translate page and then searching or the name of the wiki page that was created in the group selector component.

Mover um conjunto de mensagens

Este processo é similar ao mover as páginas traduzíveis. See the following documentation.

Eliminar um conjunto de mensagens

Este processo é similar à eliminação das páginas traduzíveis. See the following documentation.

Ainda para fazer

  1. Ensure that Translation statistics for message bundles work (T360842)
  2. Ensure that message group stats for message bundles work
  3. Implement fuzzy for translations that are out of date
  4. Provide option to not fuzzy translations for message bundle when source string changes (T317736)
  5. Create a page where message bundles can be viewed similar to Special:PageTranslation (maybe core could provide a way to list all pages with a given content model?)
  6. Change display format for Message bundle source pages to display JSON in a properly formatted manner.
  7. Remove tags from message bundle page when content model is changed to something else from Translatable message bundle.