Skip to content

Commit

Permalink
feat: Transform iOS Locale() to EmailLanguage
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Nov 15, 2024
1 parent 1acf6c8 commit b0b915e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@
package com.infomaniak.multiplatform_swisstransfer.utils

import com.infomaniak.multiplatform_swisstransfer.common.models.EmailLanguage
import platform.Foundation.NSLocale
import platform.Foundation.currentLocale
import platform.Foundation.languageCode

actual class EmailLanguageUtils actual constructor() {
actual fun getEmailLanguageFromLocal(): EmailLanguage {
TODO("Not yet implemented")
val currentLocale = NSLocale.currentLocale
return when (currentLocale.languageCode) {
"fr" -> EmailLanguage.FRENCH
"de" -> EmailLanguage.GERMAN
"it" -> EmailLanguage.ITALIAN
"es" -> EmailLanguage.SPANISH
else -> EmailLanguage.ENGLISH
}
}
}

0 comments on commit b0b915e

Please sign in to comment.