From 3c61ff68220c8119917597700295e5c2b0658e67 Mon Sep 17 00:00:00 2001 From: tvision106 Date: Wed, 15 Nov 2023 13:24:44 -0500 Subject: [PATCH] fix some issues for long strings --- Support/en.lproj/Localizable.strings | 21 ++++++++----------- Views/BuildingBlocks/ArticleCell.swift | 7 +------ Views/BuildingBlocks/SearchResultRow.swift | 7 +------ Views/Library/ZimFileDetail.swift | 10 ++------- Views/Settings/About.swift | 8 +------ Views/ViewModifiers/ExternalLinkHandler.swift | 5 +---- 6 files changed, 15 insertions(+), 43 deletions(-) diff --git a/Support/en.lproj/Localizable.strings b/Support/en.lproj/Localizable.strings index fd8353f4..fbcd8a24 100644 --- a/Support/en.lproj/Localizable.strings +++ b/Support/en.lproj/Localizable.strings @@ -45,16 +45,14 @@ "Load the link" = "Load the link"; "Cancel" = "Cancel"; "An external link is tapped, do you wish to load the link?" = "An external link is tapped, do you wish to load the link?"; -"An external link is tapped. \ -However, your current setting does not allow it to be loaded." = "An external link is tapped. \ +"loc-extenral-alert" = "An external link is tapped. \ However, your current setting does not allow it to be loaded."; "Open a zim file" = "Open a zim file"; "Unable to open file" = "Unable to open file"; "%@ cannot be opened." = "%@ cannot be opened."; "No snippet" = "No snippet"; "Article Title" = "Article Title"; -"Lorem ipsum dolor sit amet, consectetur adipiscing elit, \ -sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, \ +"loc-article-cell-template" = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, \ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; "Unknown" = "Unknown"; "Yes" = "Yes"; @@ -95,12 +93,10 @@ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; "Download using cellular" = "Download using cellular"; "Unlink" = "Unlink"; "Unlink %@" = "Unlink %@"; -"All bookmarked articles linked to this zim file will be deleted, \ -but the original file will remain in place." = "All bookmarked articles linked to this zim file will be deleted, \ +"loc-ZimFileDetail-Alert-unlink" = "All bookmarked articles linked to this zim file will be deleted, \ but the original file will remain in place."; "Delete %@" = "Delete %@"; -"The zim file and all bookmarked articles \ -linked to this zim file will be deleted." = "The zim file and all bookmarked articles \ +"loc-ZimFileDetail-Alert-Delete" = "The zim file and all bookmarked articles \ linked to this zim file will be deleted."; "Download" = "Download"; "Space Warning" = "Space Warning"; @@ -152,9 +148,7 @@ linked to this zim file will be deleted."; "Dependencies" = "Dependencies"; "License" = "License"; "Version" = "Version"; -"Kiwix is an offline reader for online content like Wikipedia, Project Gutenberg, or TED Talks. \ -It makes knowledge available to people with no or limited internet access. \ -The software as well as the content is free to use for anyone." = "Kiwix is an offline reader for online content like Wikipedia, Project Gutenberg, or TED Talks. \ +"loc-About-description" = "Kiwix is an offline reader for online content like Wikipedia, Project Gutenberg, or TED Talks. \ It makes knowledge available to people with no or limited internet access. \ The software as well as the content is free to use for anyone."; "This app is released under the terms of the GNU General Public License version 3." = "This app is released under the terms of the GNU General Public License version 3."; @@ -203,4 +197,7 @@ The software as well as the content is free to use for anyone."; "Vikidia" = "Vikidia"; "StackExchange" = "StackExchange"; "Other" = "Other"; - +"Disabled" = "Disabled"; +"First Paragraph" = "First Paragraph"; +"First Sentence" = "First Sentence"; +"Matches" = "Matches"; diff --git a/Views/BuildingBlocks/ArticleCell.swift b/Views/BuildingBlocks/ArticleCell.swift index fa8069c8..f947e7dd 100644 --- a/Views/BuildingBlocks/ArticleCell.swift +++ b/Views/BuildingBlocks/ArticleCell.swift @@ -65,12 +65,7 @@ struct ArticleCell: View { struct ArticleCell_Previews: PreviewProvider { static let result: SearchResult = { let result = SearchResult(zimFileID: UUID(), path: "", title: "Article Title".localized)! - result.snippet = NSAttributedString(string: - """ - Lorem ipsum dolor sit amet, consectetur adipiscing elit, \ - sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - """.localized - ) + result.snippet = NSAttributedString(string:"loc-article-cell-template".localized) return result }() diff --git a/Views/BuildingBlocks/SearchResultRow.swift b/Views/BuildingBlocks/SearchResultRow.swift index 57edb5f0..249f72cd 100644 --- a/Views/BuildingBlocks/SearchResultRow.swift +++ b/Views/BuildingBlocks/SearchResultRow.swift @@ -39,12 +39,7 @@ struct SearchResultRow: View { struct SearchResultRow_Previews: PreviewProvider { static let result: SearchResult = { let result = SearchResult(zimFileID: UUID(), path: "", title: "Article Title".localized)! - result.snippet = NSAttributedString(string: - """ - Lorem ipsum dolor sit amet, consectetur adipiscing elit, \ - sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - """.localized - ) + result.snippet = NSAttributedString(string:"loc-article-cell-template".localized) return result }() diff --git a/Views/Library/ZimFileDetail.swift b/Views/Library/ZimFileDetail.swift index 4b58afaa..7bfafb0a 100644 --- a/Views/Library/ZimFileDetail.swift +++ b/Views/Library/ZimFileDetail.swift @@ -117,10 +117,7 @@ struct ZimFileDetail: View { }.alert(isPresented: $isPresentingUnlinkAlert) { Alert( title: Text("Unlink %@".localizedWithFormat(withArgs: zimFile.name)), - message: Text(""" - All bookmarked articles linked to this zim file will be deleted, \ - but the original file will remain in place. - """), + message: Text("loc-ZimFileDetail-Alert-unlink".localized), primaryButton: .destructive(Text("Unlink".localized)) { LibraryOperations.unlink(zimFileID: zimFile.fileID) #if os(iOS) @@ -138,10 +135,7 @@ struct ZimFileDetail: View { }.alert(isPresented: $isPresentingDeleteAlert) { Alert( title: Text("Delete %@".localizedWithFormat(withArgs: zimFile.name)), - message: Text(""" - The zim file and all bookmarked articles \ - linked to this zim file will be deleted. - """.localized), + message: Text("loc-ZimFileDetail-Alert-Delete".localized), primaryButton: .destructive(Text("Delete".localized)) { LibraryOperations.delete(zimFileID: zimFile.fileID) #if os(iOS) diff --git a/Views/Settings/About.swift b/Views/Settings/About.swift index 72d5bed7..3db016d6 100644 --- a/Views/Settings/About.swift +++ b/Views/Settings/About.swift @@ -78,13 +78,7 @@ struct About: View { } private var about: some View { - Text( - """ - Kiwix is an offline reader for online content like Wikipedia, Project Gutenberg, or TED Talks. \ - It makes knowledge available to people with no or limited internet access. \ - The software as well as the content is free to use for anyone. - """.localized - ) + Text("loc-About-description".localized) } private var release: some View { diff --git a/Views/ViewModifiers/ExternalLinkHandler.swift b/Views/ViewModifiers/ExternalLinkHandler.swift index f48bde1a..4d3860d4 100644 --- a/Views/ViewModifiers/ExternalLinkHandler.swift +++ b/Views/ViewModifiers/ExternalLinkHandler.swift @@ -53,10 +53,7 @@ struct ExternalLinkHandler: ViewModifier { case .ask: Text("An external link is tapped, do you wish to load the link?".localized) case .notLoading: - Text(""" - An external link is tapped. \ - However, your current setting does not allow it to be loaded. - """.localized) + Text("loc-extenral-alert".localized) } } #if os(iOS)