Convert PT AO90 for GlotPress

Descrição

Este plugin para o GlotPress altera comportamento por omissão dos Locales de Português, permitindo-lhe converter automaticamente as strings aprovadas/actuais em Português para a variante Português (AO90).

Mantenha as traduções da raiz Português (Portugal) automaticamente convertidas e sincronizadas com as respectivas traduções da variante Português (Portugal, AO90) na sua instalação do GlotPress.

Opcionalmente, é possível desactivar a edição, aprovação e importação de traduções da variante Português (Portugal, AO90), tornando-a apenas de leitura.

As únicas traduções adicionadas à variante Português (Portugal, AO90) são aquelas que são diferentes da tradução raiz Português (Portugal).

As strings que não precisam de conversão permanecem não traduzidas na variante, recorrendo ao Locale raiz.

Este plugin foi fortemente inspirado na solução Serbian Latin para transliteração do Locale Serbian Cyrillic em translate.wordpress.org.

A conversão de idioma utiliza a ferramenta de código aberto Convert PT AO90 para substituir palavras a partir de uma lista integrada.

Funcionalidades

  • Verifica se o GlotPress está activo.
  • Verifica a existência dos conjuntos de tradução raiz pt e variante pt-ao90.
  • Converte traduções actuais da raiz Português e adiciona-as às traduções da variante Português (AO90).
  • Elimina da variante as traduções não utilizadas em vez de as manter como rejeitadas, imprecisas, obsoletas.
  • Elimina traduções actuais da variante caso as traduções adicionadas à raiz (mesmo original_id) não precisem de conversão.
  • Sync button for GlotPress administrators to force convert the complete translation from root set to variant set.
  • Realça as diferenças nos textos convertidos automaticamente.
  • Modo de leitura: Use o filtro gp_convert_pt_ao90_edit para desactivar a edição, aprovação e importação de traduções na variante pt-ao90.
  • Optionally you can always save the translations to the Variant, this overrides the fallback to the root Locale. Return true in the new filter gp_convert_pt_ao90_always_create_variant_translation.
  • Conversion highlight: Use the filter gp_convert_pt_ao90_showdiff to optionally disable the conversion diff highlight.
  • Supports GlotPress 3.0.0-alpha.4, with the real variants and fallback feature.
  • Supports GlotPress 4.0.0 (current development), without the real variants and fallback feature.
  • Supports Traduttore for also schedule the language-pack build for the converted variant.

Requisitos

  • GlotPress 3.0.0-alpha.4 com suporte para Variantes.
  • GlotPress 4.0.0 without Variants support.

  • Conjunto de tradução (raiz): Português

    • Locale = pt;
    • Slug = default;
  • Conjunto de tradução (variante): Português (AO90)

    • Locale = pt-ao90;
    • Slug = default;

Ecrãs

  • Tabela de tradução com traduções originais a cinzento e traduções convertidas automaticamente a verde, com as alterações de conversão realçadas
  • Tabela de tradução da variante apenas com traduções convertidas automaticamente a verde, com as alterações de conversão realçadas
  • Botão de sincronização para forçar a conversão completa entre a tradução do conjunto de raiz e o conjunto da variante

Perguntas frequentes

É possível tornar a variante Português (Portugal, AO90) só de leitura?

Como as traduções são convertidas automaticamente a partir da raiz Português (Portugal), pode tornar a variante só de leitura, desactivando a possibilidade de os utilizadores editarem, aprovarem e importarem traduções para a variante.
Para tornar a Variante PT AO90 só de leitura, é possível utilizar o filtro da seguinte forma:
/**
* Desactivar edição das traduções em PT AO90.
*/
add_filter( 'gp_convert_pt_ao90_edit', '__return_false' );

Can I always save the translation to the Variant, even if is the same as the Root translation?

Short anwser: yes!
The Variants feature with fallback isn’t released yet. The current Variants code is not ready to production, the fallback to the Root Locale isn’t quite stable.
If you need a fully independent translation set, for more accurate stats or to build complete and independent Language Packs of the Variant, you can use the filter as follows:
/**
* Always create the Variant translation.
*/
add_filter( 'gp_convert_pt_ao90_always_create_variant_translation', '__return_true' );

