localizations

This commit is contained in:
Chris Li 2016-10-04 11:43:57 -04:00
parent aa57c0e97c
commit 3a8a83ae56
13 changed files with 62 additions and 331 deletions

View File

@ -86,7 +86,7 @@ class BookmarkController: UITableViewController, NSFetchedResultsControllerDeleg
}
func titleForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString! {
let text = NSLocalizedString("Bookmarks", comment: "Bookmarks view title")
let text = LocalizedStrings.bookmarks
let attributes = [NSFontAttributeName: UIFont.boldSystemFontOfSize(18.0),
NSForegroundColorAttributeName: UIColor.darkGrayColor()]
return NSAttributedString(string: text, attributes: attributes)

View File

@ -285,36 +285,32 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp
}
class LocalizedStrings {
private static let comment = "Library, Book Detail"
static let hasPic = NSLocalizedString("Pictures", comment: comment)
static let noPic = NSLocalizedString("No Picture", comment: comment)
static let hasPic = NSLocalizedString("Pictures", comment: "Library, Book Detail")
static let noPic = NSLocalizedString("No Picture", comment: "Library, Book Detail")
static let download = NSLocalizedString("Download", comment: comment)
static let downloading = NSLocalizedString("Downloading", comment: comment)
static let spaceNotEnough = NSLocalizedString("Space Not Enough", comment: comment)
static let remove = NSLocalizedString("Remove", comment: comment)
static let addUsingiTunesFileSharing = NSLocalizedString("Add using iTunes File Sharing", comment: comment)
// static let pause = NSLocalizedString("Pause", comment: comment)
// static let resume = NSLocalizedString("Resume", comment: comment)
// static let cancel = NSLocalizedString("Cancel", comment: comment)
static let download = NSLocalizedString("Download", comment: "Library, Book Detail")
static let downloading = NSLocalizedString("Downloading", comment: "Library, Book Detail")
static let spaceNotEnough = NSLocalizedString("Space Not Enough", comment: "Library, Book Detail")
static let remove = NSLocalizedString("Remove", comment: "Library, Book Detail")
static let addUsingiTunesFileSharing = NSLocalizedString("Add using iTunes File Sharing", comment: "Library, Book Detail")
static let bookmarks = NSLocalizedString("Bookmarks", comment: comment)
static let bookInfo = NSLocalizedString("Book Info", comment: comment)
static let size = NSLocalizedString("Size", comment: comment)
static let createDate = NSLocalizedString("Creation Date", comment: comment)
static let arcitleCount = NSLocalizedString("Article Count", comment: comment)
static let language = NSLocalizedString("Language", comment: comment)
static let creator = NSLocalizedString("Creator", comment: comment)
static let publisher = NSLocalizedString("Publisher", comment: comment)
static let index = NSLocalizedString("Index", comment: comment)
static let bookmarks = NSLocalizedString("Bookmarks", comment: "Library, Book Detail")
static let bookInfo = NSLocalizedString("Book Info", comment: "Library, Book Detail")
static let size = NSLocalizedString("Size", comment: "Library, Book Detail")
static let createDate = NSLocalizedString("Creation Date", comment: "Library, Book Detail")
static let arcitleCount = NSLocalizedString("Article Count", comment: "Library, Book Detail")
static let language = NSLocalizedString("Language", comment: "Library, Book Detail")
static let creator = NSLocalizedString("Creator", comment: "Library, Book Detail")
static let publisher = NSLocalizedString("Publisher", comment: "Library, Book Detail")
static let index = NSLocalizedString("Index", comment: "Library, Book Detail")
static let none = NSLocalizedString("None", comment: comment)
static let embedded = NSLocalizedString("Embedded", comment: comment)
static let external = NSLocalizedString("External", comment: comment)
static let none = NSLocalizedString("None", comment: "Library, Book Detail, Index Status")
static let embedded = NSLocalizedString("Embedded", comment: "Library, Book Detail, Index Status")
static let external = NSLocalizedString("External", comment: "Library, Book Detail, Index Status")
static let pid = NSLocalizedString("Persistent ID", comment: comment)
static let pidNote = NSLocalizedString("This ID does not change in different versions of the same book.", comment: comment)
static let pid = NSLocalizedString("Persistent ID", comment: "Library, Book Detail")
static let pidNote = NSLocalizedString("This ID does not change in different versions of the same book.", comment: "Library, Book Detail")
static let copyURL = NSLocalizedString("Copy URL", comment: comment)
static let copyURL = NSLocalizedString("Copy URL", comment: "Library, Book Detail")
}
}

View File

@ -143,7 +143,7 @@ class CloudBooksController: UITableViewController, NSFetchedResultsControllerDel
let hud = MBProgressHUD.showHUDAddedTo(view, animated: true)
hud.mode = .Text
hud.label.numberOfLines = 0
hud.label.text = LocalizedStrings.libRefreshSuccessMessage
hud.label.text = NSLocalizedString("Library is refreshed successfully!", comment: "Library, cloud tab")
hud.hideAnimated(true, afterDelay: 2)
}
@ -378,13 +378,4 @@ class CloudBooksController: UITableViewController, NSFetchedResultsControllerDel
tableView.endUpdates()
}
// MARK: - LocalizedStrings
class LocalizedStrings{
static let cloud = NSLocalizedString("Cloud", comment: "Library, cloud tab")
static let download = NSLocalizedString("Download", comment: "Library, cloud tab")
static let spaceNotEnough = NSLocalizedString("Space Not Enough", comment: "Library, cloud tab")
static let libRefreshSuccessMessage = NSLocalizedString("Library is refreshed successfully!", comment: "Library, cloud tab")
}
}

View File

@ -118,7 +118,7 @@ class DownloadTasksController: UITableViewController, NSFetchedResultsController
if string.containsString("") {
return string.stringByReplacingOccurrencesOfString("", withString: "\n")
} else {
return string + "\n" + LocalizedStrings.estimating
return string + "\n" + NSLocalizedString("Estimating", comment: "Library, download tab")
}
} else {
return string + "\n" + String(downloadTask.state)
@ -131,7 +131,8 @@ class DownloadTasksController: UITableViewController, NSFetchedResultsController
cell.detailLabel.text = {
let downloadedSize = NSByteCountFormatter.stringFromByteCount(downloadTask.totalBytesWritten, countStyle: .File)
let fileSize = book.fileSizeDescription
return String(format: LocalizedStrings.percentCompleted, downloadedSize, fileSize) + "\n" + String(downloadTask.state)
return String(format: NSLocalizedString("%@ of %@ completed", comment: "Library, download tab"), downloadedSize, fileSize)
+ "\n" + String(downloadTask.state)
}()
}
}
@ -289,19 +290,4 @@ class DownloadTasksController: UITableViewController, NSFetchedResultsController
//refreshTabBarBadgeCount()
}
// MARK: - LocalizedStrings
class LocalizedStrings {
static let download = NSLocalizedString("Download", comment: "Library, download tab")
static let pause = NSLocalizedString("Pause", comment: "Library, download tab")
static let resume = NSLocalizedString("Resume", comment: "Library, download tab")
static let restart = NSLocalizedString("Restart", comment: "Library, download tab")
static let cancel = NSLocalizedString("Cancel", comment: "Library, download tab")
static let estimating = NSLocalizedString("Estimating", comment: "Library, download tab")
static let percentCompleted = NSLocalizedString("%@ of %@ completed", comment: "Library, download tab")
}
}

View File

