Merge pull request #3244 from gschlager/german_umlauts
FEATURE: Adds transliteration of German umlauts in slugs
This commit is contained in:
commit
79249a8d5f
|
@ -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"
|
||||
|
|
|
@ -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"
|
|
@ -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"
|
|
@ -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/
|
||||
|
||||
|
|
|
@ -0,0 +1,148 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# This file contains transliteration rules for Vietnamese
|
||||
#
|
||||
# To validate this YAML file after you change it, please paste it into
|
||||
# http://yamllint.com/
|
||||
|
||||
vi:
|
||||
i18n:
|
||||
transliterate:
|
||||
rule:
|
||||
à: "a"
|
||||
á: "a"
|
||||
ạ: "a"
|
||||
ả: "a"
|
||||
ã: "a"
|
||||
â: "a"
|
||||
ầ: "a"
|
||||
ấ: "a"
|
||||
ậ: "a"
|
||||
ẩ: "a"
|
||||
ẫ: "a"
|
||||
ă: "a"
|
||||
ằ: "a"
|
||||
ắ: "a"
|
||||
ặ: "a"
|
||||
ẳ: "a"
|
||||
ẵ: "a"
|
||||
è: "e"
|
||||
é: "e"
|
||||
ẹ: "e"
|
||||
ẻ: "e"
|
||||
ẽ: "e"
|
||||
ê: "e"
|
||||
ề: "e"
|
||||
ế: "e"
|
||||
ệ: "e"
|
||||
ể: "e"
|
||||
ễ: "e"
|
||||
ì: "i"
|
||||
í: "i"
|
||||
ị: "i"
|
||||
ỉ: "i"
|
||||
ĩ: "i"
|
||||
ò: "o"
|
||||
ó: "o"
|
||||
ọ: "o"
|
||||
ỏ: "o"
|
||||
õ: "o"
|
||||
ô: "o"
|
||||
ồ: "o"
|
||||
ố: "o"
|
||||
ộ: "o"
|
||||
ổ: "o"
|
||||
ỗ: "o"
|
||||
ơ: "o"
|
||||
ờ: "o"
|
||||
ớ: "o"
|
||||
ợ: "o"
|
||||
ở: "o"
|
||||
ỡ: "o"
|
||||
ù: "u"
|
||||
ú: "u"
|
||||
ụ: "u"
|
||||
ủ: "u"
|
||||
ũ: "u"
|
||||
ư: "u"
|
||||
ừ: "u"
|
||||
ứ: "u"
|
||||
ự: "u"
|
||||
ử: "u"
|
||||
ữ: "u"
|
||||
ỳ: "y"
|
||||
ý: "y"
|
||||
ỵ: "y"
|
||||
ỷ: "y"
|
||||
ỹ: "y"
|
||||
đ: "d"
|
||||
À: "A"
|
||||
Á: "A"
|
||||
Ạ: "A"
|
||||
Ả: "A"
|
||||
Ã: "A"
|
||||
Â: "A"
|
||||
Ầ: "A"
|
||||
Ấ: "A"
|
||||
Ậ: "A"
|
||||
Ẩ: "A"
|
||||
Ẫ: "A"
|
||||
Ă: "A"
|
||||
Ằ: "A"
|
||||
Ắ: "A"
|
||||
Ặ: "A"
|
||||
Ẳ: "A"
|
||||
Ẵ: "A"
|
||||
È: "E"
|
||||
É: "E"
|
||||
Ẹ: "E"
|
||||
Ẻ: "E"
|
||||
Ẽ: "E"
|
||||
Ê: "E"
|
||||
Ề: "E"
|
||||
Ế: "E"
|
||||
Ệ: "E"
|
||||
Ể: "E"
|
||||
Ễ: "E"
|
||||
Ì: "I"
|
||||
Í: "I"
|
||||
Ị: "I"
|
||||
Ỉ: "I"
|
||||
Ĩ: "I"
|
||||
Ò: "O"
|
||||
Ó: "O"
|
||||
Ọ: "O"
|
||||
Ỏ: "O"
|
||||
Õ: "O"
|
||||
Ô: "O"
|
||||
Ồ: "O"
|
||||
Ố: "O"
|
||||
Ộ: "O"
|
||||
Ổ: "O"
|
||||
Ỗ: "O"
|
||||
Ơ: "O"
|
||||
Ờ: "O"
|
||||
Ớ: "O"
|
||||
Ợ: "O"
|
||||
Ở: "O"
|
||||
Ỡ: "O"
|
||||
Ù: "U"
|
||||
Ú: "U"
|
||||
Ụ: "U"
|
||||
Ủ: "U"
|
||||
Ũ: "U"
|
||||
Ư: "U"
|
||||
Ừ: "U"
|
||||
Ứ: "U"
|
||||
Ự: "U"
|
||||
Ử: "U"
|
||||
Ữ: "U"
|
||||
Ỳ: "Y"
|
||||
Ý: "Y"
|
||||
Ỵ: "Y"
|
||||
Ỷ: "Y"
|
||||
Ỹ: "Y"
|
||||
Đ: "D"
|
||||
ê: "e"
|
||||
ù: "u"
|
||||
à: "a"
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue