Skip to content

Commit cca29c5

Browse files
committed
chore: i18n
1 parent 0e64caa commit cca29c5

23 files changed

+76
-69
lines changed

BetterLyrics.WinUI3 (Package)/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Identity
1313
Name="37412.BetterLyrics"
1414
Publisher="CN=Zhe"
15-
Version="1.2.329.0" />
15+
Version="1.2.330.0" />
1616

1717
<mp:PhoneIdentity PhoneProductId="ca4a4830-fc19-40d9-b823-53e2bff3d816" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
1818

BetterLyrics.WinUI3/Controls/LyricsSearchControl.xaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131

3232
<TextBlock x:Uid="LyricsSearchControlSongInfoMapping" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
3333

34-
<Grid
35-
Padding="16"
36-
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
37-
CornerRadius="4">
34+
<Grid Padding="16" Style="{StaticResource CardGridStyle}">
3835
<StackPanel Spacing="6">
3936

4037
<local:PropertyRow x:Uid="LyricsSearchControlTitle" Value="{x:Bind ViewModel.MappedSongSearchQuery.OriginalTitle, Mode=OneWay}" />
@@ -73,10 +70,7 @@
7370
</StackPanel>
7471
</Grid>
7572

76-
<Grid
77-
Padding="16"
78-
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
79-
CornerRadius="4">
73+
<Grid Padding="16" Style="{StaticResource CardGridStyle}">
8074
<StackPanel Spacing="6">
8175

8276
<local:PropertyRow x:Uid="LyricsSearchControlArtist" Value="{x:Bind ViewModel.MappedSongSearchQuery.OriginalArtist, Mode=OneWay}" />
@@ -115,10 +109,7 @@
115109
</StackPanel>
116110
</Grid>
117111

118-
<Grid
119-
Padding="16"
120-
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
121-
CornerRadius="4">
112+
<Grid Padding="16" Style="{StaticResource CardGridStyle}">
122113
<StackPanel Spacing="6">
123114

124115
<local:PropertyRow x:Uid="LyricsSearchControlAlbum" Value="{x:Bind ViewModel.MappedSongSearchQuery.OriginalAlbum, Mode=OneWay}" />
@@ -158,6 +149,10 @@
158149
</StackPanel>
159150
</Grid>
160151

152+
<Grid Padding="16" Style="{StaticResource CardGridStyle}">
153+
<local:PropertyRow x:Uid="LyricsSearchControlDurauion" Value="{x:Bind ViewModel.GSMTCService.CurrentSongInfo.Duration, Converter={StaticResource SecondsToFormattedTimeConverter}, TargetNullValue=N/A, Mode=OneWay}" />
154+
</Grid>
155+
161156
<dev:SettingsCard>
162157
<CheckBox x:Uid="LyricsSearchControlMarkAsPureMusic" IsChecked="{x:Bind ViewModel.MappedSongSearchQuery.IsMarkedAsPureMusic, Mode=TwoWay}" />
163158
</dev:SettingsCard>

BetterLyrics.WinUI3/Controls/NowPlayingBar.xaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@
505505
<Setter Property="CornerRadius" Value="12" />
506506
</Style>
507507
</Flyout.FlyoutPresenterStyle>
508-
<Grid>
508+
<Grid Width="400">
509509
<Grid.RowDefinitions>
510510
<RowDefinition Height="*" />
511511
<RowDefinition Height="Auto" />
@@ -532,11 +532,15 @@
532532
<RowDefinition Height="*" />
533533
<RowDefinition Height="*" />
534534
</Grid.RowDefinitions>
535-
<TextBlock Grid.Row="0" Text="{x:Bind GSMTCService.CurrentSongInfo.Title, Mode=OneWay}" />
535+
<TextBlock
536+
Grid.Row="0"
537+
Text="{x:Bind GSMTCService.CurrentSongInfo.Title, Mode=OneWay}"
538+
TextTrimming="CharacterEllipsis" />
536539
<TextBlock
537540
Grid.Row="1"
538541
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
539-
Text="{x:Bind GSMTCService.CurrentSongInfo.Artist, Mode=OneWay}" />
542+
Text="{x:Bind GSMTCService.CurrentSongInfo.Artist, Mode=OneWay}"
543+
TextTrimming="CharacterEllipsis" />
540544
</Grid>
541545
<Grid
542546
Grid.Column="2"

BetterLyrics.WinUI3/Controls/NowPlayingBar.xaml.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,26 @@ private void PlaybackOrderButton_Click(object sender, RoutedEventArgs e)
332332

