// 宣言部
var currentLanguage :NSString = “”
fileprivate lazy var preferredLanguage:String? = {
let languages = Locale.preferredLanguages
return languages.first
}()
// function内
currentLanguage = (preferredLanguage! as NSString).substring(to: 2) as NSString
var Str = “ABCDE”
if currentLanguage == “ja” { Str = “あいうえお” }