jenkins-bot has submitted this change and it was merged.
Change subject: Align the sections based on integer value of section heights
......................................................................
Align the sections based on integer value of section heights
The Arabic Wikipedia has a local gadget, which causes a floating point
line height and font size. This causes our alignment algorithm to compare
floating point heights and to end up with aborting alignment
after 10 attempts.
Integer conversion of heights should fix the issue. But do that
conversion only in the fix-up section. Otherwise, multiple integer
conversions cause height added up larger than 1px.
Also reducing the fix-up attempt to 5 times from 10 times.
Bug: T105938
Change-Id: Ie8384a1e32b5225fa05ee1a4f3d3fb8ae2338ff2
---
M modules/translation/ext.cx.translation.aligner.js
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Amire80: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/translation/ext.cx.translation.aligner.js
b/modules/translation/ext.cx.translation.aligner.js
index c00835b..71f3419 100644
--- a/modules/translation/ext.cx.translation.aligner.js
+++ b/modules/translation/ext.cx.translation.aligner.js
@@ -86,14 +86,14 @@
// equal height for all kinds of section pairs.
// Experiments shows a few pixels difference.
// Here we do it by 10px steps till we reach equal
height.
- while ( sectionHeight !== sourceSectionHeight ) {
+ while ( parseInt( sectionHeight, 10 ) !== parseInt(
sourceSectionHeight, 10 ) ) {
sectionHeight = sectionHeight + 10;
$sourceSection.css( 'min-height', sectionHeight
);
$section.css( 'min-height', sectionHeight );
sectionHeight = $section.height();
sourceSectionHeight = $sourceSection.height();
- if ( steps++ === 10 ) {
+ if ( steps++ === 5 ) {
mw.track( 'Alignment attempt is not
succeeding. Aborting.' );
break;
}
--
To view, visit https://gerrit.wikimedia.org/r/228777
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie8384a1e32b5225fa05ee1a4f3d3fb8ae2338ff2
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits