In Turkish, there are two i
- Dotless: ı, I
- Dotted: i, İ
PROBLEM: Every time I uppercase an i, I get an I.
I want to get an İ (only in Turkish) when I uppercase an i, and an I when I uppercase an ı.
I have a function to do it
@objc public static func uppercaseTurkishString(_ string: String) -> String {
return String(string.map { (char) -> Character in
if char == "i" {
return "İ"
} else {
return Character(String(char).uppercased())
}
})
}
But I have to check if the language is Turkish every time I use it, and doing it for every single string in the app is a very hard job.
Is there an easier way to do it?