I tried encoded but actually the URL can be seen good on address of internet browser. However, when copy or send it, the real URL is a escape string and not friendly anymore.
I check the lib/slug.rb and suggest to change encoded_generator function likes this:
def self.encoded_generator(string, downcase: true)
# This generator will sanitize almost all special characters,
# including reserved characters from RFC3986.
# See also URI::REGEXP::PATTERN.
string = I18n.transliterate(string, :locale => SiteSetting.default_locale)
string = string.strip.gsub(/\s+/, "-").gsub(CHAR_FILTER_REGEXP, "")
string = string.downcase if downcase
string
#CGI.escape(string)
end
I tried with Viet Nam locale and got the desired results. Hope it works with another language.
Setting a Hash in <locale>.yml:
i18n:
transliterate:
rule:
ü: "ue"
ö: "oe"
So this is the way for customize transliterate in setting, at the end of function, we got Latin text (friendly url) only. I tried with my native language, and no need to define custom hash setting.