@ -25,7 +25,7 @@ class LanguageFilterController: UITableViewController, NSFetchedResultsControlle
override func viewDidLoad() {
super.viewDidLoad()
title = LocalizedStrings.LangFilter.languages
title = NSLocalizedString("Languages", comment: "Library, Language Filter")
tableView.emptyDataSetSource = self
tableView.emptyDataSetDelegate = self
@ -60,10 +60,10 @@ class LanguageFilterController: UITableViewController, NSFetchedResultsControlle
sortSegmentedControl.selectedSegmentIndex = Preference.LangFilter.sortByAlphabeticalAsc == true ? 1: 0
langNameSegmentedControl.selectedSegmentIndex = Preference.LangFilter.displayInOriginalLocale == true ? 1 : 0
sortSegmentedControl.setTitle(LocalizedStrings.LangFilter.count, forSegmentAtIndex: 0)
sortSegmentedControl.setTitle(LocalizedStrings.LangFilter.a_z, forSegmentAtIndex: 1)
sortSegmentedControl.setTitle(NSLocalizedString("Count", comment: "Library, Language Filter"), forSegmentAtIndex: 0)
sortSegmentedControl.setTitle(NSLocalizedString("A-Z", comment: "Library, Language Filter"), forSegmentAtIndex: 1)
langNameSegmentedControl.setTitle(NSLocale.currentLocale().displayNameForKey(NSLocaleIdentifier, value: NSLocale.preferredLangCodes[0]), forSegmentAtIndex: 0)
langNameSegmentedControl.setTitle(LocalizedStrings.LangFilter.original, forSegmentAtIndex: 1)
langNameSegmentedControl.setTitle(NSLocalizedString("Original", comment: "Library, Language Filter"), forSegmentAtIndex: 1)
}
func sort() {
@ -83,16 +83,16 @@ class LanguageFilterController: UITableViewController, NSFetchedResultsControlle
switch showLanguages.count {
case 0:
return LocalizedStrings.LangFilter.noLangSelected
return NSLocalizedString("All languages will be displayed", comment: "Library, Language Filter")
case 1:
guard let name = firstName else {return nil}
return String(format: LocalizedStrings.LangFilter.oneLangSelected, name)
return String(format: NSLocalizedString("%@ is selected", comment: "Library, Language Filter"), name)
case 2:
guard let name0 = firstName else {return nil}
guard let name1 = secondName else {return nil}
return String(format: LocalizedStrings.LangFilter.twoLangSelected, name0, name1)
return String(format: NSLocalizedString("%@ and %@ are selected", comment: "Library, Language Filter"), name0, name1)
default:
return String(format: LocalizedStrings.LangFilter.someLangSelected, showLanguages.count)
return String(format: NSLocalizedString("%d languages are selected", comment: "Library, Language Filter"), showLanguages.count)
}
}
@ -219,18 +219,3 @@ protocol LanguageFilterUpdating: class {
func languageFilterChanged()
func languageFilterFinsihEditing(hasChanges: Bool)
}
extension LocalizedStrings {
class LangFilter {
private static let comment = "Library, Language Filter"
class var languages: String {return NSLocalizedString("Languages", comment: "Library, Language Filter")}
class var noLangSelected: String {return NSLocalizedString("All languages will be displayed", comment: "Library, Language Filter")}
class var oneLangSelected: String {return NSLocalizedString("%@ is selected", comment: "Library, Language Filter")}
class var twoLangSelected: String {return NSLocalizedString("%@ and %@ are selected", comment: "Library, Language Filter")}
class var someLangSelected: String {return NSLocalizedString("%d languages are selected", comment: "Library, Language Filter")}
class var count: String {return NSLocalizedString("Count", comment: "Library, Language Filter")}
class var a_z: String {return NSLocalizedString("A-Z", comment: "Library, Language Filter")}
class var original: String {return NSLocalizedString("Original", comment: "Library, Language Filter")}
}
}

View File

@ -93,9 +93,9 @@ class LocalBooksController: UITableViewController, NSFetchedResultsControllerDel
case "2":
return LocalizedStrings.local
case "3":
return LocalizedStrings.retainedByBookmarks
return NSLocalizedString("Retained by Bookmarks", comment: "Library, local tab")
case "4":
return LocalizedStrings.purgeable
return NSLocalizedString("Purgeable", comment: "Library, local tab")
default:
return nil
}
@ -186,13 +186,4 @@ class LocalBooksController: UITableViewController, NSFetchedResultsControllerDel
func controllerDidChangeContent(controller: NSFetchedResultsController) {
tableView.endUpdates()
}
// MARK: - LocalizedStrings
class LocalizedStrings{
static let local = NSLocalizedString("Local", comment: "Library, local tab")
static let remove = NSLocalizedString("Remove", comment: "Library, local tab")
static let retainedByBookmarks = NSLocalizedString("Retained by Bookmarks", comment: "Library, local tab")
static let purgeable = NSLocalizedString("Purgeable", comment: "Library, local tab")
}
}

View File

@ -12,7 +12,7 @@ import Operations
class SpaceNotEnoughAlert: AlertOperation<UIViewController> {
init(context: UIViewController) {
super.init(presentAlertFrom: context)
title = LocalizedStrings.Library.spaceNotEnough
title = LocalizedStrings.spaceNotEnough
message = NSLocalizedString("Please free up some space and try again.", comment: "Library, Space Alert")
addActionWithTitle(LocalizedStrings.cancel)
}
@ -141,7 +141,7 @@ class CannotFinishHandoffAlert: AlertOperation<UIViewController> {
super.init(presentAlertFrom: context)
title = NSLocalizedString("Cannot Finish Handoff", comment: "Cannot Finish Handoff Alert")
message = NSLocalizedString("The book required to complete the Handoff is not on the device. Please download the book and try again.", comment: "Cannot Finish Handoff Alert")
addActionWithTitle(LocalizedStrings.ok)
addActionWithTitle(LocalizedStrings.done)
}
}

