mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-12 22:42:23 +00:00
16 lines
328 B
Go
16 lines
328 B
Go
package slinguist
|
|
|
|
import "strings"
|
|
|
|
// GetLanguageByAlias returns the language related to the given alias or Otherlanguage otherwise.
|
|
func GetLanguageByAlias(alias string) (lang string) {
|
|
a := strings.Split(alias, `,`)[0]
|
|
a = strings.ToLower(a)
|
|
lang, ok := languagesByAlias[a]
|
|
if !ok {
|
|
lang = OtherLanguage
|
|
}
|
|
|
|
return
|
|
}
|