333333
private async void OpenPlaybackSourceButton_Click(object sender, RoutedEventArgs e)
334334
{
335-
var path = await AppHook.GetAppPathByAumidAsync(GSMTCService.CurrentMediaSourceProviderInfo?.Provider);
335+
var amuid = GSMTCService.CurrentMediaSourceProviderInfo?.Provider;
336+
var path = await AppHook.GetAppPathByAumidAsync(amuid);
336337
if (path != null)
337338
{
338-
await Launcher.LaunchUriAsync(new Uri(path));
339+
try
340+
{
341+
bool ok = await Launcher.LaunchUriAsync(new Uri(path));
342+
if (!ok)
343+
{
344+
GlobalToastManager.Show("Error", $"Fail to launch {path}", InfoBarSeverity.Warning);
345+
}
346+
}
347+
catch (Exception)
348+
{
349+
GlobalToastManager.Show("Error", $"Could't launch {path}", InfoBarSeverity.Error);
350+
}
351+
}
352+
else
353+
{
354+
GlobalToastManager.Show("Error", $"Could't get the path for {amuid}", InfoBarSeverity.Warning);
339355
}
340356
}
341357
}

BetterLyrics.WinUI3/Hooks/AppHook.cs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -177,33 +177,24 @@ public class AppHook
177177
}
178178

179179
/// <summary>
180-
/// 通过 AUMID 获取应用程序的物理路径或解析名称
180+
/// 通过 AUMID 获取应用程序的物理路径
181181
/// </summary>
182182
public static async Task<string?> GetAppPathByAumidAsync(string? aumid)
183183
{
184184
if (string.IsNullOrWhiteSpace(aumid)) return null;
185185
if (_pathCache.TryGetValue(aumid, out var cachedPath)) return cachedPath;
186186

187-
var path = await Task.Run(() =>
187+
string? path = await Task.Run(() =>
188188
{
189-
using var item = GetShellItem(aumid);
190-
if (item == null) return null;
191-
192-
if (item.IsFileSystem)
193-
{
194-
return item.ParsingName;
195-
}
196-
197-
try
198-
{
199-
return item.Properties.GetProperty<string>(Ole32.PROPERTYKEY.System.Link.TargetParsingPath);
200-
}
201-
catch
202-
{
203-
return item.ParsingName;
204-
}
189+
var item = GetShellItem(aumid);
190+
return item?.GetDisplayName(ShellItemDisplayString.DesktopAbsoluteParsing);
205191
});
206192

193+
if (path != null)
194+
{
195+
path = $"shell:AppsFolder\\{path}";
196+
}
197+
207198
_pathCache.TryAdd(aumid, path);
208199

209200
return path;

BetterLyrics.WinUI3/Strings/ar/Resources.resw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@
14921492
<value>بينيين (ماندرين)</value>
14931493
</data>
14941494
<data name="SettingsPagePlaybackLib.Content" xml:space="preserve">
1495-
<value>مصدر التشغيل</value>
1495+
<value>مصدر التشغيل ومعالجة الأغاني</value>
14961496
</data>
14971497
<data name="SettingsPagePlaybackNotFound.Text" xml:space="preserve">
14981498
<value>لم يتم التقاط أي مصدر تشغيل</value>

BetterLyrics.WinUI3/Strings/de/Resources.resw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@
14921492
<value>Pinyin (Mandarin)</value>
14931493
</data>
14941494
<data name="SettingsPagePlaybackLib.Content" xml:space="preserve">
1495-
<value>Wiedergabequellen</value>
1495+
<value>Wiedergabequelle und Liedtextverarbeitung</value>
14961496
</data>
14971497
<data name="SettingsPagePlaybackNotFound.Text" xml:space="preserve">
14981498
<value>Keine erfasste Wiedergabequelle</value>

BetterLyrics.WinUI3/Strings/en/Resources.resw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@
14921492
<value>Pinyin (Mandarin)</value>
14931493
</data>
14941494
<data name="SettingsPagePlaybackLib.Content" xml:space="preserve">
1495-
<value>Playback Sources</value>
1495+
<value>Playback Source and Lyrics Processing</value>
14961496
</data>
14971497
<data name="SettingsPagePlaybackNotFound.Text" xml:space="preserve">
14981498
<value>No captured playback source</value>

BetterLyrics.WinUI3/Strings/es/Resources.resw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@
14921492
<value>Pinyin (Mandarín)</value>
14931493
</data>
14941494
<data name="SettingsPagePlaybackLib.Content" xml:space="preserve">
1495-
<value>Fuentes de reproducción</value>
1495+
<value>Fuente de reproducción y procesamiento de letras</value>
14961496
</data>
14971497
<data name="SettingsPagePlaybackNotFound.Text" xml:space="preserve">
14981498
<value>Ninguna fuente de reproducción capturada</value>

BetterLyrics.WinUI3/Strings/fr/Resources.resw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@
14921492
<value>Pinyin (Mandarin)</value>
14931493
</data>
14941494
<data name="SettingsPagePlaybackLib.Content" xml:space="preserve">
1495-
<value>Sources de lecture</value>
1495+
<value>Source de lecture et traitement des paroles</value>
14961496
</data>
14971497
<data name="SettingsPagePlaybackNotFound.Text" xml:space="preserve">
14981498
<value>Aucune source de lecture capturée</value>

0 commit comments

Comments
 (0)