View File

@ -31,11 +31,7 @@ class FontSizeController: UITableViewController {
// MARK: - Table view data source
override func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? {
return LocalizedStrings.fontSizeMessage
return NSLocalizedString("Drag the slider above to adjust the font size of the article. The size of the percentage numbers shows the acutal font size of article body on screen.", comment: "Setting: Font Size")
}
}
extension LocalizedStrings {
class var fontSizeMessage: String {return NSLocalizedString("Drag the slider above to adjust the font size of the article. The size of the percentage numbers shows the acutal font size of article body on screen.", comment: "Setting: Font Size")}
}

View File

@ -52,7 +52,7 @@ class SettingDetailController: UITableViewController {
return cell
case .SearchHistory:
let cell = tableView.dequeueReusableCellWithIdentifier("CenterTextCell", forIndexPath: indexPath)
cell.textLabel?.text = LocalizedStrings.clearSearchHistory
cell.textLabel?.text = NSLocalizedString("Clear Search History", comment: "")
return cell
}
}
@ -72,9 +72,8 @@ class SettingDetailController: UITableViewController {
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
guard let title = tableView.cellForRowAtIndexPath(indexPath)?.textLabel?.text else {return}
switch title {
case LocalizedStrings.clearSearchHistory:
switch page {
case .SearchHistory:
Preference.RecentSearch.terms = [String]()
let controller = UIAlertController(title: NSLocalizedString("Cleared", comment: "Setting, search history cleared"),
message: NSLocalizedString("Your search history has been cleared!", comment: "Setting, search history cleared"),
@ -86,11 +85,6 @@ class SettingDetailController: UITableViewController {
return
}
}
}
extension LocalizedStrings {
static let clearSearchHistory = NSLocalizedString("Clear Search History", comment: "")
}
enum SettingDetailControllerContentType: String {

View File

@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.8.1595</string>
<string>1.8.1660</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.8.1595</string>
<string>1.8.1660</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>

View File

@ -37,8 +37,6 @@
9726591B1D8DB91200D1DFFB /* DownloadProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9726591A1D8DB91200D1DFFB /* DownloadProgress.swift */; };
9726591D1D90A64600D1DFFB /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9726591C1D90A64500D1DFFB /* Notifications.swift */; };
9734E54E1D289D060061C39B /* Welcome.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9734E54D1D289D060061C39B /* Welcome.storyboard */; };
973BCD011CEB3FA500F10B44 /* Kiwix_OSXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD001CEB3FA500F10B44 /* Kiwix_OSXTests.swift */; };
973BCD0C1CEB3FA500F10B44 /* Kiwix_OSXUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD0B1CEB3FA500F10B44 /* Kiwix_OSXUITests.swift */; };
973BCD1A1CEB402900F10B44 /* KiwixTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973BCD181CEB402900F10B44 /* KiwixTests.swift */; };
973DD40F1D343F2F009D45DB /* libicudata.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD4041D343F2F009D45DB /* libicudata.a */; };
973DD4101D343F2F009D45DB /* libicui18n.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 973DD4051D343F2F009D45DB /* libicui18n.a */; };
@ -206,10 +204,8 @@
9726591A1D8DB91200D1DFFB /* DownloadProgress.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadProgress.swift; sourceTree = "<group>"; };
9726591C1D90A64500D1DFFB /* Notifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Notifications.swift; sourceTree = "<group>"; };
9734E54D1D289D060061C39B /* Welcome.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Welcome.storyboard; path = "Kiwix-iOS/Storyboard/Welcome.storyboard"; sourceTree = SOURCE_ROOT; };
973BCCFC1CEB3FA400F10B44 /* Kiwix-OSXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Kiwix-OSXTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
973BCD001CEB3FA500F10B44 /* Kiwix_OSXTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Kiwix_OSXTests.swift; sourceTree = "<group>"; };
973BCD021CEB3FA500F10B44 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
973BCD071CEB3FA500F10B44 /* Kiwix-OSXUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Kiwix-OSXUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
973BCD0B1CEB3FA500F10B44 /* Kiwix_OSXUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Kiwix_OSXUITests.swift; sourceTree = "<group>"; };
973BCD0D1CEB3FA500F10B44 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
973BCD171CEB402900F10B44 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Kiwix-iOSTests/Info.plist"; sourceTree = SOURCE_ROOT; };
@ -321,20 +317,6 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
973BCCF91CEB3FA400F10B44 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
973BCD041CEB3FA500F10B44 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9779C3101D4575AD0064CC8E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@ -729,8 +711,6 @@
97A2AB881C1B80FF00052E74 /* Kiwix.app */,
97A2AB9F1C1B80FF00052E74 /* Kiwix-iOSTests.xctest */,
97A2ABAA1C1B810000052E74 /* Kiwix-iOSUITests.xctest */,
973BCCFC1CEB3FA400F10B44 /* Kiwix-OSXTests.xctest */,
973BCD071CEB3FA500F10B44 /* Kiwix-OSXUITests.xctest */,
9779C3131D4575AD0064CC8E /* Bookmarks.appex */,
);
name = Products;
@ -851,40 +831,6 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
973BCCFB1CEB3FA400F10B44 /* Kiwix-OSXTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 973BCD111CEB3FA500F10B44 /* Build configuration list for PBXNativeTarget "Kiwix-OSXTests" */;
buildPhases = (
973BCCF81CEB3FA400F10B44 /* Sources */,
973BCCF91CEB3FA400F10B44 /* Frameworks */,
973BCCFA1CEB3FA400F10B44 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Kiwix-OSXTests";
productName = "Kiwix-OSXTests";
productReference = 973BCCFC1CEB3FA400F10B44 /* Kiwix-OSXTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
973BCD061CEB3FA500F10B44 /* Kiwix-OSXUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 973BCD141CEB3FA500F10B44 /* Build configuration list for PBXNativeTarget "Kiwix-OSXUITests" */;
buildPhases = (
973BCD031CEB3FA500F10B44 /* Sources */,
973BCD041CEB3FA500F10B44 /* Frameworks */,
973BCD051CEB3FA500F10B44 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Kiwix-OSXUITests";
productName = "Kiwix-OSXUITests";
productReference = 973BCD071CEB3FA500F10B44 /* Kiwix-OSXUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
9779C3121D4575AD0064CC8E /* Bookmarks */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9779C31F1D4575AE0064CC8E /* Build configuration list for PBXNativeTarget "Bookmarks" */;
@ -972,14 +918,6 @@
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Wikimedia CH";
TargetAttributes = {
973BCCFB1CEB3FA400F10B44 = {
CreatedOnToolsVersion = 7.3.1;
TestTargetID = 973BCCE81CEB3FA400F10B44;
};
973BCD061CEB3FA500F10B44 = {
CreatedOnToolsVersion = 7.3.1;
TestTargetID = 973BCCE81CEB3FA400F10B44;
};
9779C3121D4575AD0064CC8E = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = L7HWM3SP3L;
@ -1035,28 +973,12 @@
97A2AB871C1B80FF00052E74 /* Kiwix-iOS */,
97A2AB9E1C1B80FF00052E74 /* Kiwix-iOSTests */,
97A2ABA91C1B810000052E74 /* Kiwix-iOSUITests */,
973BCCFB1CEB3FA400F10B44 /* Kiwix-OSXTests */,
973BCD061CEB3FA500F10B44 /* Kiwix-OSXUITests */,
9779C3121D4575AD0064CC8E /* Bookmarks */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
973BCCFA1CEB3FA400F10B44 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
973BCD051CEB3FA500F10B44 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9779C3111D4575AD0064CC8E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@ -1185,22 +1107,6 @@
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
973BCCF81CEB3FA400F10B44 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
973BCD011CEB3FA500F10B44 /* Kiwix_OSXTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
973BCD031CEB3FA500F10B44 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
973BCD0C1CEB3FA500F10B44 /* Kiwix_OSXUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9779C30F1D4575AD0064CC8E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -1377,72 +1283,6 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
973BCD121CEB3FA500F10B44 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "Kiwix-OSXTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "org.kiwix.Kiwix-OSXTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Kiwix-OSX.app/Contents/MacOS/Kiwix-OSX";
};
name = Debug;
};
973BCD131CEB3FA500F10B44 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "Kiwix-OSXTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "org.kiwix.Kiwix-OSXTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Kiwix-OSX.app/Contents/MacOS/Kiwix-OSX";
};
name = Release;
};
973BCD151CEB3FA500F10B44 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "Kiwix-OSXUITests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "org.kiwix.Kiwix-OSXUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
TEST_TARGET_NAME = "Kiwix-OSX";
};
name = Debug;
};
973BCD161CEB3FA500F10B44 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "Kiwix-OSXUITests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "org.kiwix.Kiwix-OSXUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
TEST_TARGET_NAME = "Kiwix-OSX";
};
name = Release;
};
9779C3201D4575AE0064CC8E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -1704,24 +1544,6 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
973BCD111CEB3FA500F10B44 /* Build configuration list for PBXNativeTarget "Kiwix-OSXTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
973BCD121CEB3FA500F10B44 /* Debug */,
973BCD131CEB3FA500F10B44 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
973BCD141CEB3FA500F10B44 /* Build configuration list for PBXNativeTarget "Kiwix-OSXUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
973BCD151CEB3FA500F10B44 /* Debug */,
973BCD161CEB3FA500F10B44 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9779C31F1D4575AE0064CC8E /* Build configuration list for PBXNativeTarget "Bookmarks" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@ -16,8 +16,7 @@ extension String {
return formatter.stringFromDate(date)
}
static func formattedFileSizeString(fileBytes: Int64?) -> String {
guard let fileBytes = fileBytes else {return LocalizedStrings.unknown}
static func formattedFileSizeString(fileBytes: Int64) -> String {
return NSByteCountFormatter.stringFromByteCount(fileBytes, countStyle: .File)
}
@ -49,52 +48,23 @@ extension String {
}
class LocalizedStrings {
static let download = NSLocalizedString("Download", comment: "Common")
static let bookmarks = NSLocalizedString("Bookmarks", comment: "Common")
static let search = NSLocalizedString("Search", comment: "Common")
static let cloud = NSLocalizedString("Cloud", comment: "Common")
static let download = NSLocalizedString("Download", comment: "Common")
static let local = NSLocalizedString("Local", comment: "Common")
static let spaceNotEnough = NSLocalizedString("Space Not Enough", comment: "Common")
static let pause = NSLocalizedString("Pause", comment: "Common")
static let resume = NSLocalizedString("Resume", comment: "Common")
static let restart = NSLocalizedString("Restart", comment: "Common")
static let cancel = NSLocalizedString("Cancel", comment: "Common")
static let remove = NSLocalizedString("Remove", comment: "Common")
static let yes = NSLocalizedString("Yes", comment: "Common")
static let on = NSLocalizedString("On", comment: "Common")
static let off = NSLocalizedString("Off", comment: "Common")
static let and = NSLocalizedString("and", comment: "Common")
static let done = NSLocalizedString("Done", comment: "Common")
class Library {
static let spaceNotEnough = NSLocalizedString("Space Not Enough", comment: "Library")
}
class var yes: String {return NSLocalizedString("Yes", comment: "Basic")}
class var no: String {return NSLocalizedString("No", comment: "Basic")}
class var on: String {return NSLocalizedString("On", comment: "Basic")}
class var off: String {return NSLocalizedString("Off", comment: "Basic")}
class var and: String {return NSLocalizedString("and", comment: "Basic")}
class var ok: String {return NSLocalizedString("OK", comment: "Basic")}
class var cancel: String {return NSLocalizedString("Cancel", comment: "Basic")}
class var others: String {return NSLocalizedString("Others", comment: "Basic")}
class var unknown: String {return NSLocalizedString("Unknown", comment: "Basic")}
class var disabled: String {return NSLocalizedString("Disabled", comment: "Basic")}
class var remove: String {return NSLocalizedString("Remove", comment: "Basic")}
class var delete: String {return NSLocalizedString("Delete", comment: "Basic")}
class var refreshing: String {return NSLocalizedString("Refreshing...", comment: "Basic")}
class var history: String {return NSLocalizedString("History", comment: "Basic")}
// MARK: - OS X
// class var General: String {return NSLocalizedString("General", comment: "OS X, Preference")}
// class var Library: String {return NSLocalizedString("Library", comment: "OS X, Preference")}
// class var ZimFiles: String {return NSLocalizedString("Zim Files", comment: "OS X, Preference")}
class Common {
private static let comment = "Common"
static let ok = NSLocalizedString("OK", comment: comment)
static let yes = NSLocalizedString("Yes", comment: comment)
static let cancel = NSLocalizedString("Cancel", comment: comment)
}
class LibraryTabTitle {
private static let comment = "Library Tab Titles"
static let cloud = "Cloud"
static let download = "Download"
static let local = "Local"
}
}