Bugzilla – Bug 14538
Long Date format doesn't use correct locale
Last modified: 2010-04-08 17:26:41 UTC
Go to Settings->Screen->Date & Time->Date Format All options there are always in english, regardless of the selected language. Calling os.date() from LUA-Applets also gives only english strings, I guess when selecting a language also the os's-locale should be set to solve both problems ?
Ben: are the translations for that page in?
Ben - it's only the settings menu. The actual display in the screensaver is ok.
the clock-screensafer in 7.3 shows the wrong date-string as well. erlands 'Custom Clock' screensafer in 7.4 also can't show the correct string, as long as os.date() doesn't give correct date-strings (which it would, if the locale was set correctly I guess) the settings-menu in just the first visible proof of many follow-up problems ;)
> the clock-screensafer in 7.3 shows the wrong date-string as well. Should be fixed in 7.4. > erlands 'Custom Clock' screensafer in 7.4 also can't show the correct But do you see it on the stock screensavers? Mine says "Samstag, 03. Oktober". I'm sorry to say that this is Erland's problem :-). Sure, we can help him fix it the way we fixed our own savers.
Michael, the stock screensafers don't use the settings (anymore in 7.4), thats why they don't face the problem as well. The digital-clock just always shows WWWW DD MMMM regardless of your setting. I could also complain about this as a bug ;) Or do you have any stock-screensafer which shows a date and respects the settings ? I marked this bug as an API bug for a reason. If (logitech or any custom-applet-developer) wants to respect the settings he has to call os.date(format, date) from LUA. That's how the strings in the settings are generated as well. Unfortunately this function doesn't return the correct localized version (though it could and should as defined by the LUA-API), that's why the screensaver in 7.3 has problems (as well as any other screensafer which just wants to show a customizable date-string like erlands and my plugins)
I don't believe there to be a bug here. You can use the jive.utils.datetime functions to return user-defined settings for date and time. It could be that Erland doesn't want to look at that code (there is a long-standing dispute over squeezeplay licensing that has left many of our 3rd party devs unwilling to glance at our code), but I believe the functions are there to display time in whatever way the user has defined. > The digital-clock just always shows WWWW DD MMMM regardless of your setting. > I could also complain about this as a bug ;) On this point I completely disagree- the digital clock does not show a string for the date, it shows three separate objects for day of week, day of month, and month. They may layout horizontally across the screen, but they are clearly separated and are not a string. I respect your view that you should be able to order those objects on the screen how you like, but that's not how it was designed nor do I see the digital clock being changed in the near future. >Or do you have any stock-screensafer which shows a date and respects the settings ? Yes, dot matrix clock respects the Date & Time->Short Date Format setting
Ben, before I accept this being closed as invalid, please answer the following questions: - why isn't it considered a bug, that when I go to 'Settings->Screen->Date & Time->Date Format' I only see unlocalized strings ? - how can I get a localized version of the long date format then ? (jive.utils.datetime returns unlocalized strings) - what is a long date format useful for, when I can't get a localized string ?
Michael, only assigning to you as a flag for us to discuss further. Apologies, will leave the bug open. There are many conflicting comments in the description here. yes, os.date() does not return localized strings. In the ClockApplet we do localization with a strings file based on what's returned from misc os.date() calls e.g., Lua: -- string month of year local monthOfYear = os.date("%m") token = "SCREENSAVER_CLOCK_MONTH_" .. tostring(monthOfYear) local monthString = self.applet:string(token) widget = self.dateGroup:getWidget('month') widget:setValue(monthString) the token then uses values from the strings file to display the localized text: SCREENSAVER_CLOCK_MONTH_12 CS Prosinec DA december DE Dezember EN December ES Diciembre FI Joulukuu FR Décembre IT Dicembre NL december NO desember PL Grudzień RU Декабрь SV december This is not a solution, but one could poach strings from ClockApplet/strings.txt to make this work better. Of course, this will likely launch a firestorm of license discussion again :-/
Ben - as I doubt we'll ever add full locale support for its size, could we make os.date do the "localization" based on our strings? It's not too many tokens we'd need, and we already have a lot of them.
It would be great if os.date supported localization but I'll add similar support as the standard clocks in my Custom Clock applet in the meanwhile. So you don't have to prioritize this based on the Custom Clock applet.
I'll still suffer from it in the weather-applet (and don't want to copy the localization code erland might write around)
== Auto-comment from SVN commit #8564 to the repo by mherger == == https://svn.slimdevices.com/?view=revision&revision=8564 == Fixed Bug: 14538 Description: add jive.utils.datetime:getCurrentDate() method to get localized date string. Please use this instead of os.date() if you want a localized and formatted date string as defined in the settings. Don't show the confusing formatting string in the date settings, but only localized date instead.
local datetime = require("jive.utils.datetime") ... local date = datetime:getCurrentDate() -- You can optionally pass your own format string if you prefer date = datetime:getCurrentDate("%d/%B/%Y")
Oh, I should add that there's no localization but for German right now. Translators will complete soon.
== Auto-comment from SVN commit #8564 to the jive repo by mherger == == https://svn.slimdevices.com/jive?view=revision&revision=8564 == Fixed Bug: 14538 Description: add jive.utils.datetime:getCurrentDate() method to get localized date string. Please use this instead of os.date() if you want a localized and formatted date string as defined in the settings. Don't show the confusing formatting string in the date settings, but only localized date instead.
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release. If you are still seeing this issue, please let us know!