Skip to content

Commit

Permalink
feat: 국제화 일부 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
potados99 committed Sep 16, 2023
1 parent 6522ada commit daddb76
Show file tree
Hide file tree
Showing 16 changed files with 1,054 additions and 18 deletions.
3 changes: 3 additions & 0 deletions FocusTimer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ protected override void OnStartup(StartupEventArgs e)

Modules.Get<FocusTimerDatabaseContext>().Initialize();
Logger.Info("DB Context를 초기화하였습니다.");

Strings.Initialize();
Logger.Info("스트링 리소스를 초기화하였습니다.");

new AppCenterCrashes().SetupExceptionHandler();
}
Expand Down
6 changes: 3 additions & 3 deletions FocusTimer/Features/Timer/MainViewModel.Concentration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private double CalculateConcentration()
IsChecked = false,
Icon = new System.Windows.Controls.Image
{Source = Application.Current.FindResource("ic_magnify") as DrawingImage},
Header = "집중도 표시 옵션 ",
Header = $"{Strings.Get("concentration_display_options")} ",
};

private readonly BindableMenuItem _whichAppToIncludeMenuItem = new()
Expand All @@ -63,7 +63,7 @@ private double CalculateConcentration()
IsChecked = false,
Icon = new System.Windows.Controls.Image
{Source = Application.Current.FindResource("ic_calculator_variant_outline") as DrawingImage},
Header = "집중도 계산에 포함할 프로그램 ",
Header = $"{Strings.Get("programs_to_include_in_calculation")} ",
};

private BindableMenuItem[] GenerateConcentrationSelectionMenu()
Expand All @@ -87,7 +87,7 @@ private BindableMenuItem BuildShowConcentrationMenuItem()
{
IsCheckable = true,
IsChecked = Settings.GetShowConcentration(),
Header = "집중도를 표시합니다"
Header = Strings.Get("show_concentration")
};

item.OnCheck += (isChecked) =>
Expand Down
3 changes: 2 additions & 1 deletion FocusTimer/Features/Timer/MainViewModel.Slots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Microsoft.AppCenter.Crashes;
using System;
using System.Linq;
using System.Windows;
using FocusTimer.Features.Timer.Slot;
using FocusTimer.Library;
using FocusTimer.Library.Extensions;
Expand Down Expand Up @@ -64,7 +65,7 @@ private void FinishRegisteringApp(IntPtr windowHandle)
if (TimerSlots.Select(s => s.CurrentAppItem?.ProcessExecutablePath).Contains(executablePath))
{
this.GetLogger().Warn("앱 등록을 마치려는데, 이미 등록된 프로그램입니다. 따라서 아무 일도 하지 않고 중단합니다.");
UnableToRegisterApp("이미 등록된 프로그램이에요.");
UnableToRegisterApp(Strings.Get("program_already_added"));
return;
}

Expand Down
4 changes: 2 additions & 2 deletions FocusTimer/Features/Timer/MainViewModel.Timer.Binding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public ToolTip? LockButtonToolTip
{
get
{
_lockButtonToolTip.Content = $"{(int) Math.Ceiling(_focusLockTimer.TimeLeft.TotalMinutes)}분 남았습니다.";
_lockButtonToolTip.Content = string.Format(Strings.Get("minutes_left"), (int) Math.Ceiling(_focusLockTimer.TimeLeft.TotalMinutes));

return IsFocusLockHold ? _lockButtonToolTip : null;
}
}

public string StartFocusLockItemLabel => $"{FocusLockHoldDuration}분간 강제 잠금";
public string StartFocusLockItemLabel => string.Format(Strings.Get("start_focus_lock_for"), FocusLockHoldDuration);
}
19 changes: 10 additions & 9 deletions FocusTimer/Features/Timer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
xmlns:slot="clr-namespace:FocusTimer.Features.Timer.Slot"
xmlns:resources="clr-namespace:FocusTimer.Resources"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
mc:Ignorable="d"
Topmost="True"
Expand Down Expand Up @@ -70,7 +71,7 @@

