diff --git a/languages_substitution.go b/languages_substitution.go index dd5eb67..ba8ad01 100644 --- a/languages_substitution.go +++ b/languages_substitution.go @@ -43,3 +43,15 @@ var esSub = map[rune]string{ '&': "y", '@': "en", } + +var grSub = map[rune]string{ + '&': "kai", + 'η': "i", + 'ή': "i", + 'Η': "i", + 'ι': "i", + 'ί': "i", + 'Ι': "i", + 'χ': "x", + 'Χ': "x", +} diff --git a/slug.go b/slug.go index 354b9a0..2e6d55f 100644 --- a/slug.go +++ b/slug.go @@ -60,6 +60,8 @@ func MakeLang(s string, lang string) (slug string) { slug = SubstituteRune(slug, plSub) case "es": slug = SubstituteRune(slug, esSub) + case "gr": + slug = SubstituteRune(slug, grSub) default: // fallback to "en" if lang not found slug = SubstituteRune(slug, enSub) } diff --git a/slug_test.go b/slug_test.go index 4124154..b923361 100644 --- a/slug_test.go +++ b/slug_test.go @@ -69,6 +69,7 @@ func TestSlugMakeLang(t *testing.T) { {"de", "This & that", "this-und-that"}, {"pl", "This & that", "this-i-that"}, {"es", "This & that", "this-y-that"}, + {"gr", "This & that", "this-kai-that"}, {"test", "This & that", "this-and-that"}, // unknown lang, fallback to "en" }