开发者 | pedromendonca |
---|---|
更新时间 | 2024年11月6日 23:50 |
捐献地址: | 去捐款 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 6.7 |
版权: | GPLv2 |
版权网址: | 版权信息 |
= 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' );
= I want my WordPress in Portuguese (Portugal, AO90), does this plugin help?
No! To use your WordPress in Portuguese (Portugal AO90) you must go to your Settings and select it in the Language field.
You can also use the plugin PT AO90 to make sure your site falls back to Portuguese (Portugal) instead of English if there is no translation to Portuguese (Portugal, AO90) for your theme or plugins.
= So what does this plugin really do, after all?
It extends the translation platform GlotPress used to translate WordPress projects.
Since GlotPress 3.x there is a new Variants feature, enabling some Locales to be a variant of a root Locale. With this, comes fallback.
If a translation doesn't exist on the variant, it assumes its root translation.
This plugin links both Portuguese Locales in a way that you only need to focus in translating and manage consistency on the root Portuguese (Portugal), knowing that the variant Portuguese (Portugal, AO90) is being automatically converted and synced with no human action needed.
With this tool, the translators can continue to provide both Locales with the minimum effort.
= Does this means that translations are now converted automatically on translate.wp.org?
No(t yet). This is a working proof of concept, it works on any GlotPress 3.x, but isn't running on translate.wp.org (GlotPress based) at the moment.
Hopefully it will, or at least a clone of this, as this is an open source tool.
= Should this feature be a part of GlotPress itself?
No. And yes.
The relationship between root/variant depend on each team that uses GlotPress.
Depending on how the translation team decides to work. It's useful if automatic conversion is wanted.
For teams that want a root/variant to work automatically, than yes, GlotPress could integrate this optional feature of setting a specific pair of root/variant automatically converted with some custom hookable process, and turning the variant read-only.
This is not an exclusive need of the Portuguese Locales, this is surely useful for other Locales as well.
What should not be a part of GlotPress core is the actual Portuguese conversion, that is plugin territory.
This plugin is intended to be a proof of concept to use and test this workflow.
= 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.
Sure! You are welcome to report any issues or add feature suggestions on the GitHub repository.
current
translations with warnings.gp_convert_pt_ao90_showdiff
to optionally disable the conversion diff highlight.gp_convert_pt_ao90_always_create_variant_translation
to optionally always create Variant translations, making it independent of any Root fallback.gp_convert_pt_ao90_edit
to optionally disable editing, approval and importing translations in the pt-ao90
variant.pt
root and pt-ao90
variant translation sets.current
Portuguese (Portugal) root translations and add to the Portuguese (Portugal, AO90) variant translations.