[Enhancement] String localisation #21
@ -16,6 +16,10 @@ public extension Bundle {
|
|||||||
|
|
||||||
// MARK: Functions
|
// MARK: Functions
|
||||||
|
|
||||||
|
/// Retrieve a localisation bundle for a given language code or identifier, if exist inside a certain bundle.
|
||||||
|
/// - Parameter languageCode: A string that represent a language code or identifier.
|
||||||
|
/// - Returns: A `Bundle` instance that contains localised resources based on a given language code or identifier.
|
||||||
|
/// - Throws: A `BundleError` error in case the localisation bundle for a given language code or identifier is not found inside a certain bundle.
|
||||||
func localisation(for languageCode: String) throws -> Bundle {
|
func localisation(for languageCode: String) throws -> Bundle {
|
||||||
guard
|
guard
|
||||||
let path = path(forResource: languageCode, ofType: .ResourceType.localisationBundle),
|
let path = path(forResource: languageCode, ofType: .ResourceType.localisationBundle),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user