プロジェクト

全般

プロフィール

Vote #67253

完了

Graceful fallback for "missing translation" needed

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
I18n_37
対象バージョン:
開始日:
2010/05/13
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
27
issue_org_id:
5518
author_id:
6894
assigned_to_id:
0
comments:
6
status_id:
5
tracker_id:
2
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Scenario: user selected a language in "My account", some plugin or core translation is missing for that language.

Current behavior: @translation missing: ru, %control_code%@ is displayed. Requires me to have all components translated to use a language?

Expected: display the control label from the default language (the one set in Administration/Settings/Display).
More fallback levels - if the default language translation is still missing, try en-US, and then - the first one found in plugin's /config/locales


journals

+1

Should use the i18n gem, I'll make some tests here and report the results.
--------------------------------------------------------------------------------
The current I18n gem (0.4.1) provides a "fallback mechanism":http://rdoc.info/rdoc/svenfuchs/i18n/blob/188d9246d3dc09ac123eb41a14641a63fcdf7f84/I18n/Backend/Fallbacks.html out of the box. But I think, it it too late to move there for 1.0.

Also, I think, there are some compatibility issues with Rails 2.3.5. See #5608 for details. So either we copy some of the functionality in the i18n gem now or we wait for an update to rails 2.3.8 -> 3.0 which is still going to take significant time.
--------------------------------------------------------------------------------
While this is implemented, it might be useful to put Redmine in 'English-only mode'.

The easiest way I could find to do this was changing lib/redmine/i18n.rb . If there is a simpler way, please do let me know.

<pre>
def set_language_if_valid(lang)
# Temp fix until http://www.redmine.org/issues/5518 is resolved
# if l = find_language(lang)
# ::I18n.locale = l
# end
::I18n.locale = 'en'
end
</pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fallback to en locale added in r4679.
Falling back to the application default language is not desirable IMHO. If a user uses a different language than the default one, there is no reason he'll prefer to fallback in this default language rather than in english.
--------------------------------------------------------------------------------


related_issues

duplicates,Closed,5716,I18n module should fall back to English if a translation string was not found
blocks,Closed,5608,broken with i18n 0.4.0

Admin Redmine さんが約4年前に更新

  • カテゴリI18n_37 にセット
  • 対象バージョン1.2.0_27 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0