Radio text in resources and translation

This commit is contained in:
Théo Marchal 2021-10-03 15:39:39 +02:00
parent 23098e0ebb
commit 2960afd9bd
6 changed files with 134 additions and 12 deletions

View File

@ -69,6 +69,78 @@ namespace unison.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Country.
/// </summary>
public static string Radio_Country {
get {
return ResourceManager.GetString("Radio_Country", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Loading stations....
/// </summary>
public static string Radio_Loading {
get {
return ResourceManager.GetString("Radio_Loading", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name.
/// </summary>
public static string Radio_Name {
get {
return ResourceManager.GetString("Radio_Name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No stations found!.
/// </summary>
public static string Radio_NotFound {
get {
return ResourceManager.GetString("Radio_NotFound", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reset.
/// </summary>
public static string Radio_Reset {
get {
return ResourceManager.GetString("Radio_Reset", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Search.
/// </summary>
public static string Radio_Search {
get {
return ResourceManager.GetString("Radio_Search", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Search station.
/// </summary>
public static string Radio_SearchStation {
get {
return ResourceManager.GetString("Radio_SearchStation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tags.
/// </summary>
public static string Radio_Tags {
get {
return ResourceManager.GetString("Radio_Tags", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Settings.
/// </summary>

View File

@ -120,6 +120,30 @@
<data name="Exit" xml:space="preserve">
<value>Quitter</value>
</data>
<data name="Radio_Country" xml:space="preserve">
<value>Pays</value>
</data>
<data name="Radio_Loading" xml:space="preserve">
<value>Recherche de stations...</value>
</data>
<data name="Radio_Name" xml:space="preserve">
<value>Nom</value>
</data>
<data name="Radio_NotFound" xml:space="preserve">
<value>Aucun station trouvée !</value>
</data>
<data name="Radio_Reset" xml:space="preserve">
<value>Réinitialiser</value>
</data>
<data name="Radio_Search" xml:space="preserve">
<value>Chercher</value>
</data>
<data name="Radio_SearchStation" xml:space="preserve">
<value>Recherche de station</value>
</data>
<data name="Radio_Tags" xml:space="preserve">
<value>Tags</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Configuration</value>
</data>

View File

@ -120,6 +120,30 @@
<data name="Exit" xml:space="preserve">
<value>Exit</value>
</data>
<data name="Radio_Country" xml:space="preserve">
<value>Country</value>
</data>
<data name="Radio_Loading" xml:space="preserve">
<value>Loading stations...</value>
</data>
<data name="Radio_Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="Radio_NotFound" xml:space="preserve">
<value>No stations found!</value>
</data>
<data name="Radio_Reset" xml:space="preserve">
<value>Reset</value>
</data>
<data name="Radio_Search" xml:space="preserve">
<value>Search</value>
</data>
<data name="Radio_SearchStation" xml:space="preserve">
<value>Search station</value>
</data>
<data name="Radio_Tags" xml:space="preserve">
<value>Tags</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Settings</value>
</data>

View File

@ -4,7 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
xmlns:local="clr-namespace:unison"
xmlns:properties="clr-namespace:unison.Resources"
mc:Ignorable="d"
Title="Radios" Closing="Window_Closing" SizeToContent="WidthAndHeight" ResizeMode="NoResize">
@ -14,7 +14,7 @@
<StackPanel Orientation="Horizontal">
<TextBlock>
<emoji:EmojiInline Text="📻"/>
<Run Text="Search station"/>
<Run Text="{x:Static properties:Resources.Radio_SearchStation}"/>
</TextBlock>
</StackPanel>
</GroupBox.Header>
@ -22,24 +22,24 @@
<StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<StackPanel HorizontalAlignment="Stretch">
<TextBlock Text="Name" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="5,0,0,0" />
<TextBlock Text="{x:Static properties:Resources.Radio_Name}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="5,0,0,0" />
<TextBox x:Name="NameSearch" KeyDown="SearchHandler" Text="" TextWrapping="Wrap" HorizontalAlignment="Left" Width="200" Margin="5,6,0,0"/>
</StackPanel>
<StackPanel HorizontalAlignment="Stretch" Margin="20,0,0,0">
<TextBlock Text="Tags" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
<TextBlock Text="{x:Static properties:Resources.Radio_Tags}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
<TextBox x:Name="TagSearch" KeyDown="SearchHandler" Text="" TextWrapping="Wrap" HorizontalAlignment="Left" Width="300" Margin="0,6,0,0"/>
</StackPanel>
<StackPanel HorizontalAlignment="Stretch" Margin="20,0,0,0">
<TextBlock Text="Country" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
<TextBlock Text="{x:Static properties:Resources.Radio_Country}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
<ComboBox x:Name="CountryList" SelectedIndex="0" KeyDown="SearchHandler" Width="240" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,2,0,0" ScrollViewer.CanContentScroll="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="5,7.5,0,0">
<Button Content="Search" Click="Search_Clicked"/>
<Button Content="Reset" Click="Reset_Clicked" Margin="10,0,0,0"/>
<Button Content="{x:Static properties:Resources.Radio_Search}" Click="Search_Clicked" Padding="5, 2"/>
<Button Content="{x:Static properties:Resources.Radio_Reset}" Click="Reset_Clicked" Margin="10,0,0,0" Padding="5, 2"/>
<TextBlock x:Name="SearchStatus" Text="" Margin="15,1,0,0" FontStyle="Italic" />
</StackPanel>
</StackPanel>
@ -54,10 +54,11 @@
</Grid.Resources>
<DataGrid Name="RadioListGrid" CanUserAddRows="False" CanUserDeleteRows="False"
IsReadOnly="True" MouseDoubleClick="Row_DoubleClick" SelectionMode="Single" CanUserReorderColumns="False"
HeadersVisibility="Column" GridLinesVisibility="None" AutoGenerateColumns="False" CanUserResizeRows="False">
HeadersVisibility="Column" GridLinesVisibility="None" AutoGenerateColumns="False" CanUserResizeRows="False"
>
<DataGrid.Columns>
<DataGridTemplateColumn Header="🏳️" CellTemplate="{StaticResource CountryTemplate}" MinWidth="25" />
<DataGridTextColumn Header="Name" Binding="{Binding Name}" MinWidth="50"/>
<DataGridTextColumn Header="{x:Static properties:Resources.Radio_Name}" Binding="{Binding Name}" MinWidth="50"/>
<DataGridTextColumn Header="Codec" Binding="{Binding Codec}" MinWidth="47"/>
<DataGridTextColumn Header="Bitrate" Binding="{Binding Bitrate}" MinWidth="47"/>
<DataGridTextColumn Header="Tags" Binding="{Binding Tags}" MinWidth="50"/>

View File

@ -99,7 +99,7 @@ namespace unison
public async Task SearchAdvanced(string name, string country, string tags)
{
SearchStatus.Text = "Loading stations...";
SearchStatus.Text = unison.Resources.Resources.Radio_Loading;
List<StationInfo> advancedSearch = await _radioBrowser.Search.AdvancedAsync(new AdvancedSearchOptions
{
@ -127,7 +127,7 @@ namespace unison
FitToContent();
}
else
SearchStatus.Text = "No stations found!";
SearchStatus.Text = unison.Resources.Resources.Radio_NotFound;
}
private void FitToContent()

View File

@ -144,7 +144,8 @@
<Run Text="{x:Static properties:Resources.Settings_AboutInfo}" /><LineBreak/>
※ <Hyperlink NavigateUri="https://github.com/Difegue/Stylophone" RequestNavigate="Hyperlink_RequestNavigate">Stylophone</Hyperlink><Run Text="{x:Static properties:Resources.Settings_MpcNET}" /><LineBreak/>
※ <Hyperlink NavigateUri="https://github.com/hardcodet/wpf-notifyicon" RequestNavigate="Hyperlink_RequestNavigate">wpf-notifyicon</Hyperlink><LineBreak/>
※ <Hyperlink NavigateUri="https://github.com/samhocevar/emoji.wpf" RequestNavigate="Hyperlink_RequestNavigate">Emoji.WPF</Hyperlink>
※ <Hyperlink NavigateUri="https://github.com/samhocevar/emoji.wpf" RequestNavigate="Hyperlink_RequestNavigate">Emoji.WPF</Hyperlink><LineBreak/>
※ <Hyperlink NavigateUri="https://github.com/tof4/RadioBrowser" RequestNavigate="Hyperlink_RequestNavigate">RadioBrowser</Hyperlink>
</TextBlock>
<TextBlock Margin="0,10,0,0">
<Run Text="{x:Static properties:Resources.Settings_SourceCode1}" />