mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Translation overrides from fallback locale didn't work on client
Discourse sent only translation overrides for the current language to the client instead of sending overrides from fallback locales as well. This especially impacted en_GB -> en since most overrides would be done in English instead of English (UK). This also adds lots of tests for previously untested code. There's a small caveat: The client currently doesn't handle fallback locales for MessageFormat strings. That is why overrides for those strings always have a higher priority than regular translations. So, as an example, the lookup order for MessageFormat strings in German is: 1. override for de 2. override for en 3. value from de 4. value from en
This commit is contained in:
committed by
Gerhard Schlager
parent
4cd5158974
commit
769388b8ba
@@ -183,7 +183,7 @@ class Admin::SiteTextsController < Admin::AdminController
|
||||
def find_translations(query, overridden, locale)
|
||||
translations = Hash.new { |hash, key| hash[key] = {} }
|
||||
search_results = I18n.with_locale(locale) do
|
||||
I18n.search(query, overridden: overridden)
|
||||
I18n.search(query, only_overridden: overridden)
|
||||
end
|
||||
|
||||
search_results.each do |key, value|
|
||||
|
||||
Reference in New Issue
Block a user