Posso desactivar o destaque das diferenças da conversão?

Sure!
The highlight of the conversion differences are usefull if you want to keep track of what changed.
If you want to disable it, you can use the filter as follows:
php
/**
* Always create the Variant translation.
*/
add_filter( 'gp_convert_pt_ao90_showdiff', '__return_false' );

Quero usar o WordPress em Português (AO90), este plugin pode ajudar-me?

Não! Para usar o seu WordPress em Português (AO90) basta ir às opções do site e seleccionar o idioma no campo respectivo.
Pode ainda usar o plugin PT AO90 para garantir que o seu site utiliza como alternativa o idioma Português em vez do Inglês, caso não haja tradução Português (AO90) para o seu tema ou plugins.

Afinal, o que é que este plugin faz realmente?

Isto é uma extensão da plataforma GlotPress usada para traduzir projectos WordPress.
Desde o GlotPress 3.x que há uma nova funcionalidade de variantes, que permite a alguns Locales serem uma variante de um Locale raiz. Com isto, passa a existir fallback.
Se a tradução não existir na variante, é assumida a tradução raiz.
Este plugin liga ambos os Locales de Português de modo a que apenas é necessário traduzir e gerir a consistência da tradução raiz Português, estando assegurada a conversão automática para a variante Português (AO90), sem ser necessária intervenção humana.
Com esta ferramenta os tradutores podem continuar a fornecer ambos os Locales com o mínimo de esforço.

Isto significa que as traduções serão agora convertidas automaticamente em translate.wp.org?

(Ainda) não. Isto é uma prova de conceito, funciona em qualquer GlotPress 3.x, mas não está em execução em translate.wp.org (baseado em GlotPress).
Esperemos que de futuro seja possível, ou pelo menos um clone desta solução, uma vez que se trata de uma ferramenta de código aberto.

Deverá esta funcionalidade fazer parte do próprio GlotPress?

Sim e não.
A relação entre a raiz/variante depende de cada equipa que utilize o GlotPress.
Em dependência de como cada equipa decide trabalhar. É útil se se pretender conversão automática.
Para equipas que queiram automatizar a relação entre raiz/variante, então sim, esta funcionalidade opcional poderia estar ser integrada no GlotPress, para se poder especificar se um determinado par raiz/variante seriam automatizados por um processo a integrar à posteriori, tornando a variante apenas de leitura.
Esta não é uma necessidade exclusiva dos Locales de português, provavelmente também será útil para outros Locales.
O que não deverá fazer parte do core do GlotPress é o processo específico de conversão, isso é território dos plugins.
Este plugin é uma prova de conceito para utilizar e testar este fluxo de trabalho.

Que versões do GlotPress são compatíveis com este plugin?

The Variants feature was introduced in GlotPress 3.0.0-alpha.
Later, on GlotPress 3.0.0-beta the Variants feature was removed temporarily, so for now the GlotPress alpha version is the only Variants compatible version, and you must install it for this plugin to do its magic.
You can use it with GlotPress 4.0.x without the real variants fallback support, the plugin will convert/sync all the strings.

The translated strings of both locales don’t match, can I force convert the translated strings?

The conversion process occurs while saving the translation or importing translations. For that both the root and variant locales must exist for a project and the plugin must be active.
If you’ve added the translations before having the variant locale added to the project, or somehow while this plugin was inactive, the conversion won’t happen.
Since version 1.4.2 you can force the conversion anytime. Go to the project page, and on the variant locale you can click on the Sync button.

Posso contribuir para o desenvolvimento deste plugin?

Claro que sim! O seu contributo é bem-vindo, pode reportar erros ou fazer sugestões de funcionalidades no repositório do GitHub.

Avaliações

Este plugin não tem avaliações.

Contribuidores e programadores

“Convert PT AO90 for GlotPress” é software de código aberto. As seguintes pessoas contribuíram para este plugin:

Contribuidores

“Convert PT AO90 for GlotPress” foi traduzido para 5 locales. Obrigado aos tradutores pelas suas contribuições.

Traduza o “Convert PT AO90 for GlotPress” para o seu idioma.

Interessado no desenvolvimento?

Consulte o código, consulte o repositório SVN, ou subscreva o registo de alterações por RSS.

