Skip to content

Commit

Permalink
musixmatch language codes are crazy
Browse files Browse the repository at this point in the history
  • Loading branch information
whoeevee committed Jul 11, 2024
1 parent e3ef26a commit cb8e982
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
}

Expand All @@ -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
Expand Down

0 comments on commit cb8e982

Please sign in to comment.