Title: Automatic Variants for GlotPress
Author: Pedro Mendonça
Published: <strong>دسمبر 15, 2021</strong>
Last modified: اگست 10, 2022

---

پلگ انز تلاش کریں

![](https://ps.w.org/gp-automatic-variants/assets/banner-772x250.png?rev=2822016)

یہ پلگ ان **ورڈپریس کے تازہ ترین 3 ریلیزوں کے ساتھ ٹیسٹ نہیں کیا گیا ہے**۔ اب یہ
برقرار نہیں رکھا جا سکتا یا معاونت نہیں کی جا سکتی اور اس کو ورڈپریس کے تازہ ترین
ورژنز کے ساتھ استعمال کیے جانے پر مطابقت کے مسائل ہو سکتے ہیں۔

![](https://ps.w.org/gp-automatic-variants/assets/icon-256x256.png?rev=2769236)

# Automatic Variants for GlotPress

 منجانب [Pedro Mendonça](https://profiles.wordpress.org/pedromendonca/)

[ڈاؤن لوڈ کریں](https://downloads.wordpress.org/plugin/gp-automatic-variants.1.0.0.zip)

 * [تفصیلات](https://ur.wordpress.org/plugins/gp-automatic-variants/#description)
 * [جائزے](https://ur.wordpress.org/plugins/gp-automatic-variants/#reviews)
 * [ڈیولپمنٹ](https://ur.wordpress.org/plugins/gp-automatic-variants/#developers)

 [معاونت](https://wordpress.org/support/plugin/gp-automatic-variants/)

## تفصیل

This plugin for GlotPress customizes the default behavior of a set of chosen pairs
of Locales (root/variant), allowing you to automatically convert the approved/current
strings in the root to its variant.

It keeps the root translations automatically converted and synced with its variant
translations within your GlotPress install.

The only translations added to the variant translation set are those which are different
from the root translation.

The strings that don’t need any conversion remain untranslated on the variant, falling
back to the root Locale.

This plugin was heavily inspired by the [Serbian Latin](https://meta.trac.wordpress.org/ticket/5471)
solution for transliteration of Serbian Cyrillic locale from [translate.wordpress.org](https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/locales/class-serbian-latin.php?rev=10360).

### Features

 * Filter `gp_automatic_variants_list` to add your variant to the array of automatically
   converted variants.
 * Filter `gp_automatic_variants_convert_{variant_locale}` to process the conversion
   of strings of the automatic variant.
 * Check for GlotPress minimum requirements.
 * Check if the added Locales are variants supported the installed GlotPress.
 * Convert `current` root translations and add to the variant translation set.
 * Delete variant unused translations instead of keeping as `rejected`, `fuzzy`,`
   old`.
 * Delete `current` variant translation if a new root translation (same `original_id`)
   is added and doesn’t need conversion.

### Install GlotPress

 1. Install and activate GlotPress 3.0.0-alpha minimum version.
 2. Install and activate this plugin from your plugins page.

### Configure Automatic Variants for GlotPress

 1. Set the variants you want to be automatically converted with the filter `gp_automatic_variants_list`:
 2.     ```
        /**
         * Add my automatically converted variants.
         */
        function my_automatic_variants( $locales ) {
            $additional_locales = array(
                'ca-valencia',
                'pt-ao90',
                'ca-valencia',
                'en-gb',
                'de-at',
                'de-ch',
            );
            return array_merge( $locales, $additional_locales );
        }
    
        add_filter( 'gp_automatic_variants_list', 'my_automatic_variants' );
        ```
    
 3. Add your Locale actual conversion process with the filter `gp_automatic_variants_convert_{
    variant_locale}`:
 4. Example for the variant ‘pt-ao90’:
 5.     ```
        /**
         * Actual conversion of the string.
         */
        function convert_translation( $translation ) {
            return do_something( $translation );
        }
    
        add_filter( 'gp_automatic_variants_convert_pt-ao90', 'convert_translation' );
        ```
    
 6. 
    ### Usage
    
 7. For every translation project, add both root and variant translation sets as usual.
 8. Translate only on the root Locale and see the conversions automatically propagate
    to the variant.

### Requirements

 * [GlotPress 3.0.0-alpha](https://github.com/GlotPress/GlotPress/releases/tag/3.0.0-alpha.4)
   with Variants support.

## عمومی سوالات

### What does this plugin really do?

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 Locales
in a way that you only need to focus in translating and manage consistency on the
root, knowing that the variant 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 translate.wp.org supports automatically converted variants?

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](https://translate.wp.org) (GlotPress based) 
at the moment.

### Should this feature be a part of GlotPress itself?

To be discussed.
 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,
GlotPress could integrate this optional feature of setting a specific variant to
be automatically converted from its root with a custom hookable process, and turning
the variant read-only. This can be used by any Locale team that want to hook an 
automatic conversion between root and variant Locales. 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](https://github.com/GlotPress/GlotPress/releases/tag/3.0.0-alpha.4).

Later, on [GlotPress 3.0.0-beta](https://github.com/GlotPress/GlotPress/releases/tag/3.0.0-beta.1)
the Variants feature [was removed temporarily](https://github.com/GlotPress/GlotPress/pull/1327),
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.

### Can I contribute to this plugin?

Sure! You are welcome to report any issues or add feature suggestions on the [GitHub repository](https://github.com/pedro-mendonca/GP-Automatic-Variants).

## جائزے

There are no reviews for this plugin.

## شراکت دار اور ڈیویلپرز

“Automatic Variants for GlotPress” اوپن سورس سافٹ ویئر ہے۔ مندرجہ ذیل لوگوں نے اس
پلگ ان میں حصہ لیا:

شراکت دار

 *   [ Pedro Mendonça ](https://profiles.wordpress.org/pedromendonca/)

“Automatic Variants for GlotPress” کا 9 زبانوں میں ترجمہ کیا گیا ہے۔ تعاون کے لیے
[مترجمین](https://translate.wordpress.org/projects/wp-plugins/gp-automatic-variants/contributors)
کا شکریہ۔

[“Automatic Variants for GlotPress” کا اپنی زبان میں ترجمہ کریں۔](https://translate.wordpress.org/projects/wp-plugins/gp-automatic-variants)

### ڈویلپمینٹ میں دلچسپی ہے؟

[کوڈ براؤز کریں](https://plugins.trac.wordpress.org/browser/gp-automatic-variants/)،
[ایس این وی ریپوزیٹری](https://plugins.svn.wordpress.org/gp-automatic-variants/)
کو چیک کریں یا [ڈویلپمینٹ لاگ](https://plugins.trac.wordpress.org/log/gp-automatic-variants/)
کو سبسکرائب کریں بذریعہ [آر ایس ایس](https://plugins.trac.wordpress.org/log/gp-automatic-variants/?limit=100&mode=stop_on_copy&format=rss)۔

## چینج لاگ

#### 1.0.0

 * Initial release.
 * Filter `gp_automatic_variants_list` to add your variant to the array of automatically
   converted variants.
 * Filter `gp_automatic_variants_convert_{variant_locale}` to process the conversion
   of strings of the automatic variant.
 * Check for GlotPress minimum requirements.
 * Check if the added Locales are variants supported the installed GlotPress.
 * Convert `current` root translations and add to the variant translation set.
 * Delete variant unused translations instead of keeping as `rejected`, `fuzzy`,`
   old`.
 * Delete `current` variant translation if a new root translation (same `original_id`)
   is added and doesn’t need conversion.

## میٹا

 *  Version **1.0.0**
 *  Last updated **4 سال پہلے**
 *  Active installations **10 سے کم**
 *  WordPress version ** 5.3 یا اس سے جدید **
 *  Tested up to **5.8.13**
 *  PHP version ** 7.2 یا اس سے جدید **
 *  Languages
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/gp-automatic-variants/)، 
   [Dutch (Belgium)](https://nl-be.wordpress.org/plugins/gp-automatic-variants/)،
   [English (US)](https://wordpress.org/plugins/gp-automatic-variants/)، [Italian](https://it.wordpress.org/plugins/gp-automatic-variants/)،
   [Portuguese (Portugal)](https://pt.wordpress.org/plugins/gp-automatic-variants/)،
   [Spanish (Chile)](https://cl.wordpress.org/plugins/gp-automatic-variants/)، [Spanish (Colombia)](https://es-co.wordpress.org/plugins/gp-automatic-variants/)،
   [Spanish (Ecuador)](https://es-ec.wordpress.org/plugins/gp-automatic-variants/)،
   [Spanish (Spain)](https://es.wordpress.org/plugins/gp-automatic-variants/)، اور
   [Spanish (Venezuela)](https://ve.wordpress.org/plugins/gp-automatic-variants/).
 *  [اپنی زبان میں ترجمہ کریں](https://translate.wordpress.org/projects/wp-plugins/gp-automatic-variants)
 * Tags
 * [glotpress](https://ur.wordpress.org/plugins/tags/glotpress/)[localization](https://ur.wordpress.org/plugins/tags/localization/)
   [translation](https://ur.wordpress.org/plugins/tags/translation/)[variants](https://ur.wordpress.org/plugins/tags/variants/)
 *  [اعلی درجے کا منظر](https://ur.wordpress.org/plugins/gp-automatic-variants/advanced/)

## درجہ بندیاں

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/gp-automatic-variants/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/gp-automatic-variants/reviews/)

## شراکت دار

 *   [ Pedro Mendonça ](https://profiles.wordpress.org/pedromendonca/)

## معاونت

کچھ کہنا ہے؟ مدد چاہیے؟

 [معاونتی فورم دیکھیں](https://wordpress.org/support/plugin/gp-automatic-variants/)

## عطیہ دیں

کیا آپ اس پلگ ان کی ترقی میں معاونت کرنا چاہتے ہیں؟

 [ اس پلگ ان کو عطیہ دیں ](https://github.com/sponsors/pedro-mendonca)