musixmatch language codes are crazy

This commit is contained in:
eevee
2024-07-11 11:54:05 +03:00
parent e3ef26a826
commit cb8e98263d
2 changed files with 4 additions and 4 deletions
@@ -14,10 +14,10 @@ extension UIColor {
red: r1 * (1.0 - amount) + r2 * amount,
green: g1 * (1.0 - amount) + g2 * amount,
blue: b1 * (1.0 - amount) + b2 * amount,
alpha: a1
alpha: a1 * (1.0 - amount) + a2 * amount
)
}
func lighter(by amount: CGFloat = 0.2) -> Self { mix(with: .white, amount: amount) }
func darker(by amount: CGFloat = 0.2) -> Self { mix(with: .black, amount: amount) }
}
}
@@ -64,7 +64,7 @@ struct EeveeLyricsSettingsView: View {
.foregroundColor(.gray)
}
} footer: {
Text("You can enter a 2-letter ISO language code and see translated lyrics on Musixmatch if they are available. It overrides Romanized Lyrics.")
Text("You can enter a 2-letter Musixmatch language code and see translated lyrics on Musixmatch if they are available. It overrides Romanized Lyrics.")
}
}
@@ -90,7 +90,7 @@ struct EeveeLyricsSettingsView: View {
let selectedLanguage = lyricsOptions.musixmatchLanguage
if selectedLanguage.isEmpty || Locale.isoLanguageCodes.contains(selectedLanguage) {
if selectedLanguage.isEmpty || selectedLanguage ~= "^[\\w\\d]{2}$" {
showLanguageWarning = false
MusixmatchLyricsRepository.shared.selectedLanguage = selectedLanguage