Read the statement by Michael Teeuw here.
News feed and calandar hang after translation
-
Hi,
I am new to MM but managed to install and run it so far.
I wanted to translate it so I created a translation file and added it to translation.js.
It works but when I use it the “news” and “calendar” modules just hang on “loading…”.
If I switch back to English they work fine.
Any idea what could cause this? -
@zipo13 Hi and welcome to the MagicMirror Forum!
You can debug it very easily:
Node.js side error:
- Execute
pm2 log mm
- This shows you the last 15 lines of the error log, it should give you an idea what may be wrong.
Browser side error:
- Open MagicMirror on your local Browser (Chrome is preferred)
- Open the browsers Debugger, reload the page, it should give you an idea what may be wrong.
You can post the results here for further analysis.
- Execute
-
I did not use pm2 as I couldn’t get it to work properly in the past.
This MM install was done manually and not through a script.
so i have no idea how to get to the server logs.I did use Chrome to see errors and I got about 6 of these:
moment-with-locales.js:3307 Uncaught (in promise) TypeError: Cannot read property 'humanize' of undefined at Moment.from (moment-with-locales.js:3307) at Moment.fromNow (moment-with-locales.js:3314) at Class.getDom (newsfeed.js:115) at main.js:110 at new Promise (<anonymous>) at updateDom (main.js:109) at Object.updateDom (main.js:514) at Class.updateDom (module.js:358) at newsfeed.js:312 16
moment-with-locales.js:3307 Uncaught (in promise) TypeError: Cannot read property 'humanize' of undefined at Moment.from (moment-with-locales.js:3307) at Moment.fromNow (moment-with-locales.js:3314) at Class.getDom (newsfeed.js:115) at main.js:110 at new Promise (<anonymous>) at updateDom (main.js:109) at Object.updateDom (main.js:514) at Class.updateDom (module.js:358) at newsfeed.js:312
It seems related since the newsfeed.js and calender.js are mentioned but what is “humanize”?
-
@zipo13 said in News feed and calendar hang after translation:
‘humanize’ of undefined
Got it.
After asking what is “humanize” I thought what not just google it :nerd_face: ?So I did and came out with this thread
They say that the locale is also used to load other stuff and that the locale name must match an existing locale on the system.
That got me thinking that maybe I used il.js which is the country and not the language.
So I changed everything to he.js and now it working :grinning_face_with_smiling_eyes: -
@zipo13 Just to clarify, what exact file did you edit?
-
@idoodler Originally I translated them by creating a new file called il.js and added it to the translations.js file.
By debugging and reading the thread mentioned above I understood that something was wrong with the locale.
It got me thinking that Israel locale is he_IL and that maybe I used the IL instead of the HE.
That means that the MM uses that locale for other things too.
I changed the file name to he.js and updated the tranlations.js and that got things to work.