[mythtv-theming] Arclight 25.12 %DPMTO%, %TID% displayed in right corner

Nicolas Riendeau knight at teksavvy.com
Sat Apr 14 01:20:29 UTC 2012


Hi Rune!

On 4/13/2012 3:53 PM, Rune Evjen wrote:
> I just discovered after upgrading to Arclight 25.12 on mythtv 0.25-fixes
> that the top-right corner on menus and also when displaying the OSD
> shows "%DPMTO%, %TID%", as shown in [1].
> This string is very similar to the Norwegian translation of %DATE%,
> %TIME% (which is %DATO%,%TID%).
>
> I am the translation maintainer for Norwegian Bokmål so this might be a
> translation mistake on my part, but I grepped for DPMTO in
> mythfrontend_nb.ts and couldn't find any errors, but found the "DATO"
> string as expected using this command:

<snip>

> Is this string coming from translation files or elsewhere ?

A little of both...

The code that handles the clock recognizes "%TIME%", "%DATE%" and 
"%SHORTDATE%".

What it does when it encounters any of them is replace them with the 
time format, the date format or the short time format you configured and 
leaves the rest untouched.

So something like

%DATE%, %TIME%

becomes

dddd d MMMM, h:mm

for example.

Now this is later passed to another bit of code which takes this as a 
format to display the current date/time so it becomes something like this:

Friday 13 april, 20:49

Everything which is not a code recognized by QDateTime (what we use to 
display that date) is put as-is in the output string (this is where that 
"," (comma) comes from.

Now what happens when the parsing code that looks for "%TIME%", "%DATE%" 
and "%SHORTDATE%" doesn't find them is this:

Something like:

%DATO%, %TID%

(obtained by translating "%DATE%, %TIME%" using the content of the 
translation files)

stays as-is as none of the variables/tags in contains are recognized.

This is still passed to the bit of code that tries to use this as a 
format to display the current date/time.

The only code that QDateTime recognizes in there is "A" which means 
<<interpret as an AM/PM time. AP must be either "AM" or "PM">> (this is 
taken from Qt's docs). Now it says "AP" but actually both "AP" and "A" 
do exactly the same things, show the time with AM/PM.

So, assuming you are in the afternoon

%DATO%, %TID%

becomes

%DPMTO%, %TID%

because, like the previous example, everything which is not a code 
recognized by QDateTime is put as-is in the output string (this is where 
"%D", "TO%, %TID%" come from.

Now it doesn't actually show the time but it shows you it's a PM time... (-;

Now I don't know what's actually supposed to be acceptable as a 
date/time format string as I am not a themer. In theory you could 
directly put the formatting codes QDateTime expect and not use "%TIME%", 
"%DATE%" and "%SHORTDATE%" so checking if any of them actually replaced 
anything might not be a solution (and I am not sure there are any good 
solution to this).

Have a nice day!

Nicolas





More information about the mythtv-theming mailing list