Written the documentation for the "localisation(for:)" function of the Bundle+LocalisationBundle extension.

This commit is contained in:
Javier Cicchelli 2023-05-19 16:46:23 +02:00
parent edfcb049ea
commit 41f019d7b2

View File

@ -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),