mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-18 22:23:07 -03:00
Remove name -> LanguageInfo mapping per code review
The GetLanguageInfo method is now implemented in terms of GetLanguageInfoByID. This is possible because you can use GetLanguageID to get the ID for a language.
This commit is contained in:
@ -562,11 +562,12 @@ func GetLanguageGroup(language string) string {
|
||||
|
||||
// GetLanguageInfo returns the LanguageInfo for a given language name, or an error if not found.
|
||||
func GetLanguageInfo(language string) (data.LanguageInfo, error) {
|
||||
if info, ok := data.LanguageInfoByName[language]; ok {
|
||||
return info, nil
|
||||
id, ok := GetLanguageID(language)
|
||||
if !ok {
|
||||
return data.LanguageInfo{}, fmt.Errorf("language %q not found", language)
|
||||
}
|
||||
|
||||
return data.LanguageInfo{}, fmt.Errorf("language %q not found", language)
|
||||
return GetLanguageInfoByID(id)
|
||||
}
|
||||
|
||||
// GetLanguageInfo returns the LanguageInfo for a given language name, or an error if not found.
|
||||
|
Reference in New Issue
Block a user