What language is your site running?
@r-a-y Since you worked on this. Any ideas?
Your time stamps looks correct, I’m guessing you mean the Danish translation isn’t working correctly?
You can grab the newest Danish Buddypress translation here https://translate.wordpress.org/locale/da/default/wp-plugins/buddypress followed by merging your current buddypress-da_DK.po file in poedit like this http://www.marketpressthemes.com/blog/how-to-merge-two-po-files-using-poedit/, translate the words you needs to translate, save it as both buddypress-da_DK.po and buddypress-da_DK.mo – and reupload it to your server in your language folder.
BP 2.7 introduced dynamic timestamps using livestamp.js and moment.js.
For dynamic timestamp localization to work correctly, we try to load the moment.js localization file.
It is quite possible that moment.js does not come with a Danish translation.
@adjunkten – Can you check to see if there is a Danish translation here?
https://github.com/moment/moment/tree/develop/locale
If so, can you output your WordPress locale using get_locale()
? There might be a bug in how we are checking for the moment.js locale file.
@r-a-y The danish locale for moment.js use “da” extension. As you ask for check, i assume it is confusing when BP translation is using “da_DK” ? 🙂
https://github.com/moment/moment/blob/develop/locale/da.js
I tested by switching my WordPress locale to da_DK
and the dynamic timestamp is loading da.js
correctly.
@adjunkten – If you want to help debug, can you add the following line:
var_dump( $locale );
after lines 31 and 42 of this file?
https://buddypress.trac.wordpress.org/browser/tags/2.7.0/src/bp-core/bp-core-cssjs.php?marks=31,42#L22
Thanks for looking in to this.
@r-a-y , I would like to help, but I can’t locate ‘livestamp.js’ in the bp-core folder?
Sorry, but I feel a bit noobish here…
I noticed this message when inspecting css :
http://historielaerer.dk/wp-content/plugins/buddypress/bp-core/js/vendor/moment-js/locale/da.min.js’%20defer%20onload=’?ver=2.7.2
Failed to load resource: the server responded with a status of 404 (Not Found)
@adjunkten – The defer%20onload
is a sign that you might be using a plugin to do something to all WordPress javascript enqueued files.
Because if you remove the defer
line, the JS file is valid:
http://historielaerer.dk/wp-content/plugins/buddypress/bp-core/js/vendor/moment-js/locale/da.min.js
Are you using such a plugin? If so, disable it and see if that fixes your problem.
Thanks @r-a-y, it looks like you are on to something.
I use Autoptimize to compress html and css -but I have excluded javascript.
I tried to deactivate it and purged cache, but it still changed from Danish to English. – the ‘deferonload’ bit was still in the code.
Will dig more into this when I get the time.
Lars
The defer%20onload is a sign that you might be using a plugin to do something to all WordPress javascript enqueued files.
Sorry, I disabled a code snippet that defers javascript – that solved the problem.
I have the same problem but deactivating the autoptimize plugin didnt help! Please help me to solve the problem.