How to have label with numerical value?
#1
I need to make some labels with just numerical values. If I do this:

Code:
<control type="button">
    <include>ButtonCommonValues</include>
    <label>0<label>
</control>

I get a button with "Programs" as its label.

Is there a way to escape the parsing of label as a string.xml reference?
Reply
#2
<number>56</number> rather than <label> will do the trick.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
If it's just 0-9 you're after use the ones from the numerical dialog -

0 =

Code:
<control type="button">
    <include>ButtonCommonValues</include>
    <label>$LOCALIZE[12310]</label>
</control>

1 =

Code:
<control type="button">
    <include>ButtonCommonValues</include>
    <label>$LOCALIZE[12311]</label>
</control>

(2013-12-29, 00:06)jmarshall Wrote: <number>56</number> rather than <label> will do the trick.

Doesn't work in buttons though.
Reply
#4
That's something that should be remedied then. The trick I guess is that it wouldn't work for <label2> as you'd need a <number2> or something, which is a bit yucky. Suggestions?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
no clue if it would be easy to add, but solving it this way would be nice: <label>$NUMBER[3]</label>

otherwise, i think <number2> would be the most logic thing to add.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
Something like $NUMBER[] or only localize strings with $LOCALIZE[]. The latter will break every skin though Tongue

edit: didnt see ronie's post
Reply
#7
(2013-12-29, 00:13)Hitcher Wrote: If it's just 0-9 you're after use the ones from the numerical dialog -

I need numbers higher than 9. But I assume ...

10 =

Code:
<control type="button">
    <include>ButtonCommonValues</include>
    <label>$LOCALIZE[12311]$LOCALIZE[12310]</label>
</control>

... would work.

From a readability point though, that really is hellish.
Reply
#8
Or just add new unused strings, they will fallback in every other language.
Reply
#9
Only localizing strings with $LOCALIZE[] might benefit automation in generating .po files though.

Or consider keeping it short $NUM[]
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#10
Righto, here you go. Using $NUMBER[]. As this refactors code, it would be great if folk could test it out to make sure I didn't inadvertantly break something (I'm pretty confident!)

https://github.com/xbmc/xbmc/pull/3919

Builds on their way: http://jenkins.xbmc.org/job/XBMC-BuildMulti-PR/761/ They'll end up in http://mirrors.xbmc.org/test-builds - look for the ones with number_labels in the filenames.

NOTE: Post-Gotham, we'll look at removing the automatic parsing of numbers as $LOCALIZE[] lookups - this will make automatic generation of .po files later on quite a bit easier.

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


Image
Reply

Logout Mark Read Team Forum Stats Members Help
How to have label with numerical value?0