이 플러그인은 최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다. 워드프레스의 좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 있을 수 있습니다.

Automatic Variants for GlotPress

설명

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 solution for transliteration of Serbian Cyrillic locale from translate.wordpress.org.

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:

    /**
     * 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' );
    
  2. Add your Locale actual conversion process with the filter gp_automatic_variants_convert_{variant_locale}:

    Example for the variant ‘pt-ao90’:

    /**
     * Actual conversion of the string.
     */
    function convert_translation( $translation ) {
        return do_something( $translation );
    }
    
    add_filter( 'gp_automatic_variants_convert_pt-ao90', 'convert_translation' );
    

    Usage

  3. For every translation project, add both root and variant translation sets as usual.

  4. Translate only on the root Locale and see the conversions automatically propagate to the variant.

Requirements

FAQ

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 (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.
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.

Can I contribute to this plugin?

Sure! You are welcome to report any issues or add feature suggestions on the GitHub repository.

후기

이 플러그인에 대한 평가가 없습니다.

기여자 & 개발자

“Automatic Variants for GlotPress”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

“Automatic Variants for GlotPress”(이)가 7 개 언어로 번역되었습니다. 기여해 주셔서 번역자님께 감사드립니다.

자국어로 “Automatic Variants for GlotPress”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록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.