Skip to content

Commit 509443a

Browse files
author
Artsem Lemiasheuski
committed
Hardcoded strings replaced with NSLocalizedString.
1 parent 8077c22 commit 509443a

18 files changed

Lines changed: 170 additions & 3 deletions

File tree

OpenDocumentReader/DocumentViewController.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class DocumentViewController: UIViewController, DocumentDelegate, GADBannerViewD
4141
@IBOutlet weak var menuButton: UIBarButtonItem!
4242
@IBOutlet weak var bannerView: GADBannerView!
4343
@IBOutlet weak var bannerViewHeight: NSLayoutConstraint!
44+
@IBOutlet weak var barButtonItem: UIBarButtonItem!
4445

4546
private var isFullscreen = false
4647

@@ -55,6 +56,8 @@ class DocumentViewController: UIViewController, DocumentDelegate, GADBannerViewD
5556
override func viewWillAppear(_ animated: Bool) {
5657
super.viewWillAppear(animated)
5758

59+
barButtonItem.title = NSLocalizedString("back_to_documents", comment: "")
60+
5861
segmentedControl.segmentStyle = .textOnly
5962
segmentedControl.underlineSelected = true
6063
segmentedControl.fixedSegmentWidth = true
@@ -302,7 +305,7 @@ class DocumentViewController: UIViewController, DocumentDelegate, GADBannerViewD
302305

303306
func documentUpdateContent(_ doc: Document) {
304307
guard let path = document?.result else {
305-
self.webview.loadHTMLString("<html><h1>Loading</h1></html>", baseURL: nil)
308+
self.webview.loadHTMLString("<html><h1>\(NSLocalizedString("loading", comment: ""))</h1></html>", baseURL: nil)
306309

307310
return
308311
}
@@ -358,7 +361,7 @@ class DocumentViewController: UIViewController, DocumentDelegate, GADBannerViewD
358361
return;
359362
}
360363

361-
self.webview.loadHTMLString("<html><h1>Error</h1>Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.</html>", baseURL: nil)
364+
self.webview.loadHTMLString("<html><h1>\(NSLocalizedString("error", comment: ""))</h1>\(NSLocalizedString("failed_to_load_document", comment: ""))</html>", baseURL: nil)
362365

363366
Analytics.logEvent(
364367
"load_error",

OpenDocumentReader/Main.storyboard

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
<connections>
109109
<outlet property="bannerView" destination="yut-lR-gq5" id="28Z-1b-NAN"/>
110110
<outlet property="bannerViewHeight" destination="dMZ-rD-IOK" id="pi7-sH-NwC"/>
111+
<outlet property="barButtonItem" destination="yhO-7V-lbn" id="ach-z7-H9P"/>
111112
<outlet property="menuButton" destination="Vsd-IL-ujz" id="GoN-tp-egn"/>
112113
<outlet property="progressBar" destination="ePk-bQ-fV8" id="nz6-qw-ouf"/>
113114
<outlet property="segmentedControl" destination="sIx-zo-9kG" id="pCn-x0-Z01"/>

OpenDocumentReader/ca.lproj/Localizable.strings

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,16 @@
7070
/* */
7171
"intro_description_3" = "OpenDocument Reader supports a huge range of other apps to open documents from. A colleague sent a presentation via Gmail? Click the attachment and this app is going to open right away!";
7272

73+
/* */
74+
"back_to_documents" = "Back to documents";
75+
76+
/* */
77+
"loading" = "Loading";
78+
79+
/* */
80+
"error" = "Error";
81+
82+
/* */
83+
"failed_to_load_document" = "Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.";
7384

7485

OpenDocumentReader/cs.lproj/Localizable.strings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,15 @@
7070
/* */
7171
"intro_description_3" = "OpenDocument Reader supports a huge range of other apps to open documents from. A colleague sent a presentation via Gmail? Click the attachment and this app is going to open right away!";
7272

73+
/* */
74+
"back_to_documents" = "Back to documents";
75+
76+
/* */
77+
"loading" = "Loading";
7378

79+
/* */
80+
"error" = "Error";
81+
82+
/* */
83+
"failed_to_load_document" = "Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.";
7484

OpenDocumentReader/da.lproj/Localizable.strings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,15 @@
7070
/* */
7171
"intro_description_3" = "OpenDocument Reader supports a huge range of other apps to open documents from. A colleague sent a presentation via Gmail? Click the attachment and this app is going to open right away!";
7272

73+
/* */
74+
"back_to_documents" = "Back to documents";
75+
76+
/* */
77+
"loading" = "Loading";
7378

79+
/* */
80+
"error" = "Error";
81+
82+
/* */
83+
"failed_to_load_document" = "Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.";
7484

OpenDocumentReader/de.lproj/Localizable.strings

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,16 @@
7070
/* */
7171
"intro_description_3" = "OpenDocument Reader unterstützt eine Vielzahl anderer Apps, um Dokumente zu öffnen. Ein Kollege hat eine Präsentation via Gmail gesendet? Klicken Sie auf den Anhang und diese App wird sofort geöffnet!";
7272

73+
/* */
74+
"back_to_documents" = "Back to documents";
75+
76+
/* */
77+
"loading" = "Loading";
78+
79+
/* */
80+
"error" = "Error";
81+
82+
/* */
83+
"failed_to_load_document" = "Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.";
7384

7485

OpenDocumentReader/en.lproj/Localizable.strings

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,16 @@
7070
/* */
7171
"intro_description_3" = "OpenDocument Reader supports a huge range of other apps to open documents from. A colleague sent a presentation via Gmail? Click the attachment and this app is going to open right away!";
7272

73+
/* */
74+
"back_to_documents" = "Back to documents";
75+
76+
/* */
77+
"loading" = "Loading";
78+
79+
/* */
80+
"error" = "Error";
81+
82+
/* */
83+
"failed_to_load_document" = "Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.";
7384

7485

OpenDocumentReader/es.lproj/Localizable.strings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,15 @@
7070
/* */
7171
"intro_description_3" = "OpenDocument Reader es compatible con una amplia gama de aplicaciones, y puede abrir los documentos creados con ellas. ¿Un compañero ha enviado una presentación a través de Gmail? ¡Haga clic en el archivo adjunto y la aplicación se abrirá de inmediato!";
7272

73+
/* */
74+
"back_to_documents" = "Back to documents";
75+
76+
/* */
77+
"loading" = "Loading";
7378

79+
/* */
80+
"error" = "Error";
81+
82+
/* */
83+
"failed_to_load_document" = "Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.";
7484

OpenDocumentReader/fr.lproj/Localizable.strings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,15 @@
7070
/* */
7171
"intro_description_3" = "OpenDocument Reader prend en charge un grand nombre d’autres applications depuis lesquelles il est possible d’ouvrir des documents. Un collègue a envoyé une présentation via Gmail ? Cliquez sur la pièce jointe et cette application s’ouvrira instantanément !";
7272

73+
/* */
74+
"back_to_documents" = "Back to documents";
75+
76+
/* */
77+
"loading" = "Loading";
7378

79+
/* */
80+
"error" = "Error";
81+
82+
/* */
83+
"failed_to_load_document" = "Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.";
7484

OpenDocumentReader/ga.lproj/Localizable.strings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,15 @@
7070
/* */
7171
"intro_description_3" = "OpenDocument Reader supports a huge range of other apps to open documents from. A colleague sent a presentation via Gmail? Click the attachment and this app is going to open right away!";
7272

73+
/* */
74+
"back_to_documents" = "Back to documents";
75+
76+
/* */
77+
"loading" = "Loading";
7378

79+
/* */
80+
"error" = "Error";
81+
82+
/* */
83+
"failed_to_load_document" = "Failed to load given document. Please try another one while we are working hard to support as many documents as possible. Feel free to contact us via support@opendocument.app for further questions.";
7484

0 commit comments

Comments
 (0)