Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Merge: Add ability to localize all texts used in framework #188
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexLittlejohn committed Apr 10, 2017
1 parent 89ae0fd commit 0a5f28b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ALCameraViewController/Utilities/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ internal func radians(_ degrees: Double) -> Double {
}

internal func localizedString(_ key: String) -> String {
return NSLocalizedString(key, tableName: CameraGlobals.shared.stringsTable, bundle: CameraGlobals.shared.bundle, comment: key)
var bundle: Bundle {
if Bundle.main.path(forResource: CameraGlobals.shared.stringsTable, ofType: "strings") != nil {
return Bundle.main
}
return CameraGlobals.shared.bundle
}

return NSLocalizedString(key, tableName: CameraGlobals.shared.stringsTable, bundle: bundle, comment: key)
}

internal func currentRotation(_ oldOrientation: UIInterfaceOrientation, newOrientation: UIInterfaceOrientation) -> Double {
Expand Down

0 comments on commit 0a5f28b

Please sign in to comment.