New translatables

This commit is contained in:
Royce551 2021-07-06 18:23:31 -05:00
parent 25716c198a
commit 4af7edabe0
7 changed files with 110 additions and 16 deletions

View file

@ -105,6 +105,24 @@ namespace FRESHMusicPlayer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Create.
/// </summary>
public static string Create {
get {
return ResourceManager.GetString("Create", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete.
/// </summary>
public static string Delete {
get {
return ResourceManager.GetString("Delete", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disc.
/// </summary>
@ -114,6 +132,15 @@ namespace FRESHMusicPlayer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Export.
/// </summary>
public static string Export {
get {
return ResourceManager.GetString("Export", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File path or URL.
/// </summary>
@ -195,6 +222,15 @@ namespace FRESHMusicPlayer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to No lyrics available.
/// </summary>
public static string Lyrics_NoLyrics {
get {
return ResourceManager.GetString("Lyrics_NoLyrics", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to About.
/// </summary>
@ -339,6 +375,33 @@ namespace FRESHMusicPlayer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to What do you want to do with &quot;{0}&quot;?.
/// </summary>
public static string PlaylistManagement_Header {
get {
return ResourceManager.GetString("PlaylistManagement_Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to That&apos;s not a valid name for a playlist..
/// </summary>
public static string PlaylistManagement_InvalidName {
get {
return ResourceManager.GetString("PlaylistManagement_InvalidName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Playlist Name.
/// </summary>
public static string PlaylistManagement_PlaylistName {
get {
return ResourceManager.GetString("PlaylistManagement_PlaylistName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Playlists.
/// </summary>
@ -393,6 +456,15 @@ namespace FRESHMusicPlayer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Rename.
/// </summary>
public static string Rename {
get {
return ResourceManager.GetString("Rename", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to FRESHMusicPlayer Settings.
/// </summary>

View file

@ -132,9 +132,18 @@
<data name="Bitrate" xml:space="preserve">
<value>Bitrate</value>
</data>
<data name="Create" xml:space="preserve">
<value>Create</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Delete</value>
</data>
<data name="Disc" xml:space="preserve">
<value>Disc</value>
</data>
<data name="Export" xml:space="preserve">
<value>Export</value>
</data>
<data name="FilePathOrUrl" xml:space="preserve">
<value>File path or URL</value>
</data>
@ -162,6 +171,9 @@
<data name="Lyrics" xml:space="preserve">
<value>Lyrics</value>
</data>
<data name="Lyrics_NoLyrics" xml:space="preserve">
<value>No lyrics available</value>
</data>
<data name="Menu_About" xml:space="preserve">
<value>About</value>
</data>
@ -210,6 +222,15 @@
<data name="PlaylistManagement" xml:space="preserve">
<value>Playlist Management</value>
</data>
<data name="PlaylistManagement_Header" xml:space="preserve">
<value>What do you want to do with "{0}"?</value>
</data>
<data name="PlaylistManagement_InvalidName" xml:space="preserve">
<value>That's not a valid name for a playlist.</value>
</data>
<data name="PlaylistManagement_PlaylistName" xml:space="preserve">
<value>Playlist Name</value>
</data>
<data name="Playlists" xml:space="preserve">
<value>Playlists</value>
</data>
@ -228,6 +249,9 @@
<data name="QueueManagement_TimeRemaining" xml:space="preserve">
<value>Time Remaining:</value>
</data>
<data name="Rename" xml:space="preserve">
<value>Rename</value>
</data>
<data name="Settings" xml:space="preserve">
<value>FRESHMusicPlayer Settings</value>
</data>

View file

@ -62,12 +62,12 @@ namespace FRESHMusicPlayer.ViewModels
}
else // No lyrics
{
Text = "No lyrics available";
Text = Properties.Resources.Lyrics_NoLyrics;
TimedLyrics = null;
}
}
private string text = "No lyrics available";
private string text = Properties.Resources.Lyrics_NoLyrics;
public string Text
{
get => text;

View file

@ -4,7 +4,6 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Converters;
using Avalonia.Input;
using Avalonia.Media;
using Avalonia.Media.Imaging;
using Avalonia.Threading;
@ -17,7 +16,6 @@ using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
@ -37,7 +35,6 @@ namespace FRESHMusicPlayer.ViewModels
public IntegrationHandler Integrations { get; private set; } = new();
private Window Window
{
get

View file

@ -30,7 +30,7 @@ namespace FRESHMusicPlayer.ViewModels
public void Initialize()
{
if (Track is not null)
EditingHeader = $"What do you want to do with \"{Path.GetFileName(Track)}\"?";
EditingHeader = string.Format(Properties.Resources.PlaylistManagement_Header, Path.GetFileName(Track));
Playlists.Clear();
var x = MainWindow.Library.Database.GetCollection<DatabasePlaylist>("playlists").Query().OrderBy("Name").ToList();
@ -79,7 +79,7 @@ namespace FRESHMusicPlayer.ViewModels
public async void RenamePlaylistCommand(string playlist)
{
var dialog = new TextEntryBox().SetStuff("Playlist Name");
var dialog = new TextEntryBox().SetStuff(Properties.Resources.PlaylistManagement_PlaylistName);
(dialog.DataContext as TextEntryBoxViewModel).Text = playlist;
await dialog.ShowDialog(GetMainWindow());
@ -123,13 +123,13 @@ namespace FRESHMusicPlayer.ViewModels
public async void CreatePlaylistCommand()
{
var dialog = new TextEntryBox().SetStuff("Playlist Name");
var dialog = new TextEntryBox().SetStuff(Properties.Resources.PlaylistManagement_PlaylistName);
await dialog.ShowDialog(GetMainWindow());
if (dialog.OK)
{
if (string.IsNullOrWhiteSpace((dialog.DataContext as TextEntryBoxViewModel).Text))
new MessageBox().SetStuff("idoit", "That's not a valid name for a playlist.").Show(GetMainWindow());
new MessageBox().SetStuff(MainWindowViewModel.ProjectName, Properties.Resources.PlaylistManagement_InvalidName).Show(GetMainWindow());
else
{
MainWindow.Library.CreatePlaylist((dialog.DataContext as TextEntryBoxViewModel).Text, Track);

View file

@ -7,7 +7,7 @@
xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties"
mc:Ignorable="d" Width="500" Height="300"
x:Class="FRESHMusicPlayer.Views.Lyrics" WindowStartupLocation="CenterOwner"
Title="Lyrics">
Title="{x:Static resx:Resources.Lyrics}">
<Window.DataContext>
<vm:LyricsViewModel/>
</Window.DataContext>

View file

@ -3,9 +3,10 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:FRESHMusicPlayer.ViewModels"
xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties"
mc:Ignorable="d" SizeToContent="Height" Width="600" CanResize="False"
x:Class="FRESHMusicPlayer.Views.PlaylistManagement"
Title="Playlist Management">
Title="{x:Static resx:Resources.PlaylistManagement}">
<Window.DataContext>
<vm:PlaylistManagementViewModel/>
@ -50,9 +51,9 @@
<TextBlock Text="・・・"/>
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Rename" Click="OnRenameItemClick"/>
<MenuItem Header="Delete" Click="OnDeleteItemClick"/>
<MenuItem Header="Export" Click="OnExportItemClick"/>
<MenuItem Header="{x:Static resx:Resources.Rename}" Click="OnRenameItemClick"/>
<MenuItem Header="{x:Static resx:Resources.Delete}" Click="OnDeleteItemClick"/>
<MenuItem Header="{x:Static resx:Resources.Export}" Click="OnExportItemClick"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
@ -62,8 +63,8 @@
</ListBox.DataTemplates>
</ListBox>
<StackPanel Margin="5" Orientation="Horizontal" Spacing="3" HorizontalAlignment="Right">
<Button Command="{Binding ImportCommand}">Import</Button>
<Button Command="{Binding CreatePlaylistCommand}">Create</Button>
<Button Command="{Binding ImportCommand}" Content="{x:Static resx:Resources.Import}"/>
<Button Command="{Binding CreatePlaylistCommand}" Content="{x:Static resx:Resources.Create}"/>
</StackPanel>
</StackPanel>