Last active
February 10, 2017 17:41
-
-
Save jayrhynas/5e350b6cbd86e0a35d9aa94592ecf4ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let subtitleText = SoundPackStrings.DownloadSizeShort(size) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LocalizedString.swift | |
// Medly | |
// | |
// Created by Jayson Rhynas on 2016-03-29. | |
// Copyright © 2016 Medly Labs Inc. All rights reserved. | |
// | |
import Foundation | |
func LocalizedString(_ key: String, tableName: String? = nil) -> String { | |
return Bundle.main.localizedString(forKey: key, value: nil, table: tableName) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SoundPackStrings.swift | |
// Medly | |
// | |
// Created by Jayson Rhynas on 2016-03-26. | |
// Copyright © 2016 Medly Labs Inc. All rights reserved. | |
// | |
import Foundation | |
class SoundPackStrings: NSObject { | |
private class func LS(_ key: String, _ args: CVarArg...) -> String { | |
return String(format: LocalizedString(key, tableName: "SoundPacks"), locale: Locale.current, arguments: args) | |
} | |
class var Starter: String { return LS("Starter") } | |
class var Essentials: String { return LS("Essentials") } | |
class var Rock: String { return LS("Rock") } | |
class var Jazz: String { return LS("Jazz") } | |
class var Classical: String { return LS("Classical") } | |
class var House: String { return LS("House") } | |
class var Trance: String { return LS("Trance") } | |
class var FutureBass: String { return LS("FutureBass") } | |
class var Band: String { return LS("Band") } | |
class var Demo: String { return LS("Demo") } | |
class var DemoFootnote: String { return LS("DemoFootnote") } | |
class var FullName: (_ pack: String) -> String { | |
return { pack in LS("FullName", pack) } | |
} | |
class var IncludedString: String { return LS("IncludedString") } | |
class var DownloadSize: (_ size: String) -> String { | |
return { size in LS("DownloadSize", size) } | |
} | |
class var DownloadSizeShort: (_ size: String) -> String { | |
return {size in LS("DownloadSizeShort", size) } | |
} | |
class var BandSubtitle: (_ numOfInsts: Int) -> String { | |
return {numOfInsts in LS("BandSubtitle", numOfInsts) } | |
} | |
class var BandTotalCost: (_ cost: String) -> String { | |
return { cost in LS("BandTotalCost", cost) } | |
} | |
class var BandDescription: (_ cost: String? ) -> String { | |
return { cost in | |
let desc1 = LS("BandDesc1") | |
if let cost = cost { | |
let desc2 = LS("BandDesc2", cost) | |
return "\(desc1)\n\n\(desc2)" | |
} | |
return desc1 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment