Skip to content

Commit

Permalink
Merge pull request #592 from SourcePointUSA/DIA-5097_add_basque_lang
Browse files Browse the repository at this point in the history
DIA-5097 expand message language support

The following language codes were added:
* Arabic
* Basque
* Bosnian
* Galician
* Maltese
  • Loading branch information
andresilveirah authored Feb 4, 2025
2 parents 6ce38e9 + 6fe1f6b commit f218f0a
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion ConsentViewController/Classes/SPMessageLanguage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import Foundation

/// Languages supported by Message and PM
@objc public enum SPMessageLanguage: Int, Codable {
case Arabic
case Basque
case Bosnian
case BrowserDefault
case English
case Bulgarian
Expand All @@ -22,6 +25,7 @@ import Foundation
case Finnish
case French
case Gaelic
case Galician
case German
case Greek
case Hebrew
Expand All @@ -35,6 +39,7 @@ import Foundation
case Lithuanian
case Macedonian
case Malay
case Maltese
case Norwegian
case Polish
case Portuguese
Expand All @@ -53,11 +58,17 @@ import Foundation

public var rawValue: RawValue {
switch self {
case .Arabic:
return "AR"
// having it empty string instructs the rendering app to use the browser's locale
case .BrowserDefault:
return ""
case .English:
return "EN"
case .Basque:
return "EUS"
case .Bosnian:
return "BS"
case .Bulgarian:
return "BG"
case .Catalan:
Expand All @@ -80,6 +91,8 @@ import Foundation
return "FR"
case .Gaelic:
return "GD"
case .Galician:
return "GL"
case .German:
return "DE"
case .Greek:
Expand All @@ -106,6 +119,8 @@ import Foundation
return "MK"
case .Malay:
return "MS"
case .Maltese:
return "MT"
case .Norwegian:
return "NO"
case .Polish:
Expand Down Expand Up @@ -136,11 +151,17 @@ import Foundation
}
// swiftlint:disable:next cyclomatic_complexity function_body_length
public init?(rawValue: RawValue) {
switch rawValue {
switch rawValue.uppercased() {
case "":
self = .BrowserDefault
case "EN":
self = .English
case "AR":
self = .Arabic
case "EUS":
self = .Basque
case "BS":
self = .Bosnian
case "BG":
self = .Bulgarian
case "CA":
Expand All @@ -163,6 +184,8 @@ import Foundation
self = .French
case "GD":
self = .Gaelic
case "GL":
self = .Galician
case "DE":
self = .German
case "EL":
Expand All @@ -189,6 +212,8 @@ import Foundation
self = .Macedonian
case "MS":
self = .Malay
case "MT":
self = .Maltese
case "NO":
self = .Norwegian
case "PL":
Expand Down

0 comments on commit f218f0a

Please sign in to comment.