Defect #12900

Template::Error (translation missing: en.date.formats.default)

Added by Terence Mill almost 5 years ago. Updated about 1 month ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:I18n
Target version:-
Resolution:Cant reproduce Affected version:2.2.1

Description

I get this error when i change to English locale. I checked twice and actually there is no file
public\javascripts\i18n\jquery.ui.datepicker-en.js.

If i copy public\javascripts\i18n\jquery.ui.datepicker-en.js to public\javascripts\i18n\jquery.ui.datepicker-en-GB.js the error is gone.
Strange is that jquery ui repo also don't has such locale
https://code.google.com/p/jquery-ui/source/browse/trunk/ui/i18n/?r=3705

ActionView::Template::Error (translation missing: en.date.formats.default):
    1: <h3><%=l(:label_my_account)%></h3>
    2: 
    3: <p><%=l(:field_login)%>: <strong><%= link_to_user(@user, :format => :username) %></strong><br />
    4: <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p>
    5: 
    6: <% if @user.own_account_deletable? %>
    7:   <p><%= link_to(l(:button_delete_my_account), {:action => 'destroy'}, :class => 'icon icon-del') %></p>
  lib/redmine/i18n.rb:60:in `format_date'
  lib/redmine/i18n.rb:71:in `format_time'
  app/views/my/_sidebar.html.erb:4:in `_app_views_my__sidebar_html_erb___357797368_111603840'
  app/views/my/account.html.erb:48:in `block in _app_views_my_account_html_erb___96936270_109476630'


Related issues

Related to Redmine - Feature #12475: Lazy loading of translation files for faster startup Closed
Related to Redmine - Defect #17621: Completed 500 Internal Server Error Closed
Duplicated by Redmine - Defect #13204: translation missing error_session_expired Closed
Duplicated by Redmine - Defect #15617: Regional (i.e. sub) localization not correctly supported Closed
Duplicated by Redmine - Defect #16472: Browser translation missing public area under Linux Closed

Associated revisions

Revision 11314
Added by Toshi MARUYAMA almost 5 years ago

