Skip to content

Commit

Permalink
Translation Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Oct 3, 2023
1 parent 2409025 commit 6c6f135
Show file tree
Hide file tree
Showing 17 changed files with 155 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ private async Task ScreenMonitor()

int ScreenCount = SWUS.Screens.Count();

while (SMMM.ScreenIndex > ScreenCount - 1)
if (SMMM.ScreenIndex > ScreenCount - 1)
{
SMMI.EngineSettingManager.SetSetting(SMC.ScreenIndex, SMMM.ScreenIndex - 1);

await Task.Delay(10);
SMMI.EngineSettingManager.SetSetting(SMC.ScreenIndex, ScreenCount - 1);
}

for (int Count = 0; Count < ScreenCount; Count++)
Expand Down
55 changes: 23 additions & 32 deletions src/Portal/Sucrose.Portal/Views/Controls/LibraryCard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ private void Use()
}
}

private void UpdateInfo()
{
ToolTip TitleTip = new()
{
Content = Info.Title
};

ToolTip DescriptionTip = new()
{
Content = Info.Description
};

ThemeTitle.ToolTip = TitleTip;
ThemeDescription.ToolTip = DescriptionTip;

ThemeTitle.Text = Info.Title.Length > SMMM.TitleLength ? $"{SHA.Cut(Info.Title, SMMM.TitleLength)}..." : Info.Title;
ThemeDescription.Text = Info.Description.Length > SMMM.DescriptionLength ? $"{SHA.Cut(Info.Description, SMMM.DescriptionLength)}..." : Info.Description;
}

private void MenuUse_Click(object sender, RoutedEventArgs e)
{
if (Info.AppVersion.CompareTo(SHV.Entry()) <= 0)
Expand All @@ -83,27 +102,13 @@ private async void MenuEdit_Click(object sender, RoutedEventArgs e)
Theme = Theme
};

ContentDialogResult result = await ThemeEdit.ShowAsync();
ContentDialogResult Result = await ThemeEdit.ShowAsync();

if (result == ContentDialogResult.Primary)
if (Result == ContentDialogResult.Primary)
{
Info = SSTHI.ReadJson(Path.Combine(Theme, SMR.SucroseInfo));

ToolTip TitleTip = new()
{
Content = Info.Title
};

ToolTip DescriptionTip = new()
{
Content = Info.Description
};

ThemeTitle.ToolTip = TitleTip;
ThemeDescription.ToolTip = DescriptionTip;

ThemeTitle.Text = Info.Title.Length > SMMM.TitleLength ? $"{SHA.Cut(Info.Title, SMMM.TitleLength)}..." : Info.Title;
ThemeDescription.Text = Info.Description.Length > SMMM.DescriptionLength ? $"{SHA.Cut(Info.Description, SMMM.DescriptionLength)}..." : Info.Description;
UpdateInfo();
}

ThemeEdit.Dispose();
Expand Down Expand Up @@ -199,21 +204,7 @@ private void ContextMenu_Opened(object sender, RoutedEventArgs e)

