Bug 6461 - SC should return content to Jive based on Accept-Language header
: SC should return content to Jive based on Accept-Language header
Status: CLOSED FIXED
Product: SB Controller
Classification: Unclassified
Component: Settings
: unspecified
: Macintosh Other
: P2 major (vote)
: 7.0.1
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-26 08:13 UTC by Blackketter Dean
Modified: 2008-05-15 12:26 UTC (History)
8 users (show)

See Also:
Category: ---


Attachments
Patch to reload plugin menus - mostly working (13.39 KB, patch)
2008-04-24 05:31 UTC, Michael Herger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Blackketter Dean 2007-12-26 08:13:34 UTC
and then send a new localized menu back to Jive.

Until this is fixed, the user will need to change their language on both the server and the client in order to see the change, right?  Ugly, but not a showstopper for 7.0.

Question:  Shouldn't the language be expressed in the HTTP header?  That means that the jive support on SC/SN wouldn't be stateful, right?

Ben asked: Further, when SC language changes, should Jive be sent a directive to change as
well? Jive supported langs are a subset of SC langs, so there may need to be
some added logic to handle that.

I say no.  Let Jive control its language and have SC and SN respect that change.
Comment 1 Michael Herger 2007-12-26 23:40:53 UTC
> Until this is fixed, the user will need to change their language on both the
> server and the client in order to see the change, right?  Ugly, but not a
> showstopper for 7.0.

Couldn't Jive handle this all by itself? Set the language pref using the prefs command, request the menu again? Will have to take a look at the menu code, it might need some work to re-initialized the menu. But I don't think we need a whole new command set here.

> Ben asked: Further, when SC language changes, should Jive be sent a directive
> to change as
> well? Jive supported langs are a subset of SC langs, so there may need to be
> some added logic to handle that.
> 
> I say no.  Let Jive control its language and have SC and SN respect that
> change.

In the longer term we'll need a way/option to have per device language settings. If we let the Jive user change the server's language, then this can have unexpected side-effects. Imagine the hotel installation where some guest changes the device's language. Even worse if the manager can't reset the device's language from the SC side.

The reason we reduced the languages stored on the server are memory consumption. I wouldn't want to revert to keeping them all in memory by default. But I think it would be easy enough to have (I hardly dare mentioning it) one more preference.
Comment 2 Blackketter Dean 2007-12-27 05:25:49 UTC
Michael: When I wrote:

> I say no.  Let Jive control its language and have SC and SN respect that
> change.

I mean that this would only affect the text displayed on Jive on a per device basis letting SC serve possibly to devices in several languages.
Comment 3 Andy Grundman 2008-01-03 10:58:52 UTC
I also need this for SN, where it will be player-specific.  An Accept-Language header would be the simplest way, but adds some extra bytes of overhead to every HTTP request.
Comment 4 Michael Herger 2008-04-06 22:18:09 UTC
*** Bug 7734 has been marked as a duplicate of this bug. ***
Comment 5 Chris Owens 2008-04-23 15:52:12 UTC
Maybe not a showstopper for 7.0, but perhaps a showstopper for 7.0.1

We can talk about this in the Thursday 9am software meeting.
Comment 6 Chris Owens 2008-04-23 15:56:34 UTC
See also bug 7734 and bug 6616
Comment 7 Andy Grundman 2008-04-23 15:57:08 UTC
We should definitely not do this for 7.0.1.  SC needs to be updated to support
per-client languages before we can do this.
Comment 8 Blackketter Dean 2008-04-23 16:24:25 UTC
According to Jim, he's ready to slip the schedule (by some amount) to get this bug fixed.

What's the effort needed to support per-client/controller languages?
Comment 9 Andy Grundman 2008-04-23 16:33:31 UTC
I will do this tomorrow.  Note this is *only* for Jive and will not affect player UI or web UI languages.
Comment 10 Andy Grundman 2008-04-23 16:34:50 UTC
*** Bug 6616 has been marked as a duplicate of this bug. ***
Comment 11 Andy Grundman 2008-04-23 17:19:35 UTC
Checked in a lightly-tested patch as change 19101.

The thing I'm most worried about is the server returning the Jive language to other interfaces (player/web) while a Jive request is processing.  Subscription requests are also not handled correctly yet.

NEEDS LOTS OF TESTING. :)
Comment 12 Michael Herger 2008-04-23 23:22:10 UTC
I didn't see the issues Andy feared to see. But some menus won't switch language, as they register their menus at startup, but not on language change. Eg. the RandomPlay plugin or the music library.
Comment 13 Michael Herger 2008-04-24 02:15:18 UTC
Menus should not be using expanded strings in 'text', but string tokens to be localized when the menu is loaded. I tried fixing this by looking strings up whenever mainMenu() is called. But as text is used as the menu ID when there's no specific ID, I ended up with menus locked up, duplicate entries etc :-/.

Ben - how hard would it be to use tokens instead of localized strings in the menu defintion? 
Comment 14 Michael Herger 2008-04-24 05:31:55 UTC
Created attachment 3283 [details]
Patch to reload plugin menus - mostly working

- add stringToken to plugin menu definitions; stringToken is preferred over text and localized when needed
- add Display::getString/Client::getString etc. (might revert this)

this is mostly working. For some odd reason the "My Music" and its "Search" items don't update. But they do update if I switch server (by switching to a player connected to a different server). I see the new menu with these items in the cometd output. Maybe this is a Jive issue?
Comment 15 Michael Herger 2008-04-24 05:32:26 UTC
Oops... the previous patch is against 7.1...
Comment 16 Michael Herger 2008-04-24 06:17:49 UTC
change 19108 - the Jive specific part of the above patch (less the unneeded getString() stuff). The issue with Music Library and Search remains.

localize SqueezePlay menus provided by plugins
- add stringToken parameter to menu configuration; stringToken is localized and replaces text if available
- use $client->string method where possible
Comment 17 Ben Klaas 2008-04-24 10:43:14 UTC
issue with nodes not updating menu text (Music Library and Search) fixed in r2350.

I think this can be moved to RESOLVED
Comment 18 Ben Klaas 2008-04-24 18:24:54 UTC
Window title bar was not getting set with the new language for nodes (e.g, Music Library and Search). Fixed in 7.0 trunk r2351
Comment 19 James Richardson 2008-05-06 13:46:34 UTC
Verified 7.0.1 - 19422
Comment 20 James Richardson 2008-05-15 12:26:49 UTC
This bug has recently been fixed in the latest release of SqueezeCenter 7.0.1

Please try that version, if you still see the error, then reopen this bug.

To download this version, please navigate to: http://www.slimdevices.com/su_downloads.html