comment out i18n key in plugin template (#12900)

It seems duplicate keys in plugins cause problems.

History

#1 Updated by Etienne Massip almost 5 years ago

  • Resolution set to Cant reproduce

Sorry Terence, I can't see the relationship between jQuery and this error stack.

I can't reproduce either, are you sure it is not a plugin issue?

#2 Updated by Etienne Massip almost 5 years ago

  • Status changed from New to Needs feedback

#3 Updated by Terence Mill almost 5 years ago

I can't test without plugin at the moment, so i can't deny you assumption.
However this sounds strange as plugin issue and what is the answer on "Strange is that jquery ui repo also don't has such locale".
I don't unsetand why all locales exists but none for english? How does this (If so) default work, and maybe that is the explanation if and hwere to nserach the cause for the error.

#4 Updated by Toshi MARUYAMA almost 5 years ago

#12475 uses cache.
You need to delete tmp/cache when plugin installing or upgrading redmine.

#5 Updated by Terence Mill almost 5 years ago

I think the error is caused by including same or diffreent version of jquery in a plugin.

#6 Updated by Etienne Massip almost 5 years ago

Terence Mill wrote:

I think the error is caused by including same or diffreent version of jquery in a plugin.

In which plugin/version is it already included?

#7 Updated by Terence Mill almost 5 years ago

redmine_lightbox, redmine_dnoise_workload, redmine_goyello_schedules, redmine_dmsf, redmine_monitoring_controlling, redmine_impasse, redmine_scrumb2, redmine_planner, and many more.

#8 Updated by Etienne Massip almost 5 years ago

Terence Mill wrote:

redmine_lightbox, redmine_dnoise_workload, redmine_goyello_schedules, redmine_dmsf, redmine_monitoring_controlling, redmine_impasse, redmine_scrumb2, redmine_planner, and many more.

Niiiiiiiiiiiiice…

I think the error is caused by including same or diffreent version of jquery in a plugin.

What makes you think that?

#9 Updated by Terence Mill almost 5 years ago

Toshi MARUYAMA wrote:

#12475 uses cache.
You need to delete tmp/cache when plugin installing or upgrading redmine.

I ran "tmp:sessions:clear" and "tmp:cache:clear" but error stays. So it seems not to be a cache issue

#10 Updated by Andy Alton almost 5 years ago

I'm having the exact same problem, but haven't found any way to fix it and keep all the default locale settings. Terence's workaround (copying the datepicker en-GB to en) has no effect.

Any strings in the English locale file fail to show, causing Internal Server Errors on most pages. Even the language itself is shown at the bottom of Settings/Display/Default language and users account page as "translation missing: en.general_lang_name", and it's the only language in the list with that error. Changing the language to en-GB fixes it, but changes all the relevant locale settings too of course...

Redmine version 2.2.1.stable, Ruby version 1.9.3 (i386-mingw32), Rails version 3.2.11.
Gemfile.lock

#12 Updated by Andy Alton almost 5 years ago

The patch moved the "translation missing: en.general_lang_name" from the bottom of the list to right before "English (British)", but otherwise all the 500 errors are still happening. I also made sure to clear the cache before starting Redmine after patching. The stack trace is the same as in the original report.

#13 Updated by Etienne Massip almost 5 years ago

Andy Alton wrote:

Redmine version 2.2.1.stable, Ruby version 1.9.3 (i386-mingw32), Rails version 3.2.11.
Gemfile.lock

Plugins?

#14 Updated by Andy Alton almost 5 years ago

I have XLS Export and its dependency Plugin views revisions installed.

#15 Updated by Andy Alton almost 5 years ago

Looks like that's part of the reason... Way back, the XLS Export links in the interface would show translation placeholders in the en-GB locale, so I had copied its en.yml to en-GB.yml, which worked fine until 2.1.something. Somewhere between that version and 2.2.1 it stopped working and created this issue, presumably when Redmine sees duplicate locale files and rejects the whole language? Deleting the copy of the plugin's locale file fixes this for me.

Sorry about the confusion, you can ignore my comments on this issue. Back to Terence!

#16 Updated by Daniel Felix almost 5 years ago

Andy Alton wrote:

... when Redmine sees duplicate locale files and rejects the whole language?

Well you can experience some likely bug if you add a plugin, which uses a label which isn't added in any translation file.
Some parts of the translation will be broken if Rails couldn't find it in any translation file.

#17 Updated by Jordi Rovira over 4 years ago

Hi. I am getting an error that may be related to this one with this log in redmine 2.3.0

Completed 500 Internal Server Error in 166ms

ActionView::Template::Error (translation missing: en.date.formats.default):
20: <% for project in @projects >
21: <
@project = project >
22: <li>
23: <
= link_to_project project > (<= format_time(project.created_on) >)
24: <
= textilizable project.short_description, :project => project >
25: </li>
26: <
end %>
lib/redmine/i18n.rb:60:in `format_date'
lib/redmine/i18n.rb:71:in `format_time'
app/views/welcome/index.html.erb:23:in `_app_views_welcome_index_html_erb__971611127_70124025026480'
app/views/welcome/index.html.erb:20:in `each'
app/views/welcome/index.html.erb:20:in `_app_views_welcome_index_html_erb__971611127_70124025026480'

It has happened to me 2 times in a day, but i don't have an exact repro. The site is accessible and i may be being accessed from different locales. I had two plugins (graphs and google_analytics) but I have removed them now. I will report back if it happens again.

Edit: After checking the log IPs, in both cases it happened after being accessed from Korea and Japan, and then from my own system, with the English locale.

#18 Updated by Toshi MARUYAMA over 4 years ago

Did you clear cache after installing plugins?
Please see #13520#note-12 (note-12) and following notes.

#19 Updated by Jordi Rovira over 4 years ago

Toshi MARUYAMA wrote:

Did you clear cache after installing plugins?
Please see #13520#note-12 (note-12) and following notes.

No, but i have done it now. I will report if it crashes again. I was indeed using the Debian packaged version.

#20 Updated by Jordi Rovira over 4 years ago

Toshi MARUYAMA wrote:

Did you clear cache after installing plugins?
Please see #13520#note-12 (note-12) and following notes.

After clearing the cache, redmine has been working fine for some days. Now i will try reinstalling the plugins and see if everything is still fine. Thank you Toshi!

#21 Updated by Toshi MARUYAMA over 4 years ago

Terence Mill wrote:

Toshi MARUYAMA wrote:

#12475 uses cache.
You need to delete tmp/cache when plugin installing or upgrading redmine.

I ran "tmp:sessions:clear" and "tmp:cache:clear" but error stays. So it seems not to be a cache issue

Terence, as #13520#note-12 (note-12), "rake tmp:cache:clear" does not work correctly in some case.
You need to delete /var/cache/redmine/ manually if it exists.
Could you try?

#22 Updated by Michael Heinze over 4 years ago

Hi guys!

My experience with this is:
This error occurs when you copy a language file but you forget to adapt the language code at the top of the copied file!
And it occurs irregularly (only after each x-th server restart) so it is not reproducable.

In my case, I created my own Redmine plugin. So, first there was only an empty "en.yml".
I edited this file and filled in all my strings and identifiers.
After that, I wanted to add another language file ("de.yml"), which I created by copying the "en.yml".
In the "de.yml", I translated all strings but at the top of the file, I forgot to change "en:" to "de:"!
That was why I got the error.

Hope I could help some of you.

#23 Updated by Terence Mill over 4 years ago

I still have the problem after update to 2.3.2 I also searched with wrong locale lavel or missing locale topic label.
Its all fixed still but i still have the problems.
THis seemks to be very influenceable being instable for any errorr in plugins translation files.

#24 Updated by Mr. DTTH over 4 years ago

Terence Mill wrote:

I still have the problem after update to 2.3.2 I also searched with wrong locale lavel or missing locale topic label.
Its all fixed still but i still have the problems.
THis seemks to be very influenceable being instable for any errorr in plugins translation files.

Check all file language in plugins :

_This error occurs when you copy a language file but you forget to adapt the language code at the top of the copied file!
And it occurs irregularly (only after each x-th server restart) so it is not reproducable.

In my case, I created my own Redmine plugin. So, first there was only an empty "en.yml".
I edited this file and filled in all my strings and identifiers.
After that, I wanted to add another language file ("de.yml"), which I created by copying the "en.yml".
In the "de.yml", I translated all strings but at the top of the file, I forgot to change "en:" to "de:"!
That was why I got the error._

#25 Updated by Alberto Cennini about 4 years ago

Minh Thien Nguyen wrote:

Terence Mill wrote:

I still have the problem after update to 2.3.2 I also searched with wrong locale lavel or missing locale topic label.
Its all fixed still but i still have the problems.
THis seemks to be very influenceable being instable for any errorr in plugins translation files.

Check all file language in plugins :

_This error occurs when you copy a language file but you forget to adapt the language code at the top of the copied file!
And it occurs irregularly (only after each x-th server restart) so it is not reproducable.

In my case, I created my own Redmine plugin. So, first there was only an empty "en.yml".
I edited this file and filled in all my strings and identifiers.
After that, I wanted to add another language file ("de.yml"), which I created by copying the "en.yml".
In the "de.yml", I translated all strings but at the top of the file, I forgot to change "en:" to "de:"!
That was why I got the error._

This is exactly the same error I did: I created it.yml starting from en.yml and I forgot to change the language identification label in the top of the file (en:). The result was that 'en' language stopped working: label missing on all the pages and crashes in modules if they used date.format.default.
I corrected the mistake and everything began to reoperate correctly.

#26 Updated by Terence Mill about 4 years ago

IT should me more error poff or at least show an error for the locale file where name<>locake topic ..
Its really difficult to find that bad file if you use many plugins.

#27 Updated by Toshi MARUYAMA about 4 years ago

  • Duplicated by Defect #15617: Regional (i.e. sub) localization not correctly supported added

#28 Updated by Jérôme BATAILLE about 4 years ago

Hi, we experienced the same problems on our Redmine servers.

We have developed a home made plugin.
On our integration server this plugin was containing an en-GB locale file with the first line wrongly set to en.
Loading this file by choosing the en-GB user locale, was systematically erasing the en translations.

This has been fixed.

On our production, we have migrated the plugin from Redmine V1.2.1 to V2.3.2.
The old plugin was containing the bad locale key, and this was not creating issues before the migration with the old Redmine version.
With the new version, even if the locale key has been fixed, we experience the en translations lost.

During the migration we applied the tmp:sessions:clear and tmp:cache:clear

Is there is a possibility that the wrong key value stays in the cache ?
Is the cache grepable to verify that ?

#29 Updated by Toshi MARUYAMA over 3 years ago

  • Duplicated by Defect #16472: Browser translation missing public area under Linux added

#30 Updated by Toshi MARUYAMA over 3 years ago

Jérôme BATAILLE wrote:

During the migration we applied the tmp:sessions:clear and tmp:cache:clear

Is there is a possibility that the wrong key value stays in the cache ?
Is the cache grepable to verify that ?

See:
#13520#note-12

#31 Updated by Toshi MARUYAMA over 3 years ago

  • Related to Defect #17621: Completed 500 Internal Server Error added

#32 Updated by Tobias Fischer over 3 years ago

I had the same bug hanging around randomly and it was definately fixed after I checked and cleaned up all the plugins language files were sometimes there was a file "de.yml" with unchanged "en:"

#33 Updated by dominik ch almost 3 years ago

I had same issue, language "English" was missing when it's for each plugin defined,
I found out that one of plugin had broken lang file, it's easy to find that using:

grep -R "en:" | grep "yml" | grep -v "/en.yml:en:" | grep ":en:" 

This will give all *.yml files with "en:" and not "en.yml", You can easily review and find mistake.

#34 Updated by Lucky Boy about 1 month ago

dominik ch wrote:

This will give all *.yml files with "en:" and not "en.yml", You can easily review and find mistake.

This work! thanks...

Also available in: Atom PDF