Convert PT AO90 for GlotPress

Description

Cette extension pour GlotPress personnalise le comportement par défaut de la locale Portuguese (Portugal), vous permettant de convertir automatiquement les chaines approved/current en Portuguese (Portugal) vers sa variante Portuguese (Portugal, AO90).

It keeps the Portuguese (Portugal) root translations automatically converted and synced with its Portuguese (Portugal, AO90) variant translations within your GlotPress install.

Optionally it’s possible to disable the Portuguese (Portugal, AO90) variant translations editing, approval and importing, making it read-only.

The only translations added to the Portuguese (Portugal, AO90) variant translation set are those which are different from the Portuguese (Portugal) root translation.

Les chaines qui n‘ont pas besoin d‘être converties ne sont pas traduites dans la variante et utilisent la Locale root.

Cette extension a été fortement inspirée par la solution pour le Latin serbe pour la translittération de la locale cyrillique serbe de translate.wordpress.org.

La conversion linguistique utilise l‘outil open source Convert PT AO90 pour remplacer des mots entiers à partir d‘une liste préconstruite.

Fonctionnalités

  • Vérification si GlotPress est activé.
  • Vérification de l‘existence de l‘ensemble de traduction pt et de la variante pt-ao90.
  • Conversion des traductions current du portugais (Portugal) et ajout des traductions variantes du portugais (Portugal, AO90).
  • Suppression des variantes de la traduction non utilisées au lieu de les garder comme rejected, fuzzy, old.
  • Suppression des variantes de la traduction current si une nouvelle traduction root (même original_id) est ajoutée et ne nécessite pas de conversion.
  • Sync button for GlotPress administrators to force convert the complete translation from root set to variant set.
  • Highlight the differences in the automatically converted texts.
  • Read-only mode: Use the filter gp_convert_pt_ao90_edit to disable editing, approval and importing translations in the pt-ao90 variant.
  • 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.

Prérequis

  • GlotPress 3.0.0-alpha.4 with Variants support.
  • GlotPress 4.0.0 without Variants support.

  • Jeu de traduction (root) : Portuguese (Portugal)

    • Locale = pt;
    • Slug = default;
  • Jeu de traduction (variant) : Portuguese (Portugal, AO90)

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

Captures d’écran

  • Translation table with gray root translations and green automatically converted strings, with highlighted conversion diffs
  • Variant translation table only with green automatically converted strings, with highlighted conversion diffs
  • Sync button to force convert the complete translation from root set to variant set

FAQ

Is it possible to make the variant Portuguese (Portugal, AO90) read-only?

As translations are automatically converted from the root Locale Portuguese (Portugal), you can make the variant read-only by disabling users to edit, approve and import translations into the variant.
To make the Variant PT AO90 read-only, you can use the filter as follows:
/**
* Disable editing translations for 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' );

Can I disable the conversion diff highlight?

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' );

Je veux que mon WordPress soit en Portuguese (Portugal, AO90), cette extension peut-elle m‘aider ?

Non ! Pour utiliser votre WordPress en Portuguese (Portugal AO90), vous devez vous rendre dans vos réglages et le sélectionner dans le champ Langue.
Vous pouvez également utiliser l‘extension PT AO90 pour faire en sorte que votre site repasse en Portuguese (Portugal) au lieu de l‘anglais s‘il n‘y a pas de traduction en Portuguese (Portugal, AO90) pour votre thème ou vos extensions.

En fin de compte, à quoi sert vraiment cette extension ?

Elle étend la plateforme de traduction GlotPress utilisée pour traduire les projets WordPress.
Depuis GlotPress 3.x, il existe une nouvelle fonction Variantes, permettant à certaines locales d‘être une variante d‘une Locale racine. Cette fonctionnalité s‘accompagne d‘une solution de repli.
Si une traduction n‘existe pas sur la variante, elle prend sa traduction racine.
Cette extension relie les deux localisations portugaises de manière à ce que vous n‘ayez qu‘à vous concentrer sur la traduction et la gestion de la cohérence du portugais racine (Portugal), sachant que la variante portugaise (Portugal, AO90) est automatiquement convertie et synchronisée sans aucune intervention humaine.
Grâce à cet outil, les traducteurs peuvent continuer à proposer les deux localisations avec un minimum d‘efforts.

Cela signifie-t-il que les traductions sont désormais converties automatiquement sur translate.wp.org ?

Non (pas encore). Il s‘agit d‘une preuve de concept, il fonctionne sur n‘importe quel GlotPress 3.x, mais ne fonctionne pas sur translate.wp.org (basé sur GlotPress) pour le moment.
Espérons qu‘il le fera, ou au moins un clone de celui-ci, car c‘est un outil open source.

Cette fonctionnalité devrait-elle faire partie de GlotPress lui-même ?

Non. Et oui.
La relation entre racine/variante dépend de chaque équipe qui utilise GlotPress.
Cela dépend de la façon dont l‘équipe de traduction décide de travailler. C‘est utile si une conversion automatique est souhaitée.
Pour les équipes qui veulent que la racine/variante fonctionne automatiquement, alors oui, GlotPress pourrait intégrer cette fonctionnalité optionnelle de réglage d‘une paire spécifique de racine/variante convertie automatiquement avec un certain processus personnalisable, et de mise en lecture seule de la variante.
Ce n‘est pas un besoin exclusif des locales portugaises, c‘est sûrement utile pour les autres locales aussi.
Ce qui ne devrait pas faire partie du cœur de GlotPress, c‘est la conversion portugaise proprement dite, qui est du domaine de l‘extension.
Cette extension est destinée à être une preuve de concept pour utiliser et tester ce flux de travail.

What versions of GlotPress are compatible with this 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.

Puis-je contribuer à cette extension ?

Bien sûr ! Signalez tout problème ou ajoutez des suggestions de fonctionnalités sur le dépôt GitHub.

Avis

Il n’y a aucun avis pour cette extension.

Contributeurs/contributrices & développeurs/développeuses

« Convert PT AO90 for GlotPress » est un logiciel libre. Les personnes suivantes ont contribué à cette extension.

Contributeurs

“Convert PT AO90 for GlotPress” a été traduit dans 5 locales. Remerciez l’équipe de traduction pour ses contributions.

Traduisez « Convert PT AO90 for GlotPress » dans votre langue.

Le développement vous intéresse ?

Parcourir le code, consulter le SVN dépôt, ou s’inscrire au journal de développement par RSS.

Journal

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

  • New read-only mode: Use the new filter gp_convert_pt_ao90_edit to optionally disable editing, approval and importing translations in the pt-ao90 variant.
  • 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

  • Highlight the differences in the automatically converted texts.

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

  • Update the actual Convert-PT-AO90 tool to 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.
  • Remove wrong replace pairs about cardinal points (lowercased since 1945).
  • Add some more replace pairs.
  • Update dependencies.
  • Tested up to WP 6.0.

1.0.0

  • Version initiale.
  • Vérification si GlotPress est activé.
  • Vérification de l‘existence de l‘ensemble de traduction pt et de la variante pt-ao90.
  • Conversion des traductions current du portugais (Portugal) et ajout des traductions variantes du portugais (Portugal, AO90).
  • Suppression des traductions inutilisées de la variante au lieu de les conserver comme « old ». Comme la variante est destinée à être en lecture seule, tout le travail de traduction et l‘historique sont conservés à la racine.