Skip to content

Commit

Permalink
Add Italian language substitutions (#68)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Walter <[email protected]>
  • Loading branch information
TomOne and TomOne authored Sep 27, 2022
1 parent d412da9 commit d33d626
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions languages_substitution.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func init() {
&grSub,
&huSub,
&idSub,
&itSub,
&kkSub,
&nbSub,
&nlSub,
Expand Down Expand Up @@ -123,6 +124,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 @@ -77,6 +77,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 @@ -115,6 +115,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

0 comments on commit d33d626

Please sign in to comment.