<MenuItem Style="{StaticResource ModernMenuItem}"
x:Name="ExitItem"
Header="종료"
Header="{x:Static resources:strings.exit}"
Click="ExitItem_Click"
IsEnabled="{c:Binding Path=!IsFocusLockHold}">
<MenuItem.Icon>
Expand All @@ -79,15 +80,15 @@
</MenuItem>
<MenuItem Style="{StaticResource ModernMenuItem}"
x:Name="ResetItem"
Header="타이머 리셋"
Header="{x:Static resources:strings.reset}"
Click="ResetItem_Click">
<MenuItem.Icon>
<Image Source="{StaticResource ic_refresh}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Style="{StaticResource ModernMenuItem}"
x:Name="ChartItem"
Header="통계 대시보드"
Header="{x:Static resources:strings.dashboard}"
Click="ChartItem_Click">
<MenuItem.Icon>
<Image Source="{StaticResource ic_chart_bar}" />
Expand All @@ -102,7 +103,7 @@
</MenuItem.Icon>
<MenuItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center">화면 강제 잠금:</TextBlock>
<TextBlock VerticalAlignment="Center" Text="{x:Static resources:strings.hold_focus_lock_for}"></TextBlock>
<xctk:IntegerUpDown AutoSelectBehavior="Never"
AllowTextInput="True"
MouseWheelActiveTrigger="MouseOver"
Expand All @@ -113,7 +114,7 @@
Foreground="{StaticResource Text.Primary.Foreground}"
Background="Transparent"
Margin="5,0" />
<TextBlock VerticalAlignment="Center">분</TextBlock>
<TextBlock VerticalAlignment="Center" Text="{x:Static resources:strings.minutes}"></TextBlock>
</StackPanel>
</MenuItem.Header>
</MenuItem>
Expand All @@ -124,7 +125,7 @@
</MenuItem.Icon>
<MenuItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center">동작이 없으면 타이머 정지:</TextBlock>
<TextBlock VerticalAlignment="Center" Text="{x:Static resources:strings.pause_timer_after}"></TextBlock>
<xctk:IntegerUpDown AutoSelectBehavior="Never"
AllowTextInput="True"
MouseWheelActiveTrigger="MouseOver"
Expand All @@ -135,7 +136,7 @@
Foreground="{StaticResource Text.Primary.Foreground}"
Background="Transparent"
Margin="5,0" />
<TextBlock VerticalAlignment="Center">초</TextBlock>
<TextBlock VerticalAlignment="Center" Text="{x:Static resources:strings.seconds}"></TextBlock>
</StackPanel>
</MenuItem.Header>
</MenuItem>
Expand All @@ -144,7 +145,7 @@

<MenuItem Style="{StaticResource ModernMenuItem}"
x:Name="InfoItem"
Header="프로그램 정보"
Header="{x:Static resources:strings.about}"
Click="InfoItem_Click">
<MenuItem.Icon>
<Image Source="{StaticResource ic_information_outline}" />
Expand Down Expand Up @@ -243,7 +244,7 @@
<Label Grid.Row="0"
Opacity="{Binding ShowConcentrationOpacity}"
Visibility="{Binding ShowConcentrationOpacity}"
Content="집중도"
Content="{x:Static resources:strings.concentration}"
Style="{StaticResource WhiteTextLabel}"
VerticalAlignment="Bottom"
HorizontalAlignment="Center" />
Expand Down
3 changes: 2 additions & 1 deletion FocusTimer/Features/Timer/Slot/TimerSlotControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:slot="clr-namespace:FocusTimer.Features.Timer.Slot"
xmlns:resources="clr-namespace:FocusTimer.Resources"
d:DataContext="{d:DesignInstance Type=slot:TimerSlotViewModel}"
mc:Ignorable="d"
d:DesignHeight="40"
Expand Down Expand Up @@ -79,7 +80,7 @@
VerticalAlignment="Center"
HorizontalAlignment="Left" />
<Label Grid.Column="1"
Content="프로그램 등록"
Content="{x:Static resources:strings.add_program}"
Foreground="White"
FontSize="14"
Padding="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// 다음 링크에서 받아볼 수 있습니다: <https://www.gnu.org/licenses/gpl-3.0.txt>

using System.Windows;
using FocusTimer.Library;
using FocusTimer.Library.Control.Base;

