motioneye icon indicating copy to clipboard operation
motioneye copied to clipboard

Motioneye 0.43 No streaming popup on german

Open OberfragGER opened this issue 1 year ago • 5 comments

motionEye Version | 0.43.0 Motion Version | 4.6.0 OS Version | Linux 6.5.11-4-pve

I installed motioneye with this instructions. https://github.com/motioneye-project/motioneye/tree/dev#installation When u change the language to german and click on

Snapshot URL Streaming URL Embed URL

No popup with the regarding popup appears.

OberfragGER avatar Dec 13 '23 15:12 OberfragGER

Hey, it´s a little Bug.

So set the lang to english and the popup is back.

TiboTake avatar Dec 23 '23 12:12 TiboTake

Can you show the service logs?

journalctl -u motioneye

or if no error is visible there, for errors in browser console?

I know it is an issue if a newly added language has either no frontend or backend translation files at all, but the German translation should be complete.

MichaIng avatar Dec 23 '23 14:12 MichaIng

Can you show the service logs?

journalctl -u motioneye

or if no error is visible there, for errors in browser console?

I know it is an issue if a newly added language has either no frontend or backend translation files at all, but the German translation should be complete.

Sorry. no error visible. Just no popup. I switched just one minite back from en to de and clicked on the strean-url/ snapshot url. image

joournalctl shows just:

Dec 25 21:55:39 motioneye motion[20451]: [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motioneye/motion.conf
Dec 25 21:55:39 motioneye motion[20451]: [0:motion] [NTC] [ALL] config_camera: Processing camera config file camera-1.conf
Dec 25 21:55:39 motioneye motion[20451]: [0:motion] [NTC] [ALL] config_camera: Processing camera config file camera-3.conf
Dec 25 21:55:39 motioneye motion[20451]: [0:motion] [NTC] [ALL] motion_startup: Logging to syslog
Dec 25 21:55:39 motioneye motion[20451]: [0:motion] [NTC] [ALL] motion_startup: Motion 4.6.0 Started
Dec 25 21:55:39 motioneye motion[20451]: [0:motion] [NTC] [ALL] motion_startup: Using default log type (ALL)
Dec 25 21:55:39 motioneye motion[20451]: [0:motion] [NTC] [ALL] motion_startup: Using log type (ALL) log level (WRN)

But the console from chrome shows (i tried edge, but also no popup):

image

OberfragGER avatar Dec 25 '23 21:12 OberfragGER

Hey, it´s a little Bug.

So set the lang to english and the popup is back.

I know. I did so but i did update the info for the bug.

OberfragGER avatar Dec 25 '23 21:12 OberfragGER

Thanks, the error trace from the browser console should do to find the issue. I'll have a look into it.

MichaIng avatar Dec 27 '23 13:12 MichaIng

I think I've found the problem.

First of all, this problem is not only with the German translation but with almost all translations except a few, including English.

The problem is in the function runAlertDialog in main.js:

function runAlertDialog(message, onOk, options) { var params = { title: message, buttons: i18n.gettext('bone'), onOk: onOk };

But why is the translation of 'bone' used to determine the name of the button to be called? "(buttons: i18n.gettext('bone'),)"

The translation of 'bone' in the English translation is: 'ok'. This is also why the English translation works. The intention is to call the following: https://github.com/motioneye-project/motioneye/blob/72af3711d28175669ca06ab09913b788a5fd8617/motioneye/static/js/ui.js#L1034

But when you use another language problems start to arise 😫 I think: "buttons: i18n.gettext('bone')," should be changed to: "buttons: 'ok'" As it also happens in runConfirmDialog:

(for comparison)

function runConfirmDialog(message, onYes, options) { var params = { title: message, buttons: 'yesno', onYes: onYes };

Marijn0 avatar Jun 27 '24 17:06 Marijn0

Good find. We should change the identifier of the button to not depend on the localised text, but based on some ID. I'll have a look the next days, unless someone is faster.

MichaIng avatar Jun 27 '24 17:06 MichaIng

Fix merged: #3020

Many thanks @Marijn0! Indeed here the ID was translated, which of course was never meant to happen.

MichaIng avatar Jun 30 '24 12:06 MichaIng