UltrasonicNXT has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/94600


Change subject: Prevent space before ellipsis when truncating
......................................................................

Prevent space before ellipsis when truncating

When truncating a string at a point where it contains a space (ie "hello
world" to 9 chars), the resultant string will have a space before the
ellipsis ("hello ..."). This is both gramatically incorrect and just looks
wrong, and is fixed by trimming the string before appending the ellipsis

Change-Id: Iec86b17bfc8c50e4c1a96fd373861841fc57848d
---
M languages/Language.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/94600/1

diff --git a/languages/Language.php b/languages/Language.php
index 6bbd8bf..2038bac 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -3325,11 +3325,13 @@
                                $length -= $eLength;
                                $string = substr( $string, 0, $length ); // 
xyz...
                                $string = $this->removeBadCharLast( $string );
+                               $string = rtrim( $string );
                                $string = $string . $ellipsis;
                        } else {
                                $length += $eLength;
                                $string = substr( $string, $length ); // ...xyz
                                $string = $this->removeBadCharFirst( $string );
+                               $string = ltrim( $string );
                                $string = $ellipsis . $string;
                        }
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/94600
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec86b17bfc8c50e4c1a96fd373861841fc57848d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: UltrasonicNXT <adamr_car...@btinternet.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to