Prevent translations in gitlab.po files to become out of sync with the code
When the .po
file gets updated with adjusted translations and the source language gets new variables, this could cause issues when translations don't get updated with these new values and we interpolate strings.
A possible solution to this would be to "clean up" the translation files when building the package (If I remeber correctly this could be done by running rake gettext:find
).
Original issue with an example in the details block.
Summary
Error 500 when accessing /{Project}/milestones/{Id}
page.
Steps to reproduce
Gitlab version: 11.11.0
Step:
- User Settings > Preferences > Languages > Change to "Chinese/Japanese".
- Access
https://gitlab.com/gitlab-org/gitlab-ce/milestones/15
.
It seems i18n problem.
Relevant logs and/or screenshots
ActionView::Template::Error (can't convert Hash into Integer):
72:
73: - if !project || can?(current_user, :read_issue, project)
74: .block.issues
75: .sidebar-collapsed-icon.has-tooltip{ title: milestone_issues_tooltip_text(milestone), data: { container: 'body', html: 'true', placement: 'left', boundary: 'viewport' } }
76: %strong
77: = custom_icon('issues')
78: %span= milestone.issues_visible_to_user(current_user).count
app/helpers/milestones_helper.rb:153:in `milestone_issues_tooltip_text'
app/views/shared/milestones/_sidebar.html.haml:75:in `_app_views_shared_milestones__sidebar_html_haml__3675671230612399399_70193239356520'
app/views/projects/milestones/show.html.haml:71:in `_app_views_projects_milestones_show_html_haml___1427744770184689379_70193183482340'
app/controllers/application_controller.rb:117:in `render'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:439:in `set_session_storage'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:435:in `set_locale'
lib/gitlab/middleware/rails_queue_duration.rb:27:in `call'
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
lib/gitlab/metrics/transaction.rb:57:in `run'
lib/gitlab/metrics/rack_middleware.rb:17:in `call'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:16:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:26:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
Edited by 🤖 GitLab Bot 🤖