From f9dca0efc5f129ada19bad6f7d01ede617b37141 Mon Sep 17 00:00:00 2001 From: Wieland Lindenthal Date: Fri, 16 Feb 2018 17:39:54 +0100 Subject: [PATCH] Ensure that always the identical transliteration is used no matter what I18n locale the current user has set. --- lib/open_project/full_text_search.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/open_project/full_text_search.rb b/lib/open_project/full_text_search.rb index 59a8ec66fc..7e9f5b439a 100644 --- a/lib/open_project/full_text_search.rb +++ b/lib/open_project/full_text_search.rb @@ -32,12 +32,12 @@ module OpenProject # This module provides utility methods to work with PostgreSQL's full-text capabilities (TSVECTOR) module FullTextSearch def self.normalize_text(text) - I18n.transliterate(text.to_s.downcase) + I18n.with_locale(:en) { I18n.transliterate(text.to_s.downcase) } end def self.normalize_filename(filename) name_in_words = to_words filename.to_s.downcase - I18n.transliterate(name_in_words) + I18n.with_locale(:en) { I18n.transliterate(name_in_words) } end def self.to_words(text)