Skip to content

Commit 72b6837

Browse files
authored
Merge pull request #1449 from b-editor/feat/localization
Add localization support for UI strings and messages
2 parents 549a7c7 + 1954f7f commit 72b6837

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+736
-265
lines changed

src/Beutl.Controls/ColorPicker/ColorPickerStyles.axaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:avconv="using:Avalonia.Controls.Converters"
44
xmlns:conv="using:FluentAvalonia.Converters"
5+
xmlns:lang="using:Beutl.Language"
56
xmlns:sty="using:FluentAvalonia.Styling"
67
xmlns:ui="using:FluentAvalonia.UI.Controls"
78
xmlns:uip="using:FluentAvalonia.UI.Controls.Primitives"
@@ -361,12 +362,12 @@
361362
RowDefinitions="Auto,*">
362363
<TextBlock HorizontalAlignment="Center"
363364
VerticalAlignment="Center"
364-
Text="Previous" />
365+
Text="{x:Static lang:Strings.Previous}" />
365366
<TextBlock Grid.Column="2"
366367
Grid.ColumnSpan="5"
367368
HorizontalAlignment="Center"
368369
VerticalAlignment="Center"
369-
Text="Current" />
370+
Text="{x:Static lang:Strings.Current}" />
370371

371372
<Border Name="PreviousColorPreviewBackground"
372373
Grid.Row="1"
@@ -792,17 +793,17 @@
792793
<MenuItem Header="-" />
793794
<MenuItem x:Name="TextBoxContextMenuCutItem"
794795
Command="{Binding $parent[TextBox].Cut}"
795-
Header="Cut"
796+
Header="{x:Static lang:Strings.Cut}"
796797
InputGesture="{x:Static TextBox.CutGesture}"
797798
IsEnabled="{Binding $parent[TextBox].CanCut}" />
798799
<MenuItem x:Name="TextBoxContextMenuCopyItem"
799800
Command="{Binding $parent[TextBox].Copy}"
800-
Header="Copy"
801+
Header="{x:Static lang:Strings.Copy}"
801802
InputGesture="{x:Static TextBox.CopyGesture}"
802803
IsEnabled="{Binding $parent[TextBox].CanCopy}" />
803804
<MenuItem x:Name="TextBoxContextMenuPasteItem"
804805
Command="{Binding $parent[TextBox].Paste}"
805-
Header="Paste"
806+
Header="{x:Static lang:Strings.Paste}"
806807
InputGesture="{x:Static TextBox.PasteGesture}"
807808
IsEnabled="{Binding $parent[TextBox].CanPaste}" />
808809
</MenuFlyout>

src/Beutl.Engine/Audio/Effects/DelayEffect.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Beutl.Audio.Graph;
33
using Beutl.Audio.Graph.Nodes;
44
using Beutl.Engine;
5+
using Beutl.Language;
56

67
namespace Beutl.Audio.Effects;
78

@@ -15,19 +16,19 @@ public DelayEffect()
1516
}
1617

1718
[Range(0, MaxDelayTime)]
18-
[Display(Name = "Delay Time (ms)")]
19+
[Display(Name = nameof(Strings.DelayTime), ResourceType = typeof(Strings))]
1920
public IProperty<float> DelayTime { get; } = Property.CreateAnimatable(200f);
2021

2122
[Range(0, 100)]
22-
[Display(Name = "Feedback (%)")]
23+
[Display(Name = nameof(Strings.Feedback), ResourceType = typeof(Strings))]
2324
public IProperty<float> Feedback { get; } = Property.CreateAnimatable(50f);
2425

2526
[Range(0, 100)]
26-
[Display(Name = "Dry Mix (%)")]
27+
[Display(Name = nameof(Strings.DryMix), ResourceType = typeof(Strings))]
2728
public IProperty<float> DryMix { get; } = Property.CreateAnimatable(60f);
2829

2930
[Range(0, 100)]
30-
[Display(Name = "Wet Mix (%)")]
31+
[Display(Name = nameof(Strings.WetMix), ResourceType = typeof(Strings))]
3132
public IProperty<float> WetMix { get; } = Property.CreateAnimatable(40f);
3233

3334
public override AudioNode CreateNode(AudioContext context, AudioNode inputNode)

src/Beutl.Engine/Graphics/DrawableDecorator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
using System.ComponentModel.DataAnnotations;
22
using Beutl.Engine;
33
using Beutl.Graphics.Rendering;
4+
using Beutl.Language;
45

56
namespace Beutl.Graphics;
67

78
// Drawable継承しているが、Drawableのメソッドは使っていない
8-
[Display(Name = "Decorator")]
9+
[Display(Name = nameof(Strings.Decorator), ResourceType = typeof(Strings))]
910
public sealed partial class DrawableDecorator : Drawable
1011
{
1112
public DrawableDecorator()

src/Beutl.Engine/Graphics/DrawableGroup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
using Beutl.Engine;
33
using Beutl.Graphics.Rendering;
44
using Beutl.Graphics.Transformation;
5+
using Beutl.Language;
56
using Beutl.Media;
67

78
namespace Beutl.Graphics;
89

9-
[Display(Name = "Group")]
10+
[Display(Name = nameof(Strings.Group), ResourceType = typeof(Strings))]
1011
public sealed partial class DrawableGroup : Drawable
1112
{
1213
public DrawableGroup()

src/Beutl.Extensions.AVFoundation/Decoding/AVFDecodingExtension.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using System.ComponentModel.DataAnnotations;
22
using Beutl.Extensibility;
3+
using Beutl.Language;
34
using Beutl.Media.Decoding;
45
using MonoMac.AppKit;
56

67
namespace Beutl.Extensions.AVFoundation.Decoding;
78

89
[Export]
9-
[Display(Name = "AVFoundation Decoding")]
10+
[Display(Name = nameof(Strings.AVFoundationDecoder), ResourceType = typeof(Strings))]
1011
public class AVFDecodingExtension : DecodingExtension
1112
{
1213
public override AVFDecodingSettings? Settings { get; } = new();

src/Beutl.Extensions.AVFoundation/Encoding/AVFEncodingExtension.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Runtime.Versioning;
22
using Beutl.Extensibility;
3+
using Beutl.Language;
34
using MonoMac.AppKit;
45
using System.ComponentModel.DataAnnotations;
56
using System.Runtime.InteropServices;
@@ -8,7 +9,7 @@ namespace Beutl.Extensions.AVFoundation.Encoding;
89

910
[Export]
1011
[SupportedOSPlatform("macos")]
11-
[Display(Name = "AVFoundation Encoder")]
12+
[Display(Name = nameof(Strings.AVFoundationEncoder), ResourceType = typeof(Strings))]
1213
public class AVFEncodingExtension : ControllableEncodingExtension
1314
{
1415
public override void Load()

src/Beutl.Extensions.FFmpeg/Decoding/FFmpegDecodingExtension.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Beutl.Media.Decoding;
33
using System.ComponentModel.DataAnnotations;
44
using Beutl.Extensions.FFmpeg;
5+
using Beutl.Extensions.FFmpeg.Properties;
56

67
#if FFMPEG_BUILD_IN
78
namespace Beutl.Embedding.FFmpeg.Decoding;
@@ -10,7 +11,7 @@ namespace Beutl.Extensions.FFmpeg.Decoding;
1011
#endif
1112

1213
[Export]
13-
[Display(Name = "FFmpeg Decoder")]
14+
[Display(Name = nameof(Strings.FFmpegDecoder), ResourceType = typeof(Strings))]
1415
public class FFmpegDecodingExtension : DecodingExtension
1516
{
1617
public override FFmpegDecodingSettings Settings { get; } = new FFmpegDecodingSettings();

src/Beutl.Extensions.FFmpeg/Encoding/FFmpegControlledEncodingExtension.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Beutl.Extensibility;
22
using System.ComponentModel.DataAnnotations;
33
using Beutl.Extensions.FFmpeg;
4+
using Beutl.Extensions.FFmpeg.Properties;
45

56
#if FFMPEG_BUILD_IN
67
namespace Beutl.Embedding.FFmpeg.Encoding;
@@ -9,7 +10,7 @@ namespace Beutl.Extensions.FFmpeg.Encoding;
910
#endif
1011

1112
[Export]
12-
[Display(Name = "FFmpeg Encoder")]
13+
[Display(Name = nameof(Strings.FFmpegEncoder), ResourceType = typeof(Strings))]
1314
public class FFmpegControlledEncodingExtension : ControllableEncodingExtension
1415
{
1516
public override FFmpegEncodingSettings Settings { get; } = new();

0 commit comments

Comments
 (0)