Skip to content

Commit

Permalink
Do not hardcode locale unless certainly necessary (#6791)
Browse files Browse the repository at this point in the history
Merge pull request 6791
  • Loading branch information
ashmaroli authored and jekyllbot committed Feb 25, 2018
1 parent ce44eb6 commit 017f032
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/jekyll.rb
Expand Up @@ -35,7 +35,6 @@ def require_all(path)
require "i18n"

SafeYAML::OPTIONS[:suppress_warnings] = true
I18n.config.available_locales = :en

module Jekyll
# internal requires
Expand Down
5 changes: 4 additions & 1 deletion lib/jekyll/utils.rb
Expand Up @@ -203,7 +203,10 @@ def slugify(string, mode: nil, cased: false)
end

# Drop accent marks from latin characters. Everything else turns to ?
string = ::I18n.transliterate(string) if mode == "latin"
if mode == "latin"
I18n.config.available_locales = :en if I18n.config.available_locales.empty?
string = I18n.transliterate(string)
end

slug = replace_character_sequence_with_hyphen(string, :mode => mode)

Expand Down

0 comments on commit 017f032

Please sign in to comment.