From 4d153f396b6b16fa287d863eb09cf2eb529584b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dobros=C5=82aw=20=C5=BBybort?= Date: Fri, 10 May 2013 15:24:40 +0200 Subject: [PATCH] Change: make substitute function public --- slug.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/slug.go b/slug.go index d388223..026a738 100644 --- a/slug.go +++ b/slug.go @@ -32,17 +32,17 @@ func MakeLang(s string, lang string) (slug string) { // Select substitution language switch lang { case "de": - slug = substitute(slug, deSub) + slug = Substitute(slug, deSub) case "en": - slug = substitute(slug, enSub) + slug = Substitute(slug, enSub) case "pl": - slug = substitute(slug, plSub) + slug = Substitute(slug, plSub) default: // fallback to "en" if lang not found - slug = substitute(slug, enSub) + slug = Substitute(slug, enSub) } - slug = substitute(slug, defaultSub) - slug = substitute(slug, CustomSub) + slug = Substitute(slug, defaultSub) + slug = Substitute(slug, CustomSub) slug = unidecode.Unidecode(slug) @@ -55,7 +55,7 @@ func MakeLang(s string, lang string) (slug string) { } // Substitute string chars with provided substitution map. -func substitute(s string, sub map[rune]string) (buf string) { +func Substitute(s string, sub map[rune]string) (buf string) { for _, c := range s { if d, ok := sub[c]; ok { buf += d