Skip to content

Commit

Permalink
Merge pull request #75 from pedro-mendonca/dev
Browse files Browse the repository at this point in the history
Add prepare to print out to root translation preview row.
  • Loading branch information
pedro-mendonca authored Oct 10, 2022
2 parents 1833495 + c27e864 commit 547b273
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 99 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ Sure! You are welcome to report any issues or add feature suggestions on the [Gi

## Changelog

### 1.2.2

* Add prepare to print out to root translation preview row.

### 1.2.1

* Fix missing version number.
Expand Down
2 changes: 1 addition & 1 deletion gp-convert-pt-ao90.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* GitHub Plugin URI: https://github.com/pedro-mendonca/GP-Convert-PT-AO90
* Primary Branch: main
* Description: Language tool for GlotPress to convert text according to the Portuguese Language Orthographic Agreement of 1990 (PT AO90).
* Version: 1.2.1
* Version: 1.2.2
* Requires at least: 5.3
* Tested up to: 6.0
* Requires PHP: 7.2
Expand Down
8 changes: 4 additions & 4 deletions gp-templates/translation-row-preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
$singular_translation = esc_translation( $translation->translations[0] );
// Check if has root.
if ( isset( $translation->root_id ) ) {
$singular_translation = prepare_original( GP_Convert_PT_AO90\Portuguese_AO90::highlight_diff( esc_translation( $translation->root_translation_0 ), esc_translation( $translation->translations[0] ) ) );
$singular_translation = GP_Convert_PT_AO90\Portuguese_AO90::highlight_diff( esc_translation( $translation->root_translation_0 ), esc_translation( $translation->translations[0] ) );
}
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<span class="translation-text">' . $singular_translation . '</span>';
echo '<span class="translation-text">' . prepare_original( $singular_translation ) . '</span>';
else :
?>
<ul>
Expand All @@ -71,10 +71,10 @@
$plural_translation = esc_translation( $current_translation );
// Check if has root.
if ( isset( $translation->root_id ) ) {
$plural_translation = prepare_original( GP_Convert_PT_AO90\Portuguese_AO90::highlight_diff( esc_translation( $translation->{ 'root_translation_' . $key } ), esc_translation( $current_translation ) ) );
$plural_translation = GP_Convert_PT_AO90\Portuguese_AO90::highlight_diff( esc_translation( $translation->{ 'root_translation_' . $key } ), esc_translation( $current_translation ) );
}
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<span class="translation-text">' . $plural_translation . '</span>';
echo '<span class="translation-text">' . prepare_original( $plural_translation ) . '</span>';
}
?>
</li>
Expand Down
Loading

0 comments on commit 547b273

Please sign in to comment.