While testing the GlotPress with Variants, this status don't allow to export also the root fallback entries.
This is solved by setting 'status' => 'current_or_untranslated'.
I know the Variants feature of GlotPress was reverted and is far from being stable/released, but still, would it be possible to add a hook to allow a custom entries filter?
Eg.:
$entries = GP::$translation->for_export( $this->project->get_project(), $this->translation_set, [ 'status' => 'current' ] );
/**
* Filters the status of the entries to export.
*
* @param string $export_status The status of the entries to export. Default is 'current'.
* @param \GP_Translation_Set $translation_set Translation set the language pack is for.
* @param \Required\Traduttore\Project $project The project that was updated.
*/
$export_status= apply_filters( 'traduttore.export_status', 'current', $this->translation_set, $this->project );
$entries = GP::$translation->for_export( $this->project->get_project(), $this->translation_set, [ 'status' => $export_status ] );
To Reproduce
Steps to reproduce the behavior:
Install GlotPress 3.0.0.alpha-4 to include variants
Add a project with two translation sets, root and variant.
Translate all the root set, only translate a few strings of the variant
Currently the Variant language pack only includes the translated on the variant.
Expected behavior
When exporting a laguage pack of a Variant, both translated and untranslated should be exported, to allow the fallback to the root locale.
Issue Overview
The language packs only export entries with
'status' => 'current'
. https://github.com/wearerequired/traduttore/blob/master/inc/Export.php#L75While testing the GlotPress with Variants, this status don't allow to export also the root fallback entries. This is solved by setting
'status' => 'current_or_untranslated'
.I know the Variants feature of GlotPress was reverted and is far from being stable/released, but still, would it be possible to add a hook to allow a custom entries filter? Eg.:
To Reproduce Steps to reproduce the behavior:
Expected behavior When exporting a laguage pack of a Variant, both translated and untranslated should be exported, to allow the fallback to the root locale.