[Enhancement] String localisation #21

Merged
javier merged 6 commits from enhancement/localisable-strings into main 2023-05-19 16:58:51 +00:00
Showing only changes of commit 41f019d7b2 - Show all commits

View File

@ -16,6 +16,10 @@ public extension Bundle {
// 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 {
guard
let path = path(forResource: languageCode, ofType: .ResourceType.localisationBundle),