}
switch type {
- case .standBy:
- return NSLocalizedString("StandBy", comment: "Airbase action kind")
+ case .standBy: return LocalizedStrings.standBy.string
- case .sortie:
- return NSLocalizedString("Sortie", comment: "Airbase action kind")
+ case .sortie: return LocalizedStrings.sortie.string
- case .airDifence:
- return NSLocalizedString("Air Difence", comment: "Airbase action kind")
+ case .airDifence: return LocalizedStrings.airDifense.string
- case .shelter:
- return NSLocalizedString("Shelter", comment: "Airbase action kind")
+ case .shelter: return LocalizedStrings.shelter.string
- case .rest:
- return NSLocalizedString("Rest", comment: "Airbase action kind")
+ case .rest: return LocalizedStrings.rest.string
}
}
}
guard let v = value as? Int, v == 2 else { return nil }
- return NSLocalizedString("rotating", comment: "AirbasePlaneStateTransformer")
+ return LocalizedStrings.rotating.string
}
}
private var tagString: String? {
- let tag = NSLocalizedString("kancolle", comment: "kancolle twitter hash tag")
+ let tag = LocalizedStrings.tweetTag.string
if tag == "" { return "" }
return "#\(tag)"
case Selector.showHideCombinedView:
if isCombinedMode {
- menuItem.title = NSLocalizedString("Hide Combined View", comment: "View menu, hide combined view")
+ menuItem.title = LocalizedStrings.hideCombinedView.string
} else {
- menuItem.title = NSLocalizedString("Show Combined View", comment: "View menu, show combined view")
+ menuItem.title = LocalizedStrings.showCombinedView.string
}
if fleetViewPosition == .oldStyle { return false }
if battleCellNumber == 0 {
- let format = NSLocalizedString("%@ in sortie into %@ (%@)", comment: "Sortie")
+ let format = LocalizedStrings.sortieInfomation.string
return String(format: format, arguments: [fleetName, areaName, areaNumber])
}
if isBossCell {
- let format = NSLocalizedString("%@ battle against the enemy main fleet at %@ war zone in %@ (%@) now", comment: "Sortie")
+ let format = LocalizedStrings.battleWithBOSS.string
return String(format: format, arguments: [fleetName, battleCellNumber as NSNumber, areaName, areaNumber])
}
- let format = NSLocalizedString("%@ battle at %@ war zone in %@ (%@) now", comment: "Sortie")
+ let format = LocalizedStrings.battleInformation.string
return String(format: format, arguments: [fleetName, battleCellNumber as NSNumber, areaName, areaNumber])
}
case Selector.showBookmark:
if showsBookmarkList() {
- menuItem.title = NSLocalizedString("Hide Bookmark", comment: "Menu item title, Hide Bookmark")
+ menuItem.title = LocalizedStrings.hideBookmark.string
} else {
- menuItem.title = NSLocalizedString("Show Bookmark", comment: "Menu item title, Show Bookmark")
+ menuItem.title = LocalizedStrings.showBookmark.string
}
return true
let untilDate = prevDate.addingTimeInterval(1 * 60)
let date = DateFormatter.localizedString(from: untilDate, dateStyle: .none, timeStyle: .medium)
let alert = NSAlert()
- alert.messageText = NSLocalizedString("Reload interval is too short?", comment: "")
- let format = NSLocalizedString("Reload interval is too short.\nWait until %@.", comment: "")
+ alert.messageText = LocalizedStrings.reloadTimeShortenMessage.string
+ let format = LocalizedStrings.reloadTimeShortenInfo.string
alert.informativeText = String(format: format, date)
alert.runModal()
guard let panelWindow = panel.window else { return }
panel.title = ""
- panel.message = NSLocalizedString("Deleting caches...", comment: "Deleting caches...")
+ panel.message = LocalizedStrings.deletingCacheInfo.string
panel.animate = true
window.beginSheet(panelWindow) { _ in NSSound(named: NSSound.Name("Submarine"))?.play() }
switch frameURL {
case GameViewController.gamePageURL:
- menuItem.title = NSLocalizedString("Reload", comment: "Reload menu, reload")
+ menuItem.title = LocalizedStrings.reload.string
case let s where s.hasPrefix(GameViewController.loginPageURLPrefix):
- menuItem.title = NSLocalizedString("Reload", comment: "Reload menu, reload")
+ menuItem.title = LocalizedStrings.reload.string
default:
- menuItem.title = NSLocalizedString("Back To Game", comment: "Reload menu, back to game")
+ menuItem.title = LocalizedStrings.backToGame.string
}
return true
menuItem.isEnabled = true
if clickedObject.mark {
- menuItem.title = NSLocalizedString("Remove mark", comment: "Remove history mark.")
+ menuItem.title = LocalizedStrings.removeMark.string
} else {
- menuItem.title = NSLocalizedString("Add mark", comment: "Add history mark.")
+ menuItem.title = LocalizedStrings.addMark.string
}
}
if diff > 0 { return }
let notification = NSUserNotification()
- let format = NSLocalizedString("It Will Finish Build at No.%@.", comment: "It Will Finish Build at No.%@.")
+ let format = LocalizedStrings.buildingWillFinish.string
notification.title = String(format: format, number as NSNumber)
notification.informativeText = notification.title
guard let v = value as? Int, let type = LengType(rawValue: v) else { return nil }
switch type {
- case .short:
- return NSLocalizedString("Short", comment: "Range, short")
+ case .short: return LocalizedStrings.short.string
- case .middle:
- return NSLocalizedString("Middle", comment: "Range, middle")
+ case .middle: return LocalizedStrings.middle.string
- case .long:
- return NSLocalizedString("Long", comment: "Range, long")
+ case .long: return LocalizedStrings.long.string
- case .overLong:
- return NSLocalizedString("Very Long", comment: "Range, very long")
+ case .overLong: return LocalizedStrings.overLong.string
}
}
}
--- /dev/null
+//
+// LocalizedStrings.swift
+// KCD
+//
+// Created by Hori,Masaki on 2017/10/01.
+// Copyright © 2017年 Hori,Masaki. All rights reserved.
+//
+
+import Foundation
+
+struct LocalizedStrings {}
+
+/// WindowManager
+extension LocalizedStrings {
+
+ /// Menu itmes
+ static let showHistory = LocalizedString("Show History", comment: "Show History")
+ static let hideHistory = LocalizedString("Hide History", comment: "Hide History")
+ static let showSlotItem = LocalizedString("Show Slot Item", comment: "Show Slot Item")
+ static let hideSlotItem = LocalizedString("Hide Slot Item", comment: "Hide Slot Item")
+ static let showUpgradableShips = LocalizedString("Show Upgradable Ships", comment: "Show Upgradable Ships")
+ static let hideUpgradableShips = LocalizedString("Hide Upgradable Ships", comment: "Hide Upgradable Ships")
+ static let showScreenshotList = LocalizedString("Show Screenshot List", comment: "Show Screenshot List")
+ static let hideScreenshotList = LocalizedString("Hide Screenshot List", comment: "Hide Screenshot List")
+ static let showAirbaseInfo = LocalizedString("Show Air Base Info", comment: "Show Air Base Info")
+ static let hideAirbaseInfo = LocalizedString("Hide Air Base Info", comment: "Hide Air Base Info")
+
+}
+
+/// SokuTransformer
+extension LocalizedStrings {
+
+ static let slow = LocalizedString("Slow", comment: "Speed, slow")
+ static let fast = LocalizedString("Fast", comment: "Speed, fast")
+ static let faster = LocalizedString("Faster", comment: "Speed, faster")
+ static let fastest = LocalizedString("Fastest", comment: "Speed, fastest")
+
+}
+
+/// LengTransformer
+extension LocalizedStrings {
+
+ static let short = LocalizedString("Short", comment: "Range, short")
+ static let middle = LocalizedString("Middle", comment: "Range, middle")
+ static let long = LocalizedString("Long", comment: "Range, long")
+ static let overLong = LocalizedString("Very Long", comment: "Range, very long")
+
+}
+
+/// ActinKindTransformer
+extension LocalizedStrings {
+
+ static let standBy = LocalizedString("StandBy", comment: "Airbase action kind")
+ static let sortie = LocalizedString("Sortie", comment: "Airbase action kind")
+ static let airDifense = LocalizedString("Air Difence", comment: "Airbase action kind")
+ static let shelter = LocalizedString("Shelter", comment: "Airbase action kind")
+ static let rest = LocalizedString("Rest", comment: "Airbase action kind")
+
+}
+
+/// AirbasePlaneStateTransformer
+extension LocalizedStrings {
+
+ static let rotating = LocalizedString("rotating", comment: "AirbasePlaneStateTransformer")
+}
+
+/// MissionStatus
+extension LocalizedStrings {
+
+ static let missionWillReturnMessage = LocalizedString("%@ Will Return From Mission.", comment: "%@ Will Return From Mission.")
+ static let missionWillReturnInformation = LocalizedString("%@ Will Return From %@.", comment: "%@ Will Return From %@.")
+
+}
+
+/// NyukyoDockStatus
+extension LocalizedStrings {
+
+ static let dockingWillFinish = LocalizedString("%@ Will Finish Docking.", comment: "%@ Will Finish Docking.")
+
+}
+
+/// KenzoDockStatus
+extension LocalizedStrings {
+
+ static let buildingWillFinish = LocalizedString("It Will Finish Build at No.%@.", comment: "It Will Finish Build at No.%@.")
+
+}
+
+/// TimeSignalNotifier
+extension LocalizedStrings {
+
+ static let timerSIgnalMessage = LocalizedString("It is soon %zd o'clock.", comment: "It is soon %zd o'clock.")
+
+}
+
+/// StoreCreateSlotItemHistoryCommand
+extension LocalizedStrings {
+
+ static let failDevelop = LocalizedString("fail to develop", comment: "fail to develop")
+
+}
+
+/// BridgeViewController
+extension LocalizedStrings {
+
+ static let tweetTag = LocalizedString("kancolle", comment: "kancolle twitter hash tag")
+
+}
+
+/// BroserWindowController
+extension LocalizedStrings {
+
+ /// Menu items
+ static let showCombinedView = LocalizedString("Show Combined View", comment: "View menu, show combined view")
+ static let hideCombinedView = LocalizedString("Hide Combined View", comment: "View menu, hide combined view")
+
+}
+
+/// GameViewController
+extension LocalizedStrings {
+
+ /// Menu items
+ static let reload = LocalizedString("Reload", comment: "Reload menu, reload")
+ static let backToGame = LocalizedString("Back To Game", comment: "Reload menu, back to game")
+
+ /// Others
+ static let reloadTimeShortenMessage = LocalizedString("Reload interval is too short?", comment: "")
+ static let reloadTimeShortenInfo = LocalizedString("Reload interval is too short.\nWait until %@.", comment: "")
+ static let deletingCacheInfo = LocalizedString("Deleting caches...", comment: "Deleting caches...")
+}
+
+/// DocksViewController
+extension LocalizedStrings {
+
+ static let sortieInfomation = LocalizedString("%@ in sortie into %@ (%@)", comment: "Sortie")
+ static let battleWithBOSS = LocalizedString("%@ battle against the enemy main fleet at %@ war zone in %@ (%@) now", comment: "Sortie")
+ static let battleInformation = LocalizedString("%@ battle at %@ war zone in %@ (%@) now", comment: "Sortie")
+}
+
+/// HistoryTableViewController
+extension LocalizedStrings {
+
+ static let addMark = LocalizedString("Add mark", comment: "Add history mark.")
+ static let removeMark = LocalizedString("Remove mark", comment: "Remove history mark.")
+
+}
+
+/// SlotItemWindowController
+extension LocalizedStrings {
+
+ static let allEquipment = LocalizedString("All", comment: "show equipment type All")
+ static let equiped = LocalizedString("Equiped", comment: "show equipment type Equiped")
+ static let unequiped = LocalizedString("Unequiped", comment: "show equipment type Unequiped")
+
+}
+
+/// UpgradableShipsWindowController
+extension LocalizedStrings {
+
+ static let showKanmusu = LocalizedString("Show Kanmusu", comment: "UpgradableShipsWindowController menu item")
+ static let hideKanmusu = LocalizedString("Hide Kanmusu", comment: "UpgradableShipsWindowController menu item")
+
+}
+
+/// ExternalBrowserWindowController
+extension LocalizedStrings {
+
+ /// Menu Items
+ static let showBookmark = LocalizedString("Show Bookmark", comment: "Menu item title, Show Bookmark")
+ static let hideBookmark = LocalizedString("Hide Bookmark", comment: "Menu item title, Hide Bookmark")
+
+}
guard let fleetName = fleetName else { return }
let notification = NSUserNotification()
- let format = NSLocalizedString("%@ Will Return From Mission.", comment: "%@ Will Return From Mission.")
+ let format = LocalizedStrings.missionWillReturnMessage.string
notification.title = String(format: format, fleetName)
- let txtFormat = NSLocalizedString("%@ Will Return From %@.", comment: "%@ Will Return From %@.")
+ let txtFormat = LocalizedStrings.missionWillReturnInformation.string
notification.informativeText = String(format: txtFormat, fleetName, name!)
if UserDefaults.standard[.playFinishMissionSound] {
if diff >= 1 * 60 { return }
let notification = NSUserNotification()
- let format = NSLocalizedString("%@ Will Finish Docking.", comment: "%@ Will Finish Docking.")
+ let format = LocalizedStrings.dockingWillFinish.string
notification.title = String(format: format, name)
notification.informativeText = notification.title
@objc var showEquipmentTypeTitle: String {
switch UserDefaults.standard[.showEquipmentType] {
- case .all:
- return NSLocalizedString("All", comment: "show equipment type All")
- case .nonEquiped:
- return NSLocalizedString("Unequiped", comment: "show equipment type Unequiped")
+ case .all: return LocalizedStrings.allEquipment.string
- case .equiped:
- return NSLocalizedString("Equiped", comment: "show equipment type Equiped")
+ case .nonEquiped: return LocalizedStrings.unequiped.string
+
+ case .equiped: return LocalizedStrings.equiped.string
}
}
guard let v = value as? Int, let type = SokuType(rawValue: v) else { return nil }
switch type {
- case .slow:
- return NSLocalizedString("Slow", comment: "Speed, slow")
+ case .slow: return LocalizedStrings.slow.string
- case .fast:
- return NSLocalizedString("Fast", comment: "Speed, fast")
+ case .fast: return LocalizedStrings.fast.string
- case .faster:
- return NSLocalizedString("Faster", comment: "Speed, faster")
+ case .faster: return LocalizedStrings.faster.string
- case .fastest:
- return NSLocalizedString("Fastest", comment: "Speed, fastest")
+ case .fastest: return LocalizedStrings.fastest.string
}
}
}
if sccess == 0 {
- return NSLocalizedString("fail to develop", comment: "fail to develop")
+ return LocalizedStrings.failDevelop.string
}
let notification = NSUserNotification()
let hour = cal.component(.hour, from: now)
- let format = NSLocalizedString("It is soon %zd o'clock.", comment: "It is soon %zd o'clock.")
+ let format = LocalizedStrings.timerSIgnalMessage.string
notification.title = String(format: format, hour + 1)
notification.informativeText = notification.title
let shipID = ships[row].id
if isExcludeShipID(shipID) {
- menuItem.title = NSLocalizedString("Show Kanmusu", comment: "UpgradableShipsWindowController menu item")
+ menuItem.title = LocalizedStrings.showKanmusu.string
} else {
- menuItem.title = NSLocalizedString("Hide Kanmusu", comment: "UpgradableShipsWindowController menu item")
+ menuItem.title = LocalizedStrings.hideKanmusu.string
}
return true
case Selector.showHideHistory:
setTitle(menuItem,
historyWindowController.window,
- NSLocalizedString("Show History", comment: "Show History"),
- NSLocalizedString("Hide History", comment: "Hide History"))
+ LocalizedStrings.showHistory.string,
+ LocalizedStrings.hideHistory.string)
return true
case Selector.showHideSlotItemWindow:
setTitle(menuItem,
slotItemWindowController.window,
- NSLocalizedString("Show Slot Item", comment: "Show Slot Item"),
- NSLocalizedString("Hide Slot Item", comment: "Hide Slot Item"))
+ LocalizedStrings.showSlotItem.string,
+ LocalizedStrings.hideSlotItem.string)
return true
case Selector.showHideUpgradableShipWindow:
setTitle(menuItem,
upgradableShipWindowController.window,
- NSLocalizedString("Show Upgradable Ships", comment: "Show Upgradable Ships"),
- NSLocalizedString("Hide Upgradable Ships", comment: "Hide Upgradable Ships"))
+ LocalizedStrings.showUpgradableShips.string,
+ LocalizedStrings.hideUpgradableShips.string)
return true
case Selector.showHideScreenshotListWindow:
setTitle(menuItem,
screenshotListWindowController.window,
- NSLocalizedString("Show Screenshot List", comment: "Show Screenshot List"),
- NSLocalizedString("Hide Screenshot List", comment: "Hide Screenshot List"))
+ LocalizedStrings.showScreenshotList.string,
+ LocalizedStrings.hideScreenshotList.string)
return true
case Selector.showHideAirBaseInfoWindow:
setTitle(menuItem,
airBaseWindowController.window,
- NSLocalizedString("Show Air Base Info", comment: "Show Air Base Info"),
- NSLocalizedString("Hide Air Base Info", comment: "Hide Air Base Info"))
+ LocalizedStrings.showAirbaseInfo.string,
+ LocalizedStrings.hideAirbaseInfo.string)
return true
case Selector.showHidePreferencePanle: