Skip to content

Commit

Permalink
Translation Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Sep 23, 2023
1 parent d1c7dd1 commit beab603
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ private void InitializeViewModel()
Expandable = false
};

ApplicationLanguage.Title.Text = "Uygulama Dili";
ApplicationLanguage.LeftIcon.Symbol = SymbolRegular.LocalLanguage24;
ApplicationLanguage.Description.Text = "Uygulamayı görüntülemek istediğiniz dili seçin.";
ApplicationLanguage.Title.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "ApplicationLanguage");
ApplicationLanguage.Description.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "ApplicationLanguage", "Description");

ComboBox Localization = new();

Expand All @@ -101,18 +101,18 @@ private void InitializeViewModel()
Expandable = false
};

ApplicationStartup.Title.Text = "Başlangıçta Çalıştır";
ApplicationStartup.LeftIcon.Symbol = SymbolRegular.Play24;
ApplicationStartup.Description.Text = "Duvar kağıdını oynatabilmek için Sucrose arka planda çalışmalı.";
ApplicationStartup.Title.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "ApplicationStartup");
ApplicationStartup.Description.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "ApplicationStartup", "Description");

ComboBox Startup = new();

Startup.SelectionChanged += (s, e) => StartupSelected(Startup.SelectedIndex);

Startup.Items.Add("Yok");
Startup.Items.Add("Normal");
Startup.Items.Add("Öncelik");
Startup.Items.Add("Zamanlayıcı");
Startup.Items.Add(SSRER.GetValue("Portal", "GeneralSettingPage", "ApplicationStartup", "Startup", "None"));
Startup.Items.Add(SSRER.GetValue("Portal", "GeneralSettingPage", "ApplicationStartup", "Startup", "Normal"));
Startup.Items.Add(SSRER.GetValue("Portal", "GeneralSettingPage", "ApplicationStartup", "Startup", "Priority"));
Startup.Items.Add(SSRER.GetValue("Portal", "GeneralSettingPage", "ApplicationStartup", "Startup", "Scheduler"));

Startup.SelectedIndex = SMMM.Startup;

Expand All @@ -126,24 +126,24 @@ private void InitializeViewModel()
IsExpand = true
};

NotifyIcon.Title.Text = "Bildirim Alanı Simgesi";
NotifyIcon.LeftIcon.Symbol = SymbolRegular.TrayItemAdd24;
NotifyIcon.Description.Text = "Sistem tepsisi görünürlüğü. Sucrose gizli bir şekilde çalışmaya devam eder.";
NotifyIcon.Title.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "NotifyIcon");
NotifyIcon.Description.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "NotifyIcon", "Description");

ComboBox Notify = new();

Notify.SelectionChanged += (s, e) => NotifySelected(Notify.SelectedIndex);

Notify.Items.Add("Görünür");
Notify.Items.Add("Görünmez");
Notify.Items.Add(SSRER.GetValue("Portal", "GeneralSettingPage", "NotifyIcon", "Notify", "Show"));
Notify.Items.Add(SSRER.GetValue("Portal", "GeneralSettingPage", "NotifyIcon", "Notify", "Hide"));

Notify.SelectedIndex = SMMM.Visible ? 0 : 1;

NotifyIcon.HeaderFrame = Notify;

CheckBox NotifyExit = new()
{
Content = "Sistem Tepsisi kapatıldığında tüm Sucrose uygulamaları kapatılsın",
Content = SSRER.GetValue("Portal", "GeneralSettingPage", "NotifyIcon", "NotifyExit"),
IsChecked = SMMM.Exit
};

Expand All @@ -159,9 +159,9 @@ private void InitializeViewModel()
Margin = new Thickness(0, 10, 0, 0)
};

WindowBackdrop.Title.Text = "Pencere Arka Planı";
WindowBackdrop.LeftIcon.Symbol = SymbolRegular.ColorBackground24;
WindowBackdrop.Description.Text = "Uygulama penceresinin arka planını değiştirmek için kullanılır.";
WindowBackdrop.Title.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop");
WindowBackdrop.Description.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "Description");

ComboBox Backdrop = new();

Expand All @@ -171,8 +171,8 @@ private void InitializeViewModel()
{
Backdrop.Items.Add(new ComboBoxItem()
{
IsEnabled = WindowBackdropSupport(Type),
Content = $"{Type}"
Content = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "Backdrop", $"{Type}"),
IsEnabled = WindowBackdropSupport(Type)
});
}

Expand All @@ -189,7 +189,7 @@ private void InitializeViewModel()

Button BackgroundImage = new()
{
Content = string.IsNullOrEmpty(SMMM.BackgroundImage) ? "Bir arkaplan resmi seçin" : SMMM.BackgroundImage,
Content = string.IsNullOrEmpty(SMMM.BackgroundImage) ? SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "BackgroundImage", "Select") : SMMM.BackgroundImage,
Cursor = Cursors.Hand,
MaxWidth = 700,
MinWidth = 350
Expand Down Expand Up @@ -224,11 +224,11 @@ private void InitializeViewModel()

TextBlock BackdropStretchText = new()
{
Text = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "BackdropStretch"),
Foreground = SSRER.GetResource<Brush>("TextFillColorPrimaryBrush"),
VerticalAlignment = VerticalAlignment.Center,
Margin = new Thickness(0, 0, 10, 0),
FontWeight = FontWeights.SemiBold,
Text = "Konumlandırma:",
FontWeight = FontWeights.SemiBold
};

ComboBox BackdropStretch = new();
Expand All @@ -239,19 +239,19 @@ private void InitializeViewModel()
{
BackdropStretch.Items.Add(new ComboBoxItem()
{
Content = $"{Type}"
Content = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "BackdropStretch", $"{Type}")
});
}

BackdropStretch.SelectedIndex = (int)SPMM.BackgroundStretch;

TextBlock BackdropOpacityText = new()
{
Text = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "BackdropOpacity"),
Foreground = SSRER.GetResource<Brush>("TextFillColorPrimaryBrush"),
VerticalAlignment = VerticalAlignment.Center,
Margin = new Thickness(20, 0, 10, 0),
FontWeight = FontWeights.SemiBold,
Text = "Opaklık (%):",
FontWeight = FontWeights.SemiBold
};

NumberBox BackdropOpacity = new()
Expand Down Expand Up @@ -297,9 +297,9 @@ private void InitializeViewModel()
IsExpand = true
};

EngineVolume.Title.Text = "Ses Düzeyi";
EngineVolume.LeftIcon.Symbol = VolumeSymbol(SMMM.Volume);
EngineVolume.Description.Text = "Tüm duvar kağıtları için ses seviyesi.";
EngineVolume.Title.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "EngineVolume");
EngineVolume.Description.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "EngineVolume", "Description");

Slider Volume = new()
{
Expand All @@ -320,7 +320,7 @@ private void InitializeViewModel()

CheckBox VolumeDesktop = new()
{
Content = "Sesi yalnızca masaüstü odaklandığında oynat",
Content = SSRER.GetValue("Portal", "GeneralSettingPage", "EngineVolume", "VolumeDesktop"),
IsChecked = SMMM.VolumeDesktop
};

Expand All @@ -346,9 +346,9 @@ private void InitializeViewModel()
Margin = new Thickness(0, 10, 0, 0)
};

PrivateLibrary.Title.Text = "Kütüphane Konumu";
PrivateLibrary.LeftIcon.Symbol = SymbolRegular.Folder24;
PrivateLibrary.Description.Text = "Kütüphanenize eklediğiniz temaların saklanacağı konum.";
PrivateLibrary.Title.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "PrivateLibrary");
PrivateLibrary.Description.Text = SSRER.GetValue("Portal", "GeneralSettingPage", "PrivateLibrary", "Description");

StackPanel LibraryContent = new();

Expand Down Expand Up @@ -460,7 +460,7 @@ private void StartupSelected(int Index)
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Startup}{SMR.ValueSeparator}{SMR.AppName}{SMR.ValueSeparator}{SSSMI.Launcher}{SMR.ValueSeparator}{true}");
break;
case 2:
SSSHP.Runas(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.StartupM}{SMR.ValueSeparator}{SMR.AppName}{SMR.ValueSeparator}{SSSMI.Launcher}{SMR.ValueSeparator}{true}");
SSSHP.Runas(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.StartupP}{SMR.ValueSeparator}{SMR.AppName}{SMR.ValueSeparator}{SSSMI.Launcher}{SMR.ValueSeparator}{true}");
break;
case 3:
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Scheduler}{SMR.ValueSeparator}{SSDESCT.Create}{SMR.ValueSeparator}{SSSMI.Launcher}");
Expand Down Expand Up @@ -585,10 +585,10 @@ private void BackgroundImageClick(Button BackgroundImage)

OpenFileDialog FileDialog = new()
{
Filter = "Image files (*.png;*.jpg;*.jpeg;*.tiff;*.webp;*.gif)|*.png;*.jpg;*.jpeg;*.tiff;*.webp;*.gif",
Filter = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "BackgroundImage", "Filter"),
FilterIndex = 1,

Title = SSRER.GetValue("Launcher", "SaveDialogTitle"),
Title = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "BackgroundImage", "Title"),

InitialDirectory = Startup
};
Expand Down Expand Up @@ -624,7 +624,7 @@ private async void LibraryLocationClick(Button LibraryLocation)
{
if (!SMMM.LibraryMove || (!Directory.GetFiles(Destination).Any() && !Directory.GetDirectories(Destination).Any()))
{
LibraryLocation.Content = "Konum değiştirilirken lütfen biraz bekleyin";
LibraryLocation.Content = SSRER.GetValue("Portal", "GeneralSettingPage", "PrivateLibrary", "LibraryLocation", "Move");

if (SMMM.LibraryMove)
{
Expand Down Expand Up @@ -665,7 +665,7 @@ private async void LibraryLocationClick(Button LibraryLocation)
}
else
{
LibraryLocation.Content = "Lütfen boş bir klasör seç";
LibraryLocation.Content = SSRER.GetValue("Portal", "GeneralSettingPage", "PrivateLibrary", "LibraryLocation", "Empty");

await Task.Delay(2000);

Expand Down Expand Up @@ -694,7 +694,7 @@ private void LibraryLocationOpenClick(Button LibraryLocation)

private void BackgroundImageRemoveClick(Button BackgroundImage)
{
BackgroundImage.Content = "Bir arkaplan resmi seçin";
BackgroundImage.Content = SSRER.GetValue("Portal", "GeneralSettingPage", "WindowBackdrop", "BackgroundImage", "Select");

SMMI.PortalSettingManager.SetSetting(SMC.BackgroundImage, string.Empty);

Expand Down
10 changes: 10 additions & 0 deletions src/Shared/Sucrose.Shared.Resources/Extension/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public static string GetValue(string Area, string Prefix, string Key, string Suf
return GetResource(Area + "." + Prefix + "." + Key + "." + Suffix, GetBack(Area, Prefix, Key, Suffix));
}

public static string GetValue(string Area, string Prefix, string Key, string Suffix, string Last)
{
return GetResource(Area + "." + Prefix + "." + Key + "." + Suffix + "." + Last, GetBack(Area, Prefix, Key, Suffix, Last));
}

public static T GetResource<T>(string Resource, T Back = default)
{
object Result = Application.Current.TryFindResource(Resource);
Expand Down Expand Up @@ -57,5 +62,10 @@ private static string GetBack(string Area, string Prefix, string Key, string Suf
{
return GetBack(Area + "." + Prefix + "." + Key + "." + Suffix);
}

private static string GetBack(string Area, string Prefix, string Key, string Suffix, string Last)
{
return GetBack(Area + "." + Prefix + "." + Key + "." + Suffix + "." + Last);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,58 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.GeneralSettingPage.Title">GeneralSettingPage</system:String>

<system:String x:Key="Portal.GeneralSettingPage.ApplicationLanguage">Uygulama Dili</system:String>
<system:String x:Key="Portal.GeneralSettingPage.ApplicationLanguage.Description">Uygulamayı görüntülemek istediğiniz dili seçin.</system:String>

<system:String x:Key="Portal.GeneralSettingPage.ApplicationStartup">Başlangıçta Çalıştır</system:String>
<system:String x:Key="Portal.GeneralSettingPage.ApplicationStartup.Description">Duvar kağıdını oynatabilmek için Sucrose arka planda çalışmalı.</system:String>

<system:String x:Key="Portal.GeneralSettingPage.ApplicationStartup.Startup.None">Yok</system:String>
<system:String x:Key="Portal.GeneralSettingPage.ApplicationStartup.Startup.Normal">Normal</system:String>
<system:String x:Key="Portal.GeneralSettingPage.ApplicationStartup.Startup.Priority">Öncelik</system:String>
<system:String x:Key="Portal.GeneralSettingPage.ApplicationStartup.Startup.Scheduler">Zamanlayıcı</system:String>

<system:String x:Key="Portal.GeneralSettingPage.NotifyIcon">Bildirim Alanı Simgesi</system:String>
<system:String x:Key="Portal.GeneralSettingPage.NotifyIcon.Description">Sistem tepsisi görünürlüğü. Sucrose gizli bir şekilde çalışmaya devam eder.</system:String>

<system:String x:Key="Portal.GeneralSettingPage.NotifyIcon.Notify.Show">Görünür</system:String>
<system:String x:Key="Portal.GeneralSettingPage.NotifyIcon.Notify.Hide">Görünmez</system:String>

<system:String x:Key="Portal.GeneralSettingPage.NotifyIcon.NotifyExit">Sistem tepsisi kapatıldığında tüm Sucrose uygulamaları da kapatılsın</system:String>

<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop">Pencere Arka Planı</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.Description">Uygulama penceresinin arka planını özelleştirmek için kullanılır.</system:String>

<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.Backdrop.None">Yok</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.Backdrop.Mica">Mika</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.Backdrop.Auto">Otomatik</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.Backdrop.Tabbed">Sekmeli</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.Backdrop.Acrylic">Akrilik</system:String>

<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackgroundImage.Title">Resim Dosyası Seç</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackgroundImage.Select">Bir arkaplan resmi seçin</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackgroundImage.Filter">Resim Dosyaları (*.png;*.jpg;*.jpeg;*.tiff;*.webp;*.gif)|*.png;*.jpg;*.jpeg;*.tiff;*.webp;*.gif</system:String>

<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackdropStretch">Konumlandırma:</system:String>

<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackdropStretch.None">Yok</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackdropStretch.Fill">Doldur</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackdropStretch.UniformToFill">Sığdır</system:String>
<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackdropStretch.Uniform">Hepsini Sığdır</system:String>

<system:String x:Key="Portal.GeneralSettingPage.WindowBackdrop.BackdropOpacity">Opaklık (%):</system:String>

<system:String x:Key="Portal.GeneralSettingPage.EngineVolume">Ses Düzeyi</system:String>
<system:String x:Key="Portal.GeneralSettingPage.EngineVolume.Description">Tüm duvar kağıtları için ses seviyesi.</system:String>

<system:String x:Key="Portal.GeneralSettingPage.EngineVolume.VolumeDesktop">Sesi yalnızca masaüstü odaklandığında oynat</system:String>

<system:String x:Key="Portal.GeneralSettingPage.PrivateLibrary">Kütüphane Konumu</system:String>
<system:String x:Key="Portal.GeneralSettingPage.PrivateLibrary.Description">Kütüphanenize eklediğiniz temaların saklanacağı konum.</system:String>

<system:String x:Key="Portal.GeneralSettingPage.PrivateLibrary.LibraryLocation.Empty">"Lütfen boş bir klasör seç"</system:String>
<system:String x:Key="Portal.GeneralSettingPage.PrivateLibrary.LibraryLocation.Move">Konum değiştirilirken lütfen biraz bekleyin</system:String>

<system:String x:Key="Portal.GeneralSettingPage.PrivateLibrary.LibraryMove">Mevcut kütüphanenizi yeni konuma taşı</system:String>
</ResourceDictionary>

0 comments on commit beab603

Please sign in to comment.