Index: D:/eclipse/trunk/server/Slim/Control/Jive.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Control/Jive.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Control/Jive.pm (working copy) @@ -63,14 +63,14 @@ Slim::Control::Request::addDispatch(['menu', '_index', '_quantity'], [0, 1, 1, \&menuQuery]); - Slim::Control::Request::addDispatch(['alarmsettings', '_index', '_quantity'], [1, 1, 1, \&alarmSettingsQuery]); - Slim::Control::Request::addDispatch(['alarmweekdays', '_index', '_quantity'], [1, 1, 1, \&alarmWeekdayMenu]); - Slim::Control::Request::addDispatch(['alarmweekdaysettings', '_day'], [1, 1, 1, \&alarmWeekdaySettingsQuery]); - Slim::Control::Request::addDispatch(['syncsettings', '_index', '_quantity'], [1, 1, 1, \&syncSettingsQuery]); - Slim::Control::Request::addDispatch(['sleepsettings', '_index', '_quantity'], [1, 1, 1, \&sleepSettingsQuery]); - Slim::Control::Request::addDispatch(['crossfadesettings', '_index', '_quantity'], [1, 1, 1, \&crossfadeSettingsQuery]); - Slim::Control::Request::addDispatch(['replaygainsettings', '_index', '_quantity'], [1, 1, 1, \&replaygainSettingsQuery]); - Slim::Control::Request::addDispatch(['playerinformation', '_index', '_quantity'], [1, 1, 1, \&playerInformationQuery]); + Slim::Control::Request::addDispatch(['alarmsettings', '_index', '_quantity'], [1, 1, 1, \&alarmSettingsQuery]); + Slim::Control::Request::addDispatch(['alarmweekdays', '_index', '_quantity'], [1, 1, 1, \&alarmWeekdayMenu]); + Slim::Control::Request::addDispatch(['alarmweekdaysettings', '_day'], [1, 1, 1, \&alarmWeekdaySettingsQuery]); + Slim::Control::Request::addDispatch(['syncsettings', '_index', '_quantity'], [1, 1, 1, \&syncSettingsQuery]); + Slim::Control::Request::addDispatch(['sleepsettings', '_index', '_quantity'], [1, 1, 1, \&sleepSettingsQuery]); + Slim::Control::Request::addDispatch(['crossfadesettings', '_index', '_quantity'], [1, 1, 1, \&crossfadeSettingsQuery]); + Slim::Control::Request::addDispatch(['replaygainsettings', '_index', '_quantity'], [1, 1, 1, \&replaygainSettingsQuery]); + Slim::Control::Request::addDispatch(['playerinformation', '_index', '_quantity'], [1, 1, 1, \&playerInformationQuery]); Slim::Control::Request::addDispatch(['jivefavorites', '_cmd' ], [1, 0, 1, \&jiveFavoritesCommand]); Slim::Control::Request::addDispatch(['jiveplaylists', '_cmd' ], [1, 0, 1, \&jivePlaylistsCommand]); @@ -171,7 +171,6 @@ } sub mainMenu { - $log->info("Begin function"); my $client = shift; @@ -188,9 +187,12 @@ # for the notification menus, we're going to send everything over "flat" # as a result, no item_loops, all submenus (setting, myMusic) are just elements of the big array that get sent - my @menu = ( + my @menu = map { + $_->{text} = $client->string($_->{stringToken}) if ($_->{stringToken}); + $_; + }( { - text => $client->string('MY_MUSIC'), + stringToken => 'MY_MUSIC', weight => 11, displayWhenOff => 0, id => 'myMusic', @@ -199,7 +201,7 @@ window => { titleStyle => 'mymusic', }, }, { - text => $client->string('FAVORITES'), + stringToken => 'FAVORITES', id => 'favorites', node => 'home', displayWhenOff => 0, @@ -339,7 +341,7 @@ my @menu = @$menu; my @purgedMenu = (); for my $i (0..$#menu) { - my $menuId = defined($menu[$i]->{id}) ? $menu[$i]->{id} : $menu[$i]->{text}; + my $menuId = defined($menu[$i]->{id}) ? $menu[$i]->{id} : ($menu[$i]->{stringToken} ? $menu[$i]->{stringToken} : $menu[$i]->{text}); last unless (defined($menu[$i])); if ($itemsToDelete{$menuId}) { $log->warn("REMOVING " . $menuId . " FROM Jive menu"); @@ -1553,6 +1555,7 @@ ); # add the items for under mymusicSearch my $searchMenu = searchMenu(1, $client); + @myMusicMenu = (@myMusicMenu, @$searchMenu); if (my $browseMusicFolder = browseMusicFolder($client, 1)) { @@ -1999,6 +2002,7 @@ sub downloadQuery { my $request = shift; + my $client = $request->client; my ($type) = $request->getRequest(0) =~ /jive(applet|wallpaper|sound)s/; if (!defined $type) { @@ -2017,7 +2021,7 @@ my $entry = { $type => $val->{'name'}, - 'name' => Slim::Utils::Strings::getString($val->{'name'}), + 'name' => $client->getString($val->{'name'}), 'url' => $url, 'file' => $val->{'file'}, }; Index: D:/eclipse/trunk/server/Slim/Display/Display.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Display/Display.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Display/Display.pm (working copy) @@ -799,9 +799,23 @@ sub string { my $display = shift; + my $name = uc(shift); + + my $string = $display->getString($name, @_); + + if ($string eq $name){ + logBacktrace("missing string $name"); + $string = ''; + } + + return $string; +} + +sub getString { + my $display = shift; + my $name = shift; my $strings = $display->displayStrings; - my $name = uc(shift); # Check language override if ( $display->client ) { @@ -811,10 +825,10 @@ } if ( @_ ) { - return sprintf( $strings->{$name} || ( logBacktrace("missing string $name") && $name ), @_ ); + return sprintf( $strings->{$name} || $name, @_ ); } - return $strings->{$name} || ( logBacktrace("missing string $name") && $name ); + return $strings->{$name} || $name; } sub doubleString { Index: D:/eclipse/trunk/server/Slim/Display/SqueezeboxG.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Display/SqueezeboxG.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Display/SqueezeboxG.pm (working copy) @@ -294,6 +294,11 @@ return Slim::Utils::Unicode::utf8toLatin1($display->SUPER::string(@_)); } +sub getString { + my $display = shift; + return Slim::Utils::Unicode::utf8toLatin1($display->SUPER::getString(@_)); +} + sub doubleString { my $display = shift; return Slim::Utils::Unicode::utf8toLatin1($display->SUPER::doubleString(@_)); Index: D:/eclipse/trunk/server/Slim/Display/Text.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Display/Text.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Display/Text.pm (working copy) @@ -799,6 +799,11 @@ return Slim::Utils::Unicode::utf8toLatin1($display->SUPER::string(@_)); } +sub getString { + my $display = shift; + return Slim::Utils::Unicode::utf8toLatin1($display->SUPER::getString(@_)); +} + sub doubleString { my $display = shift; return Slim::Utils::Unicode::utf8toLatin1($display->SUPER::doubleString(@_)); Index: D:/eclipse/trunk/server/Slim/Player/Client.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Player/Client.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Player/Client.pm (working copy) @@ -873,6 +873,7 @@ sub power {} sub string {} +sub getString {} sub doubleString {} sub maxTransitionDuration { Index: D:/eclipse/trunk/server/Slim/Player/HTTP.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Player/HTTP.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Player/HTTP.pm (working copy) @@ -53,6 +53,11 @@ Slim::Utils::Strings::string(@_) }; +sub getString { + my $client = shift; + Slim::Utils::Strings::getString(@_) +} + # dummy methods sub update { } sub isPlayer { 0 } Index: D:/eclipse/trunk/server/Slim/Player/Player.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Player/Player.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Player/Player.pm (working copy) @@ -151,6 +151,7 @@ sub unblock { Slim::Buttons::Block::unblock(@_); } sub string { shift->display->string(@_); } +sub getString { shift->display->getString(@_); } sub doubleString{ shift->display->doubleString(@_); } sub isPlayer { Index: D:/eclipse/trunk/server/Slim/Plugin/DigitalInput/Plugin.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Plugin/DigitalInput/Plugin.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Plugin/DigitalInput/Plugin.pm (working copy) @@ -82,7 +82,7 @@ && $client->hasDigitalIn(); return [{ - text => Slim::Utils::Strings::string(getDisplayName()), + stringToken => getDisplayName(), weight => 45, id => 'digitalinput', node => 'home', @@ -103,7 +103,7 @@ my $client = $request->client(); my @menu = ( { - text => Slim::Utils::Strings::string('PLUGIN_DIGITAL_INPUT_BALANCED_AES'), + text => $client->string('PLUGIN_DIGITAL_INPUT_BALANCED_AES'), id => 'aes-ebu', weight => 10, style => 'itemplay', @@ -120,7 +120,7 @@ }, }, { - text => Slim::Utils::Strings::string('PLUGIN_DIGITAL_INPUT_BNC_SPDIF'), + text => $client->string('PLUGIN_DIGITAL_INPUT_BNC_SPDIF'), id => 'bnc-spdif', weight => 20, style => 'itemplay', @@ -137,7 +137,7 @@ }, }, { - text => Slim::Utils::Strings::string('PLUGIN_DIGITAL_INPUT_RCA_SPDIF'), + text => $client->string('PLUGIN_DIGITAL_INPUT_RCA_SPDIF'), id => 'rca-spdif', weight => 30, style => 'itemplay', @@ -154,7 +154,7 @@ }, }, { - text => Slim::Utils::Strings::string('PLUGIN_DIGITAL_INPUT_OPTICAL_SPDIF'), + text => $client->string('PLUGIN_DIGITAL_INPUT_OPTICAL_SPDIF'), id => 'toslink', weight => 40, style => 'itemplay', Index: D:/eclipse/trunk/server/Slim/Plugin/Favorites/Plugin.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Plugin/Favorites/Plugin.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Plugin/Favorites/Plugin.pm (working copy) @@ -780,7 +780,7 @@ if ($request->source && $request->source =~ /\/slim\/request/) { $client->showBriefly({ 'jive' => { - 'text' => [ Slim::Utils::Strings::string('FAVORITES_ADDING'), + 'text' => [ $client->string('FAVORITES_ADDING'), $title, ], } @@ -824,7 +824,7 @@ my $deleteMsg = $title?$title:$url; $client->showBriefly({ 'jive' => { - 'text' => [ Slim::Utils::Strings::string('FAVORITES_DELETING'), + 'text' => [ $client->string('FAVORITES_DELETING'), $deleteMsg ], } }); Index: D:/eclipse/trunk/server/Slim/Plugin/Podcast/Plugin.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Plugin/Podcast/Plugin.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Plugin/Podcast/Plugin.pm (working copy) @@ -67,7 +67,7 @@ } my @item = ({ - text => Slim::Utils::Strings::string(getDisplayName()), + stringToken => getDisplayName(), weight => 20, id => 'podcast', node => 'extras', Index: D:/eclipse/trunk/server/Slim/Plugin/RandomPlay/Plugin.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Plugin/RandomPlay/Plugin.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Plugin/RandomPlay/Plugin.pm (working copy) @@ -131,7 +131,7 @@ Slim::Buttons::Common::setFunction('randomPlay', \&buttonStart); my @item = ({ - text => Slim::Utils::Strings::string(getDisplayName()), + stringToken => getDisplayName(), weight => 60, id => 'randomplay', node => 'myMusic', @@ -154,7 +154,7 @@ my $client = $request->client(); my @menu = ( { - text => Slim::Utils::Strings::string('PLUGIN_RANDOM_TRACK'), + text => $client->string('PLUGIN_RANDOM_TRACK'), id => 'randomtracks', weight => 10, style => 'itemplay', @@ -171,7 +171,7 @@ }, }, { - text => Slim::Utils::Strings::string('PLUGIN_RANDOM_ALBUM'), + text => $client->string('PLUGIN_RANDOM_ALBUM'), id => 'randomalbums', weight => 20, style => 'itemplay', @@ -188,7 +188,7 @@ }, }, { - text => Slim::Utils::Strings::string('PLUGIN_RANDOM_CONTRIBUTOR'), + text => $client->string('PLUGIN_RANDOM_CONTRIBUTOR'), id => 'randomartists', weight => 30, style => 'itemplay', @@ -205,7 +205,7 @@ }, }, { - text => Slim::Utils::Strings::string('PLUGIN_RANDOM_YEAR'), + text => $client->string('PLUGIN_RANDOM_YEAR'), id => 'randomyears', weight => 40, style => 'itemplay', @@ -222,7 +222,7 @@ }, }, { - text => Slim::Utils::Strings::string('PLUGIN_RANDOM_CHOOSE_GENRES'), + text => $client->string('PLUGIN_RANDOM_CHOOSE_GENRES'), id => 'randomchoosegenres', weight => 50, window => { titleStyle => 'random' }, @@ -321,7 +321,7 @@ for my $genre (sort keys %$genres) { my $val = $genres->{$genre}->{'enabled'}; -$log->error($genre . ":" . $val); + push @menu, { text => $genre, checkbox => ($val == 1) + 0, Index: D:/eclipse/trunk/server/Slim/Plugin/Sounds/Plugin.pm =================================================================== --- D:/eclipse/trunk/server/Slim/Plugin/Sounds/Plugin.pm (revision 19106) +++ D:/eclipse/trunk/server/Slim/Plugin/Sounds/Plugin.pm (working copy) @@ -19,7 +19,7 @@ ); my @item = ({ - text => Slim::Utils::Strings::string(getDisplayName()), + stringToken => getDisplayName(), weight => 30, id => 'sounds', node => 'extras',