Player language

Topics: Windows Phone 8
Aug 2, 2013 at 7:26 AM
Hi,

I'm working on a wp8 store app and i've run into a problem. I develop the application for norwegian and swedish languages. I need a way to be able to change the player language, to show for example the (on/off) status of subtitles in norwegian and swedish. I couldn't find anything about this anywhere.

Thanks,
Catalin
Coordinator
Aug 8, 2013 at 6:23 PM
All text resources used by the player framework are contained in the Resources.resx file and can be easily localized for other languages provided you are willing to translate them.
Aug 12, 2013 at 8:22 AM
Edited Aug 19, 2013 at 6:47 AM
Thank you for your answer. So does this mean that i can get that resource file and add it to my project, translate it and then somehow overwrite within the code ?

PS: I don't have access to the player framework source code in my project.
Sep 3, 2013 at 7:55 PM
I have the same dilemma. I want to localize the Player framework messages in my app. But, I don't want to do it in the player framework source code. Is there any way to do it in the app ?
Sep 12, 2013 at 4:26 PM
I was able to fix it by overwritting ErrorViewTemplate.
        
        <Style TargetType="local:ErrorView">
            <Setter Property="Background" Value="{StaticResource PhoneSemitransparentColor}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="local:ErrorView">
                        <Grid Background="{TemplateBinding Background}">
                            <StackPanel VerticalAlignment="Center">
                                <!--<TextBlock Text="{TemplateBinding ErrorText}" Margin="0,0,0,12" FontSize="24" HorizontalAlignment="Center"/>-->
                                <TextBlock Text="{Binding Path=LocalizedResources.PlayerError, Source={StaticResource LocalizedStrings}}" Margin="0,0,0,12" FontSize="24" HorizontalAlignment="Center"/>
                                <local:MediaPlayerButton x:Name="RetryButton" Style="{StaticResource MediaPlayerButtonStyle}" FontSize="70" Size="140" StrokeThickness="3" VerticalAlignment="Center" HorizontalAlignment="Center" Content=""/>
                            </StackPanel>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
Coordinator
Sep 13, 2013 at 8:38 PM
Thanks for bringing this shortcoming to my attention. I just checked in a change that will allow you to add a copy of the Resources.resx file to your project, localize it, and point the player framework at this new resource file via the following code:
        static MainPage()
        {
            MediaPlayer.ResourceManager = new System.Resources.ResourceManager("MyProjectNamespace.Resources", typeof(MainPage).Assembly);
        }
This will be included in the next release, ...or... you can start using it today by creating a build yourself by following the steps to rebuild the SDK here.