Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Italian language substitutions #68

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions languages_substitution.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func init() {
&grSub,
&huSub,
&idSub,
&itSub,
&kkSub,
&nbSub,
&nlSub,
Expand Down Expand Up @@ -122,6 +123,11 @@ var idSub = map[rune]string{
'&': "dan",
}

var itSub = map[rune]string{
'&': "e",
'@': "chiocciola",
}

var kkSub = map[rune]string{
'&': "jane",
'ә': "a",
Expand Down
2 changes: 2 additions & 0 deletions slug.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func MakeLang(s string, lang string) (slug string) {
slug = SubstituteRune(slug, huSub)
case "id", "idn", "ind":
slug = SubstituteRune(slug, idSub)
case "it", "ita":
slug = SubstituteRune(slug, itSub)
case "kz", "kk", "kaz":
slug = SubstituteRune(slug, kkSub)
case "nb", "nob":
Expand Down
2 changes: 2 additions & 0 deletions slug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ func TestSlugMakeLang(t *testing.T) {
{"fr", "This @ that", "this-arobase-that", true},
{"gr", "This & that", "this-kai-that", true},
{"id", "This & that", "this-dan-that", true},
{"it", "This & that", "this-e-that", true},
{"it", "This @ that", "this-chiocciola-that", true},
{"ell", "This & that", "this-kai-that", true},
{"Ell", "This & that", "this-kai-that", true},
{"kk", "This & that", "this-jane-that", true},
Expand Down