namespace FocusTimer.Features.Timer.Slot;
Expand All @@ -33,5 +34,5 @@ public partial class TimerSlotViewModel : BaseViewModel

public bool IsAppCountedOnConcentrationCalculation => CurrentAppItem is {IsCountedOnConcentrationCalculation: true};

public string WindowSelectPrompt { get; set; } = "창을 클릭해주세요";
public string WindowSelectPrompt { get; set; } = Strings.Get("click_window");
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// 라이센스 전문은 이 프로그램과 함께 제공되었을 것입니다. 만약 아니라면,
// 다음 링크에서 받아볼 수 있습니다: <https://www.gnu.org/licenses/gpl-3.0.txt>

using FocusTimer.Library;
using FocusTimer.Library.Extensions;

namespace FocusTimer.Features.Timer.Slot;
Expand All @@ -29,7 +30,7 @@ public void StartWaitingForApp()
CurrentAppItem?.Dispose();
CurrentAppItem = null;
IsWaitingForApp = true;
WindowSelectPrompt = "창을 클릭해주세요";
WindowSelectPrompt = Strings.Get("click_window");

OnRender();
}
Expand Down
162 changes: 162 additions & 0 deletions FocusTimer/FocusTimer - Backup (1).csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
<TargetFramework>net6.0-windows</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>false</SelfContained>
<Nullable>enable</Nullable>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Deterministic>false</Deterministic>
</PropertyGroup>

<ItemGroup>
<None Remove="Resources\DSEG7Classic-Bold.ttf" />
<None Remove="Resources\DSEG7Classic-Regular.ttf" />
<None Remove="Resources\log4net.config" />
</ItemGroup>

<ItemGroup>
<Content Include="Resources\log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="CalcBinding" Version="2.5.2" />
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.0" />
<PackageReference Include="log4net" Version="2.0.15" />
<PackageReference Include="MaterialDesignThemes" Version="5.0.0-ci368" />
<PackageReference Include="Meziantou.Framework.Win32.CredentialManager" Version="1.4.2" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.2" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.10" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\skiasharp\LiveChartsCore.SkiaSharp.WPF\LiveChartsCore.SkiaSharpView.WPF.csproj" />
</ItemGroup>

<ItemGroup>
<Resource Include="Resources\DSEG7Classic-Bold.ttf" />
<Resource Include="Resources\DSEG7Classic-Regular.ttf" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Update="Features\Timer\Slot\TimerSlotControl.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Features\Timer\Border\BorderWindow.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Features\Charting\Metric\PrimaryMetricView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Resources\strings.ko-KR.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>strings.ko-KR.resx</DependentUpon>
</Compile>
<Compile Update="Resources\strings.ko-KR.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>strings.ko-KR.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>

<ItemGroup>
<ApplicationDefinition Remove="App.xaml" />
<Page Include="App.xaml" />
<Page Update="Features\Timer\Slot\TimerSlotControl.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Features\Timer\Border\BorderWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Features\Charting\Usages\AppUsageView.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Features\Charting\Metric\PrimaryMetricView.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Features\Charting\Usages\Detail\UsageByTimeView.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Library\Control\CircularProgressBar\MaterialDesignTheme.ProgressBar.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Features\Splash\SplashWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Resources\strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Resources\strings.ko-KR.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Resources\strings.ko-KR.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>strings.ko-KR.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<Target Name="SetAssemblyVersion" BeforeTargets="BeforeCompile">
<FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">
<Output PropertyName="AssemblyVersion" TaskParameter="OutputVersion" />
</FormatVersion>
<FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">
<Output PropertyName="InformationalVersion" TaskParameter="OutputVersion" />
</FormatVersion>
<FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">
<Output PropertyName="FileVersion" TaskParameter="OutputVersion" />
</FormatVersion>
</Target>

<Target Name="AutoSetMinimumRequiredVersion" BeforeTargets="GenerateDeploymentManifest">
<FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">
<Output PropertyName="MinimumRequiredVersion" TaskParameter="OutputVersion" />
</FormatVersion>
<FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">
<Output PropertyName="_DeploymentBuiltMinimumRequiredVersion" TaskParameter="OutputVersion" />
</FormatVersion>
</Target>

</Project>
Loading

0 comments on commit daddb76

Please sign in to comment.