Skip to content

Commit

Permalink
tray langs
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn committed Apr 25, 2024
1 parent dab3d25 commit 077c187
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 3 additions & 1 deletion OneMoreTray/OneMoreTray.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
<EmbeddedResource Include="Properties\Resources.fr-FR.resx" />
<EmbeddedResource Include="Properties\Resources.he-IL.resx" />
<EmbeddedResource Include="Properties\Resources.nl-NL.resx" />
<EmbeddedResource Include="Properties\Resources.pl-PL.resx" />
<EmbeddedResource Include="Properties\Resources.pl-PL.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.pt-BR.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
Expand Down
19 changes: 18 additions & 1 deletion OneMoreTray/ScanningJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ namespace OneMoreTray
{
using River.OneMoreAddIn;
using River.OneMoreAddIn.Commands;
using River.OneMoreAddIn.Settings;
using River.OneMoreAddIn.UI;
using System;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand All @@ -25,11 +27,16 @@ internal class ScanningJob : ApplicationContext
public ScanningJob()
{
logger = Logger.Current;

SetLanguage();

trayIcon = MakeNotifyIcon();

scheduler = new HashtagScheduler();

if (!scheduler.ScheduleExists)
// for debugging, pass an argument!
var args = Environment.GetCommandLineArgs();
if (args.Length == 0 && !scheduler.ScheduleExists)
{
ToastMissingSchedule();
return;
Expand Down Expand Up @@ -80,6 +87,16 @@ private NotifyIcon MakeNotifyIcon()
}


private void SetLanguage()
{
var settings = new SettingsProvider().GetCollection(nameof(GeneralSheet));
var lang = settings.Get("language", "en");
var culture = CultureInfo.GetCultureInfo(lang);
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
}


private void ScheduleScan()
{
source = new CancellationTokenSource();
Expand Down

0 comments on commit 077c187

Please sign in to comment.