Registo de alterações

1.4.7

  • Fix: Error of undefined variables on template-row when no root translation exist and variant is edited directly.
  • Fix: Change script priority to fix tablesorter conflict with active GP Toolbox.

1.4.6

  • New: Hook in GP Toolbox, if available, to update all the projects stats columns highlights and buttons accordingly.
  • Fix: Error of undefined variables on template-row when loaded through ajax updating translation.

1.4.5

  • Fix: Build the minified JS.

1.4.4

  • New: Add, update and remove 90% bubble on AJAX update.
  • Fix: Error on project_path sanitization for Syncing subprojects.
  • Fix: Saving old translations in the root locale on Sync action.
  • Fix: Sync button icon CSS issue.
  • Allow converting current translations with warnings.
  • Improve Syncing performance by deleting the existing variant translations with delete_many().
  • Set dependency header for GlotPress according WP 6.5.
  • Tested up to WP 6.5.
  • Test with PHP 8.3.
  • Update dependencies.

1.4.3

  • Fix missing JavaScript translation.

1.4.2

  • New: A Sync button for GlotPress administrators to force convert the complete translation from root set to variant set.
  • Fix: Keep variant below root translation set while sorting in GlotPress 3.x with variants support.

1.4.1

  • Update the actual Convert-PT-AO90 tool to v1.3.3.
  • Fix: Strings with trailing spaces converted to null, fixed on the package Convert-PT-AO90.
  • Fix: Warnings on paginated translation tables, on rows with highlighted diffs.

1.4.0

  • New: Supports the current GlotPress 4.0.0, without the real variants and fallback feature.
  • New filter: Use gp_convert_pt_ao90_showdiff to optionally disable the conversion diff highlight.
  • Fix: Schedule Traduttore language-pack build for the converted variant.

1.3.3

  • New filter: Use gp_convert_pt_ao90_always_create_variant_translation to optionally always create Variant translations, making it independent of any Root fallback.
  • Fix Dashicons enqueue.
  • Fix multiple translations being added to the Variant.
  • Move filter gp_convert_pt_ao90_edit to wp_loaded.

1.3.2

  • Improve CSS loading.

1.3.1

  • Add Lock icon in to the Variant name in it’s read-only.
  • Fix error on Constant setup.
  • Remove dotfiles and rulesets from release.

1.3.0

  • Novo modo de leitura: Use o novo filtro gp_convert_pt_ao90_edit para opcionalmente desactivar a edição, aprovação e importação de traduções na variante pt-ao90.
  • Tested up to WP 6.4.

1.2.5

  • Use own CSS that is still missing on GlotPress 3.0.0-alpha.4
  • Update the actual Convert-PT-AO90 tool to v1.3.2.
  • Add some more replace pairs.
  • Update dependencies.
  • Tested up to WP 6.1.
  • Tested only on supported PHP versions (7.4+).

1.2.4

  • Fix HTML escaping.

1.2.3

  • Add plurals to original text in the translation row preview.
  • Add plural forms labels.

1.2.2

  • Add prepare to print out to root translation preview row.

1.2.1

  • Fix missing version number.

1.2.0

  • Realça as diferenças nos textos convertidos automaticamente.

1.1.1

  • Update the actual Convert-PT-AO90 tool to v1.3.1.
  • Fix matching for words with exact case on the replace pairs.

1.1.0

  • Actualização da ferramenta integrada Convert-PT-AO90 para a v1.3.
  • Rebuild replace pairs with half the size.
  • Improve performance by using only lowercase replace pairs.
  • Fix matching words starting with an accented vowel.
  • Removidos os casos de conversão de pontos cardeais (já são em minúsculas desde 1945).
  • Add some more replace pairs.
  • Update dependencies.
  • Testado até ao WP 6.0.

1.0.0

  • Lançamento inicial.
  • Verifica se o GlotPress está activo.
  • Verifica a existência dos conjuntos de tradução raiz pt e variante pt-ao90.
  • Converte traduções actuais da raiz Português e adiciona-as às traduções da variante Português (AO90).
  • Elimina traduções não utilizadas em vez de as manter como obsoletas. Como é suposto a variante ser apenas de leitura, todo o histórico de edições é mantido no conjunto de traduções de raiz.