private void LibraryCard_Loaded(object sender, RoutedEventArgs e)
{
ToolTip TitleTip = new()
{
Content = Info.Title
};

ToolTip DescriptionTip = new()
{
Content = Info.Description
};

ThemeTitle.ToolTip = TitleTip;
ThemeDescription.ToolTip = DescriptionTip;

ThemeTitle.Text = Info.Title.Length > SMMM.TitleLength ? $"{SHA.Cut(Info.Title, SMMM.TitleLength)}..." : Info.Title;
ThemeDescription.Text = Info.Description.Length > SMMM.DescriptionLength ? $"{SHA.Cut(Info.Description, SMMM.DescriptionLength)}..." : Info.Description;
UpdateInfo();

string ImagePath = Path.Combine(Theme, Info.Thumbnail);

Expand Down
18 changes: 9 additions & 9 deletions src/Portal/Sucrose.Portal/Views/Controls/ThemeEdit.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Sucrose.Portal.Views.Controls"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
CloseButtonText="Kapat"
PrimaryButtonText="Kaydet"
Title="Tema Düzenleme"
PrimaryButtonText="{DynamicResource Portal.ThemeEdit.Save}"
CloseButtonText="{DynamicResource Portal.ThemeEdit.Close}"
Title="{DynamicResource Portal.ThemeEdit.Title}"
PreviewKeyDown="ContentDialog_PreviewKeyDown"
Loaded="ContentDialog_Loaded"
DialogMaxWidth="750"
Expand All @@ -20,21 +20,21 @@

<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Orientation="Vertical" MinWidth="400">
<ui:Image x:Name="ThemeThumbnail" Stretch="UniformToFill" CornerRadius="20" Width="Auto" Height="300" />
<TextBlock Text="Başlık" Margin="0 10 0 0" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />

<TextBlock Text="{DynamicResource Portal.ThemeEdit.ThemeTitle}" Margin="0 10 0 0" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
<ui:TextBox x:Name="ThemeTitle" Margin="0 3 0 0" MaxLength="50" AcceptsReturn="False" AcceptsTab="False" />

<TextBlock Text="Açıklama" Margin="0 10 0 0" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
<TextBlock Text="{DynamicResource Portal.ThemeEdit.ThemeDescription}" Margin="0 10 0 0" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
<ui:TextBox x:Name="ThemeDescription" Margin="0 3 0 0" MaxLength="500" MaxLines="10" TextWrapping="WrapWithOverflow" MinLines="5" AcceptsReturn="True" AcceptsTab="False" />

<TextBlock Text="Yazar" Margin="0 10 0 0" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
<TextBlock Text="{DynamicResource Portal.ThemeEdit.ThemeAuthor}" Margin="0 10 0 0" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
<ui:TextBox x:Name="ThemeAuthor" Margin="0 3 0 0" MaxLength="50" AcceptsReturn="False" AcceptsTab="False" />

<TextBlock Text="İletişim" Margin="0 10 0 0" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
<TextBlock Text="{DynamicResource Portal.ThemeEdit.ThemeContact}" Margin="0 10 0 0" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
<ui:TextBox x:Name="ThemeContact" Margin="0 3 0 0" MaxLength="250" AcceptsReturn="False" AcceptsTab="False" Cursor="IBeam" />

<StackPanel x:Name="Arguments">
<TextBlock Margin="0 10 0 0" Text="Argümanlar" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
<TextBlock Margin="0 10 0 0" Text="{DynamicResource Portal.ThemeEdit.ThemeArguments}" TextWrapping="WrapWithOverflow" FontSize="16" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
<ui:TextBox x:Name="ThemeArguments" Margin="0 3 0 0" MaxLength="250" AcceptsReturn="False" AcceptsTab="False" />
</StackPanel>
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ThemeEdit/Portal.ThemeEdit.DE.xaml" />
<ResourceDictionary Source="StoreCard/Portal.StoreCard.DE.xaml" />
<ResourceDictionary Source="Pagination/Portal.Pagination.DE.xaml" />
<ResourceDictionary Source="ThemeShare/Portal.ThemeShare.DE.xaml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ThemeEdit/Portal.ThemeEdit.EN.xaml" />
<ResourceDictionary Source="StoreCard/Portal.StoreCard.EN.xaml" />
<ResourceDictionary Source="Pagination/Portal.Pagination.EN.xaml" />
<ResourceDictionary Source="ThemeShare/Portal.ThemeShare.EN.xaml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ThemeEdit/Portal.ThemeEdit.ES.xaml" />
<ResourceDictionary Source="StoreCard/Portal.StoreCard.ES.xaml" />
<ResourceDictionary Source="Pagination/Portal.Pagination.ES.xaml" />
<ResourceDictionary Source="ThemeShare/Portal.ThemeShare.ES.xaml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ThemeEdit/Portal.ThemeEdit.FR.xaml" />
<ResourceDictionary Source="StoreCard/Portal.StoreCard.FR.xaml" />
<ResourceDictionary Source="Pagination/Portal.Pagination.FR.xaml" />
<ResourceDictionary Source="ThemeShare/Portal.ThemeShare.FR.xaml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ThemeEdit/Portal.ThemeEdit.PL.xaml" />
<ResourceDictionary Source="StoreCard/Portal.StoreCard.PL.xaml" />
<ResourceDictionary Source="Pagination/Portal.Pagination.PL.xaml" />
<ResourceDictionary Source="ThemeShare/Portal.ThemeShare.PL.xaml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ThemeEdit/Portal.ThemeEdit.TR.xaml" />
<ResourceDictionary Source="StoreCard/Portal.StoreCard.TR.xaml" />
<ResourceDictionary Source="Pagination/Portal.Pagination.TR.xaml" />
<ResourceDictionary Source="ThemeShare/Portal.ThemeShare.TR.xaml" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeEdit.Title">Themenbearbeitung</system:String>
<system:String x:Key="Portal.ThemeEdit.Close">Schließen</system:String>
<system:String x:Key="Portal.ThemeEdit.Save">Speichern</system:String>

<system:String x:Key="Portal.ThemeEdit.ThemeTitle">Titel</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeDescription">Beschreibung</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeAuthor">Autor</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeContact">Kontakt</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeArguments">Argumente</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeEdit.Title">Edit Theme</system:String>
<system:String x:Key="Portal.ThemeEdit.Close">Close</system:String>
<system:String x:Key="Portal.ThemeEdit.Save">Save</system:String>

<system:String x:Key="Portal.ThemeEdit.ThemeTitle">Title</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeDescription">Description</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeAuthor">Author</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeContact">Contact</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeArguments">Arguments</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeEdit.Title">Edición de Tema</system:String>
<system:String x:Key="Portal.ThemeEdit.Close">Cerrar</system:String>
<system:String x:Key="Portal.ThemeEdit.Save">Guardar</system:String>

<system:String x:Key="Portal.ThemeEdit.ThemeTitle">Título</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeDescription">Descripción</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeAuthor">Autor</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeContact">Contacto</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeArguments">Argumentos</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeEdit.Title">Édition de Thème</system:String>
<system:String x:Key="Portal.ThemeEdit.Close">Fermer</system:String>
<system:String x:Key="Portal.ThemeEdit.Save">Enregistrer</system:String>

<system:String x:Key="Portal.ThemeEdit.ThemeTitle">Titre</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeDescription">Description</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeAuthor">Auteur</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeContact">Contact</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeArguments">Arguments</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeEdit.Title">Edycja Motywu</system:String>
<system:String x:Key="Portal.ThemeEdit.Close">Zamknij</system:String>
<system:String x:Key="Portal.ThemeEdit.Save">Zapisz</system:String>

<system:String x:Key="Portal.ThemeEdit.ThemeTitle">Tytuł</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeDescription">Opis</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeAuthor">Autor</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeContact">Kontakt</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeArguments">Argumenty</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeEdit.Title">Tema Düzenleme</system:String>
<system:String x:Key="Portal.ThemeEdit.Close">Kapat</system:String>
<system:String x:Key="Portal.ThemeEdit.Save">Kaydet</system:String>

<system:String x:Key="Portal.ThemeEdit.ThemeTitle">Başlık</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeDescription">Açıklama</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeAuthor">Yazar</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeContact">İletişim</system:String>
<system:String x:Key="Portal.ThemeEdit.ThemeArguments">Argümanlar</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeReview.Title">Themenbewertung</system:String>
<system:String x:Key="Portal.ThemeReview.Close">Kapat</system:String>
<system:String x:Key="Portal.ThemeReview.Close">Schließen</system:String>

<system:String x:Key="Portal.ThemeReview.ThemeTitle">Titel</system:String>
<system:String x:Key="Portal.ThemeReview.ThemeDescription">Beschreibung</system:String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,30 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeEdit\Portal.ThemeEdit.DE.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeEdit\Portal.ThemeEdit.EN.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeEdit\Portal.ThemeEdit.ES.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeEdit\Portal.ThemeEdit.FR.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeEdit\Portal.ThemeEdit.PL.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeEdit\Portal.ThemeEdit.TR.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeShare\Portal.ThemeShare.DE.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down

0 comments on commit 6c6f135

Please sign in to comment.