XBMC.Notification and Language

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
upD8R Offline
Senior Member
Posts: 107
Joined: Jun 2011
Reputation: 2
Location: Germany
Post: #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 :rolleyesSmile

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!
find quote
Martijn Online
Team-XBMC
Posts: 7,696
Joined: Jul 2011
Reputation: 114
Location: Dawn of time
Post: #2
upD8R Wrote:Hi there,

(Coding means mainly Copy & Paste :rolleyesSmile

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

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first


For your mediacenter artwork go to
[Image: fanarttv.png]
(This post was last modified: 2012-02-13 00:23 by Martijn.)
find quote
upD8R Offline
Senior Member
Posts: 107
Joined: Jun 2011
Reputation: 2
Location: Germany
Post: #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
find quote
Martijn Online
Team-XBMC
Posts: 7,696
Joined: Jul 2011
Reputation: 114
Location: Dawn of time
Post: #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

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first


For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
upD8R Offline
Senior Member
Posts: 107
Joined: Jun 2011
Reputation: 2
Location: Germany
Post: #5
Martijn Wrote:
PHP Code:
' ' 

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

Thanks again!
find quote
upD8R Offline
Senior Member
Posts: 107
Joined: Jun 2011
Reputation: 2
Location: Germany
Post: #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?
find quote