Brion VIBBER has uploaded a new change for review.

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

Change subject: Work in progress: language marker button in doc area (not yet 
functional)
......................................................................

Work in progress: language marker button in doc area (not yet functional)

Looks more or less like the mockup at
https://trello-attachments.s3.amazonaws.com/52e98a603e6d08a53861025b/5363dc861f242dbd5eb6af22/4881x3543/879a1efeee2a2eb7ad4fa19e4de513e0/Apps_Language%26EditHistory_Sprint31.png
though not 100% exact just yet.

Do we need/want a single-character icon in the icon font for the Aあ bit?

Change-Id: I46f40a347ee5d0c60b9c9b320c4bffc8da780d07
---
M wikipedia/View Controllers/WebView/WebViewController.m
M wikipedia/assets/styles.css
M wikipedia/en.lproj/Localizable.strings
M wikipedia/qqq.lproj/Localizable.strings
M www/Gruntfile.js
5 files changed, 55 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/78/134678/1

diff --git a/wikipedia/View Controllers/WebView/WebViewController.m 
b/wikipedia/View Controllers/WebView/WebViewController.m
index ad60e83..762c914 100644
--- a/wikipedia/View Controllers/WebView/WebViewController.m
+++ b/wikipedia/View Controllers/WebView/WebViewController.m
@@ -1308,7 +1308,9 @@
         self.scrollOffset = scrollOffset;
 
 
-[sectionTextArray addObject:[NSString stringWithFormat:@"THIS MANY LANGS 
AVAILABLE = %d", langCount.integerValue]];
+        if (mode != DISPLAY_LEAD_SECTION) {
+            [sectionTextArray addObject: [self renderLanguageButtonForCount: 
langCount.integerValue]];
+        }
 
         
         // Join article sections text
@@ -1331,6 +1333,15 @@
     }];
 }
 
+-(NSString *)renderLanguageButtonForCount:(NSInteger)count
+{
+    NSString *aa = @"<span class=\"mw-language-icon\">Aあ</span>";
+    NSString *countStr = [NSString stringWithFormat:@"<span 
class=\"mw-language-count\">%d</span>", (int)count];
+    NSString *otherLanguages = [NSString stringWithFormat:@"<span 
class=\"mw-language-label\">%@</span>", 
MWLocalizedString(@"language-button-other-languages", nil)];
+    
+    return [NSString stringWithFormat:@"<button 
class=\"mw-language-button\">%@%@%@</button>", aa, countStr, otherLanguages];
+}
+
 #pragma mark Scroll to last section after rotate
 
 
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
 duration:(NSTimeInterval)duration
diff --git a/wikipedia/assets/styles.css b/wikipedia/assets/styles.css
index 60cf097..d64ed09 100644
--- a/wikipedia/assets/styles.css
+++ b/wikipedia/assets/styles.css
@@ -8,7 +8,8 @@
   line-height: 26px;
 }
 html {
-    -webkit-text-size-adjust: none; /* Never autoresize text */
+  -webkit-text-size-adjust: none;
+  /* Never autoresize text */
 }
 #ios_app_content {
   margin: 0px;
@@ -154,3 +155,40 @@
   -webkit-transform: scaleX(-1);
   transform: scaleX(-1);
 }
+
+.mw-language-button {
+  appearance: none;
+  -webkit-appearance: none;
+  display: -webkit-flex;
+  -webkit-flex-direction: row;
+  -webkit-flex-wrap: nowrap;
+  -webkit-align-items: center;
+  width: 200px;
+  color: #aaa;
+  background: #222;
+  font-size: 24px;
+  padding: 12px;
+}
+.mw-language-icon,
+.mw-language-number,
+.mw-language-label {
+  -webkit-flex-grow: 2;
+}
+.mw-language-icon {
+  text-align: right;
+  color: white;
+  padding-right: 12px;
+  border-right: solid 1px #aaa;
+  white-space: nowrap;
+  font-family: "AvenirNextCondensed-Medium";
+}
+.mw-language-count {
+  text-align: center;
+  padding-left: 12px;
+}
+.mw-language-label {
+  -webkit-flex-grow: 5;
+  text-align: left;
+  padding-left: 12px;
+  font-size: 10px;
+}
diff --git a/wikipedia/en.lproj/Localizable.strings 
b/wikipedia/en.lproj/Localizable.strings
index 9b0839f..ae19526 100644
--- a/wikipedia/en.lproj/Localizable.strings
+++ b/wikipedia/en.lproj/Localizable.strings
@@ -3,6 +3,8 @@
 "article-languages-downloading" = "Loading article languages...";
 "article-languages-filter-placeholder" = "Filter";
 
+"language-button-other-languages" = "Other Languages";
+
 "history-label" = "Browsing History";
 "history-section-today" = "Today";
 "history-section-yesterday" = "Yesterday";
diff --git a/wikipedia/qqq.lproj/Localizable.strings 
b/wikipedia/qqq.lproj/Localizable.strings
index 9962213..58bb95e 100644
--- a/wikipedia/qqq.lproj/Localizable.strings
+++ b/wikipedia/qqq.lproj/Localizable.strings
@@ -110,3 +110,4 @@
 "credits-gerrit-repo" = "Text for item linking to the app's main gerrit 
repository";
 "credits-github-mirror" = "Text for item linking to the app's mirrored GitHub 
repository";
 "credits-external-libraries" = "Title for area of credits page showing 
external open source libraries used by app.\n{{Identical|External}}";
+"language-button-other-languages" = "Label for 'other languages' button in 
content area. Button also shows the number of available languages, but an 
indeterminate plural should be used here.";
diff --git a/www/Gruntfile.js b/www/Gruntfile.js
index ce00dff..759d6b5 100644
--- a/www/Gruntfile.js
+++ b/www/Gruntfile.js
@@ -22,7 +22,7 @@
         less: {
             all: {
                 files: [
-                    { src: ["less/pagestyles.less"], dest: "styles.css"}
+                    { src: ["less/pagestyles.less", "less/langbutton.less"], 
dest: "styles.css"}
                 ]
             }
         },

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46f40a347ee5d0c60b9c9b320c4bffc8da780d07
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <br...@wikimedia.org>

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

Reply via email to