701: Fix entry/display of translations that start with a blank line. #715
Conversation
Needs an update of the minified file and a version bump. |
gp-templates/helper-functions.php
Outdated
* @return string The prepared string for output. | ||
*/ | ||
function prepare_translation_textarea( $text ) { | ||
if( gp_startswith( $text, "\r\n" ) ) { |
ocean90
May 30, 2017
Member
Missing whitespace
Missing whitespace
toolstack
May 30, 2017
Author
Contributor
Fixed.
Fixed.
gp-templates/helper-functions.php
Outdated
if( gp_startswith( $text, "\r\n" ) ) { | ||
$text = "\r\n" . $text; | ||
} else { | ||
if( gp_startswith( $text, "\n" ) ) { |
ocean90
May 30, 2017
Member
Missing whitespace
Missing whitespace
toolstack
May 30, 2017
Author
Contributor
Fixed.
Fixed.
gp-templates/helper-functions.php
Outdated
* | ||
* @return string The prepared string for output. | ||
*/ | ||
function prepare_translation_textarea( $text ) { |
ocean90
May 30, 2017
Member
Missing gp_
prefix
Missing gp_
prefix
toolstack
May 30, 2017
Author
Contributor
Fixed.
Fixed.
gp-templates/helper-functions.php
Outdated
@@ -130,7 +150,7 @@ function textareas( $entry, $permissions, $index = 0 ) { | |||
</div> | |||
<?php endif; ?> | |||
<blockquote class="translation"><em><small><?php echo prepare_original( esc_translation( gp_array_get( $entry->translations, $index ) ) ); // WPCS: XSS ok. ?></small></em></blockquote> | |||
<textarea class="foreign-text" name="translation[<?php echo esc_attr( $entry->original_id ); ?>][]" id="translation_<?php echo esc_attr( $entry->original_id ); ?>_<?php echo esc_attr( $index ); ?>" <?php echo $disabled; // WPCS: XSS ok. ?>><?php echo esc_translation( gp_array_get( $entry->translations, $index ) ); // WPCS: XSS ok. ?></textarea> | |||
<textarea class="foreign-text" name="translation[<?php echo esc_attr( $entry->original_id ); ?>][]" id="translation_<?php echo esc_attr( $entry->original_id ); ?>_<?php echo esc_attr( $index ); ?>" <?php echo $disabled; // WPCS: XSS ok. ?>><?php echo prepare_translation_textarea( esc_translation( gp_array_get( $entry->translations, $index ) ) ); // WPCS: XSS ok. ?></textarea> |
ocean90
May 30, 2017
Member
Shouldn't this be the other way around? esc_translation( prepare_translation_textarea( … ) )
Shouldn't this be the other way around? esc_translation( prepare_translation_textarea( … ) )
toolstack
May 30, 2017
Author
Contributor
Doesn't really matter, I chose this way to make sure the extra lf
was added as late as possible just in case.
Doesn't really matter, I chose this way to make sure the extra lf
was added as late as possible just in case.
Bumped asset loader version and the minified file is already included in the PR. |
The blocking conflict is because we've merged another update to the minification file in to develop and of course git can't resolve the issue. I'll have to rebase the PR. |
toolstack
force-pushed the
701-translations-starting-with-line-break
branch
from
May 31, 2017
f7565f2
to
09c0740
PR rebased. |
toolstack
force-pushed the
701-translations-starting-with-line-break
branch
from
Jun 6, 2017
09c0740
to
531d83a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
toolstack commentedMay 9, 2017
Resolves #701.