XBMC.Notification and Language
#1
Hi there,

I don't have any knowledge about Python but interestingly I started coding my first small addon. (Coding means mainly Copy & Paste Rolleyes)

Now I want to have a notification popup. It works but I'm curious if could use a label for my message as defined in my strings.xml.
Code:
xbmc.executebuiltin('XBMC.Notification(' + Action +',' + Action +' executed,10)')

Any idea how the syntax should be if I want to replace "executed" with a language dependent label?

Thanks!
Reply
#2
upD8R Wrote:Hi there,

(Coding means mainly Copy & Paste Rolleyes)

Any idea how the syntax should be if I want to replace "executed" with a language dependent label?

Thanks!

So did we started all that way Wink

Very simplified:
PHP Code:
local_string xbmcaddon.Addon(id='your script id').getLocalizedString

xbmc
.executebuiltin('XBMC.Notification(' Action +',' Action +' local_string(32001),10)'


Some documentation for starters (bit out dated but still works)
http://code.google.com/p/xbmc-gpodder-in...loads/list
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
Thanks indeed for the hint. Your version did not work out of the box so I played a bit and this is my result:
PHP Code:
xbmc.executebuiltin('XBMC.Notification('Action +','Action +''NotifyString(30005) +',10)'
I had to put the original space between Action and NotifyString into the strings.xml. Can I force a hard blank/space somehow directly in the code?

I don't have a clue what I'm doing but it's fun if it works Wink
Reply
#4
upD8R Wrote:Thanks indeed for the hint. Your version did not work out of the box so I played a bit and this is my result:
PHP Code:
xbmc.executebuiltin('XBMC.Notification('Action +','Action +''NotifyString(30005) +',10)'
I had to put the original space between Action and NotifyString into the strings.xml. Can I force a hard blank/space somehow directly in the code?

I don't have a clue what I'm doing but it's fun if it works Wink

Welcome to my world Rolleyes

You can make a blank/space using:
PHP Code:
' ' 
everything between the quotations is made as a string so if you put a space there is will show up as a space
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#5
Martijn Wrote:
PHP Code:
' ' 

I thought this is what I tried. Nevertheless I'll give it another one tonight ...

Thanks again!
Reply
#6
It's me again. Not sure what I did wrong yesterday but your proposal works.

One additional question: It seems the duration of my notification is ignored. It pops up for approx. 3s and not 10 as defined.

Is this due to the fact that the script ends after this statement?
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC.Notification and Language0