diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 3431c329daa..e5c1b30b901 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -15,18 +15,6 @@ # http://yamllint.com/ en: - stringex: - characters: - ellipsis: "" - number: "-" - # some default transliteration rules may be missing, add them to your locale - i18n: - transliterate: - rule: - ț: "t" - Ț: "t" - ș: "s" - Ș: "s" dates: short_date_no_year: "D MMM" short_date: "D MMM, YYYY" diff --git a/config/locales/transliterate.de.yml b/config/locales/transliterate.de.yml new file mode 100644 index 00000000000..842ff6111db --- /dev/null +++ b/config/locales/transliterate.de.yml @@ -0,0 +1,18 @@ +# encoding: utf-8 +# +# This file contains transliteration rules for German +# +# To validate this YAML file after you change it, please paste it into +# http://yamllint.com/ + +de: + i18n: + transliterate: + rule: + Ä: "Ae" + Ö: "Oe" + Ü: "Ue" + ß: "ss" + ä: "ae" + ö: "oe" + ü: "ue" diff --git a/config/locales/transliterate.en.yml b/config/locales/transliterate.en.yml new file mode 100644 index 00000000000..28dd2e2e7cb --- /dev/null +++ b/config/locales/transliterate.en.yml @@ -0,0 +1,20 @@ +# encoding: utf-8 +# +# This file contains default transliteration rules and configures stringex +# +# To validate this YAML file after you change it, please paste it into +# http://yamllint.com/ + +en: + stringex: + characters: + ellipsis: "" + number: "-" + # some default transliteration rules may be missing, add them to your locale + i18n: + transliterate: + rule: + ț: "t" + Ț: "t" + ș: "s" + Ș: "s" diff --git a/config/locales/transliterate.ru.yml b/config/locales/transliterate.ru.yml index 25c4715b487..17a88b47fdd 100644 --- a/config/locales/transliterate.ru.yml +++ b/config/locales/transliterate.ru.yml @@ -2,9 +2,6 @@ # This file contains content for the i18n transliteration map from # Russian Cyrillic to ASCII (ISO-9:1995 / GOST 7.79-2000, table B) # -# To work with us on translations, see: -# https://www.transifex.com/projects/p/discourse-pt-br/ -# # To validate this YAML file after you change it, please paste it into # http://yamllint.com/ diff --git a/lib/slug.rb b/lib/slug.rb index 8d6ab1fa6f5..61520772352 100644 --- a/lib/slug.rb +++ b/lib/slug.rb @@ -4,8 +4,6 @@ module Slug def self.for(string) - slug = string.gsub("'", "").parameterize - slug.gsub!("_", "-") # TODO review if ja should use this # ko asked for it to be removed if ['zh_CN', 'ja'].include?(SiteSetting.default_locale) @@ -13,6 +11,9 @@ module Slug require 'stringex_lite' end slug = string.to_url + else + slug = string.gsub("'", "").parameterize + slug.gsub!("_", "-") end slug =~ /[^\d]/ ? slug : '' # Reject slugs that only contain numbers, because they would be indistinguishable from id's. end