プロジェクト

全般

プロフィール

Vote #72880

完了

Lazy loading of translation files for faster startup

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

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

0%

予定工数:
category_id:
30
version_id:
56
issue_org_id:
12475
author_id:
1
assigned_to_id:
1
comments:
3
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

journals

Is this really implemented?

I was using redmine in Italian (IT_it) locale but i was getting this error 500 on administrative user editing pages:

ActionView::Template::Error (can not load translations from /omissis/path/config/locales/*sr-CY.yml*: #<Errno::ENOENT: No such file or directory - /

Full trace:

<pre>

Started GET "/users/13/edit" for 151.15.191.145 at 2014-01-05 04:18:34 +0100
Processing by UsersController#edit as HTML
Parameters: {"id"=>"13"}
Current user: stefano (id=1)
Rendered users/_form.html.erb (3.5ms)
Rendered users/_general.html.erb (4.1ms)
Rendered common/_tabs.html.erb (5.0ms)
Rendered users/edit.html.erb within layouts/admin (7.0ms)
Completed 500 Internal Server Error in 10.8ms

ActionView::Template::Error (can not load translations from /omissis/path/config/locales/sr-CY.yml: #<Errno::ENOENT: No such file or directory - / /omissis/path/config/locales/sr-CY.yml>):
9: <p><%= f.text_field :firstname, :required => true %></p>
10: <p><%= f.text_field :lastname, :required => true %></p>
11: <p><%= f.text_field :mail, :required => true %></p>
12: <p><%= f.select :language, lang_options_for_select %></p>
13: <% if Setting.openid? %>
14: <p><%= f.text_field :identity_url %></p>
15: <% end %>
lib/redmine/i18n.rb:152:in `init_translations'
lib/redmine/i18n.rb:166:in `lookup'
lib/redmine/i18n.rb:52:in `ll'
lib/redmine/i18n.rb:96:in `block (2 levels) in languages_options'
lib/redmine/i18n.rb:96:in `map'
lib/redmine/i18n.rb:96:in `block in languages_options'
lib/redmine/i18n.rb:95:in `languages_options'
app/helpers/application_helper.rb:962:in `lang_options_for_select'
app/views/users/_form.html.erb:12:in `_app_views_users__form_html_erb___1844358433978560630_70070849426320'
app/views/users/_general.html.erb:2:in `block in _app_views_users__general_html_erb__2956019574731655906_70070848366580'
app/helpers/application_helper.rb:977:in `labelled_form_for'
app/views/users/_general.html.erb:1:in `_app_views_users__general_html_erb__2956019574731655906_70070848366580'
app/views/common/_tabs.html.erb:24:in `block in _app_views_common__tabs_html_erb___2205524068201026269_70070848303940'
app/views/common/_tabs.html.erb:23:in `each'
app/views/common/_tabs.html.erb:23:in `_app_views_common__tabs_html_erb___2205524068201026269_70070848303940'
app/helpers/application_helper.rb:272:in `render_tabs'
app/views/users/edit.html.erb:9:in `_app_views_users_edit_html_erb___280756995300269414_44922720'

</pre>

sr-CY is not a language that I was using in any way!!! And the only web browser that was browsing the redmine instance was mine in IT_it locale.

I removed the sr-CY.yml file and the error fixed, anyway this means that translation is not really lazy loaded (I'm using redmine 2.4.2 and ruby 1.9.3), contrary an error in a unused translation parsing is blocking for the used translation too!

--------------------------------------------------------------------------------
sr-CY.yml was removed by r4003.
--------------------------------------------------------------------------------
I apologize it was my bad, i did a wrong redmine upgrade keeping the old files too!
--------------------------------------------------------------------------------


related_issues

relates,Closed,12861,Internal Error 500 on "settings"
relates,Needs feedback,12900,Template::Error (translation missing: en.date.formats.default)
relates,Closed,13491,Update RedmineInstall about support of ruby-1.8.7 (or not) in Redmine 2.2+
relates,Closed,13520,Internal Error (incompatible character encodings: ASCII-8BIT and UTF-8) when accessing Admin/Settings, Account, etc.

Admin Redmine さんが3年以上前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン2.2.0_56 にセット

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

いいね!0
いいね!0