From d679b4cf8e64d96e91fcd308c267d83c42896de5 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Sun, 9 May 2021 13:47:59 +0200 Subject: [PATCH 01/67] Initial commit - simple idea for a time zone plugin --- PowerToys.sln | 15 ++ .../Images/reg.dark.png | Bin 0 -> 2313 bytes .../Images/reg.light.png | Bin 0 -> 2330 bytes .../Main.cs | 163 ++++++++++++++++++ ...osoft.PowerToys.Run.Plugin.TimeZone.csproj | 115 ++++++++++++ .../Properties/Resources.Designer.cs | 81 +++++++++ .../Properties/Resources.resx | 126 ++++++++++++++ .../plugin.json | 13 ++ 8 files changed, 513 insertions(+) create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/reg.dark.png create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/reg.light.png create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json diff --git a/PowerToys.sln b/PowerToys.sln index 14dd3a356ae..4841c15ef7d 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -388,6 +388,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlwaysOnTopModuleInterface" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.PowerToys.Run.Plugin.WebSearch", "src\modules\launcher\Plugins\Community.PowerToys.Run.Plugin.WebSearch\Community.PowerToys.Run.Plugin.WebSearch.csproj", "{9F94B303-5E21-4364-9362-64426F8DB932}" EndProject +<<<<<<< HEAD Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MousePointerCrosshairs", "src\modules\MouseUtils\MousePointerCrosshairs\MousePointerCrosshairs.vcxproj", "{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StlThumbnailProvider", "src\modules\previewpane\StlThumbnailProvider\StlThumbnailProvider.csproj", "{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}" @@ -395,6 +396,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests-StlThumbnailProvider", "src\modules\previewpane\UnitTests-StlThumbnailProvider\UnitTests-StlThumbnailProvider.csproj", "{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonacoPreviewHandler", "src\modules\previewpane\MonacoPreviewHandler\MonacoPreviewHandler.csproj", "{04B193D7-3E21-46B8-A958-89B63A8A69DE}" +======= +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.TimeZone", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeZone\Microsoft.PowerToys.Run.Plugin.TimeZone.csproj", "{F44934A8-36F3-49B0-9465-3831BE041CDE}" +>>>>>>> f5e943784 (Initial commit - simple idea for a time zone plugin) EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1053,6 +1057,7 @@ Global {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x64.ActiveCfg = Release|x64 {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x64.Build.0 = Release|x64 {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x86.ActiveCfg = Release|x64 +<<<<<<< HEAD {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x64.ActiveCfg = Debug|x64 {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x64.Build.0 = Debug|x64 {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x86.ActiveCfg = Debug|x64 @@ -1077,6 +1082,12 @@ Global {04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x64.ActiveCfg = Release|x64 {04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x64.Build.0 = Release|x64 {04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x86.ActiveCfg = Release|Any CPU +======= + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x64.ActiveCfg = Debug|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x64.Build.0 = Debug|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.ActiveCfg = Release|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.Build.0 = Release|x64 +>>>>>>> f5e943784 (Initial commit - simple idea for a time zone plugin) EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1204,10 +1215,14 @@ Global {1DC3BE92-CE89-43FB-8110-9C043A2FE7A2} = {60CD2D4F-C3B9-4897-9821-FCA5098B41CE} {48A0A19E-A0BE-4256-ACF8-CC3B80291AF9} = {60CD2D4F-C3B9-4897-9821-FCA5098B41CE} {9F94B303-5E21-4364-9362-64426F8DB932} = {4AFC9975-2456-4C70-94A4-84073C1CED93} +<<<<<<< HEAD {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E} = {322566EF-20DC-43A6-B9F8-616AF942579A} {F7C8C0F1-5431-4347-89D0-8E5354F93CF2} = {2F305555-C296-497E-AC20-5FA1B237996A} {F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC} = {2F305555-C296-497E-AC20-5FA1B237996A} {04B193D7-3E21-46B8-A958-89B63A8A69DE} = {2F305555-C296-497E-AC20-5FA1B237996A} +======= + {F44934A8-36F3-49B0-9465-3831BE041CDE} = {4AFC9975-2456-4C70-94A4-84073C1CED93} +>>>>>>> f5e943784 (Initial commit - simple idea for a time zone plugin) EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/reg.dark.png b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/reg.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..562b3c188729b18e9334b680c22282fd0ed0d4fc GIT binary patch literal 2313 zcmcImYitx%7~K{_%cI~A3W@$;oF=9fX6M=2nW0N*cU!v1wwrdFR%1f%&b_-kba!W& znYP;oBG?i{O+`~k44Oz24GJOzi6|gQ8hMClG*QyvgQO5piwdH#QR1C_v;_eh6F0Lv zk9+R<&i8%i&fU#{`sGD4ADHQIIEs9A-bQ?8>~G<8{M(ZM$0mH5k*s^nbU5Y=+26da zi{?D&a1<=lf~{7of2E@8aVLO!2su;nBt|00eOLi+@#$#iV^VUuW-U5hMfTGPz!fY1?u-JzJzIkgo=D#H;F|#H4Q3ZMr1@66ex*T z1&VbEfRbc}r=&0n$sq`_J78KDp6}Jw4!aWe{ETg(u40byYAPbnhM~%rQ(`zIQA|j1 zQIZJDu{(K53;|XI49c-J7#dzVAU2uRRs}I5k|j}sP@-fP0u&Skh5`seigN)@=2eI! zmrN29aXorWH~c!p)#WEY_jx=4Ll0{)JYY61uO@so9+8zrk>Z>zNkCNz>qZ=4qiJyv zL3A<^v2BlK;B@OW6Zg0~yO5gDn(S3fBhv0vfNC!aH>uigK)6hq$J!mrJhg-}^Sh!5 zlitH68JMYutuA1ost9h$zq*jVn|Kp+-dnl=fGC6{o^r`hrns;mQ&NcIDFL!BH6%!` zawz3e|6inM%c@2}B7*Q6mL~suGE=krKl*Uz1vs@na873O+aNRPwq$7g#hP&#eY^Q4 zTpmOzYbEGLhM8?PZ}U%Rk*LEFaNTZ)I9 zPZnM&94&+!`#&pg+t?qdJ$Un&P`YC8r~PZ|FE&(vIJ98h^L%89Kprpo;neW5Hy>Gl zV1*;PA@B0wV9n6AXbs%5Um4X0;L@3c^RAybw{oEEgX>Q;5vXMNrD zao?A`XZD%b=FhuSRj}n+!Haa~yUMrIDtC46FK#{l`cmI}+rB8nac@$^ovD4X^Nmpoh3%l5@ZCTr@0eW}l?(WF$&U9wV zZmU1Ap=pH%Ll6=Jilo0FK*TgOKEM(P4`0EkC?HZ3d_x6XoXi>J=9 z*(NSk0!?Okm>tM!5ZaS54WVte@+CB3XIB6_x(NgPW-%(X7O!U~8r z`D-z^szZ#kQ-nlO4CWN?$|2W1_3`J5-lBNiT5h+eAb6}Ytj-u&uNUZlP%fv!& zE<9qInn;p~M8ckM*i}7D(t;q66hkr$fe?hz7B@kXh#T{=3?67mx}uqi8pkX~5L8=D z7mk#srx4R}v~eSoCX_HT2{e+nQ`VHSK)?U~&{!;oHq5GZC`v}}U5SlAn+C~xXsE5a z1gqA;xH&HyOpBkuVBlh}%F|I;Bq&-8uxOss~gx znk`gqHX_C#9Ja7giOXujSY#>641gYBLKkjTji5Mm1ZY-tI7LQSOri2oX{aChKn5nr z1Jg7?2?11Mbd+(6DS8B~%1WqhG*G`^^u-Mm#3ktSxNs!Ot|+p|J1A$6=VSuVAwW0) zD-eL_;ld@$4N%52&B|TUJh};`X%i8MNblp4 zG|W&#W&-H2B8*D%uP!9-CEft*?k}AMfMbKagK!G6fP8@*!Uq`#!OFB#3bMSjOy;vw z|6inM(kewjJPgqnmc;-2WJYKAf7Idb3vhIGVC+=>*C0LUj>(YLhc)dm@=o)OxI6%p zW;JMox{)bnB?ym{bp)5f)PNW={jab0b3 zu^w}q8hXiXi!hEVrK3%6Qpa?(;})#tm#)6{o&OkBylhSJWV7?YnHkO7%ni(# zp5lh)aSai4VLFB%oKxNX(5|sZ#tm=XcjD@*8;8F+*LvZ^tYdGq_Qsm`m#%-ehdx^8 zoj6$3x2Nz@dFfbw=)~qnyZ76wKUv_87BoNqXUCh<&)aq%^2HYv4s`B%?9-Abe^|Mu zalH5Nu}v*UPF@(;@$t_U#gnygm*Ym!&MSXBP(Jbcgu!n&UAr))v(*pPO}ZqV?)B`8Rq9v2xX^a;^88oFB*(61j4t1SqJb?fbq_Q8bAz9)zS%Ql zIBBgYX8Y{k!nb5<&x-T5 zxxJ@}?Jvx{<$q^d-{uyurlkMbZsO|_pY8066-^(y+P_*bcyWjG;PH!pmDc^jAD-_l zEgaZ-W`pBx&bjwuf9?1)4SC1ehRvU!yLEHMPg@@8+_ZPm@9O1Uk()%IpzrB|z8eLz XPnN&GW7S6;*1s2DRgLFBWpl^hc0d-E literal 0 HcmV?d00001 diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs new file mode 100644 index 00000000000..8ae45df8295 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using ManagedCommon; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; +using Wox.Plugin; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone +{ + public class Main : IPlugin, IPluginI18n, IDisposable + { + /// + /// The name of this assembly + /// + private readonly string _assemblyName; + + /// + /// The initial context for this plugin (contains API and meta-data) + /// + private PluginInitContext? _context; + + /// + /// The path to the icon for each result + /// + private string _defaultIconPath; + + /// + /// Indicate that the plugin is disposed + /// + private bool _disposed; + + public string Name => Resources.PluginTitle; + + public string Description => Resources.PluginDescription; + + /// + /// Initializes a new instance of the class. + /// + public Main() + { + _assemblyName = Assembly.GetExecutingAssembly().GetName().Name ?? GetTranslatedPluginTitle(); + _defaultIconPath = "Images/reg.light.png"; + } + + /// + /// Initialize the plugin with the given + /// + /// The for this plugin + public void Init(PluginInitContext context) + { + _context = context ?? throw new ArgumentNullException(nameof(context)); + _context.API.ThemeChanged += OnThemeChanged; + UpdateIconPath(_context.API.GetCurrentTheme()); + } + + /// + /// Return a filtered list, based on the given query + /// + /// The query to filter the list + /// A filtered list, can be empty when nothing was found + public List Query(Query query) + { + if (query is null) + { + return new List(0); + } + + var timeZones = TimeZoneInfo.GetSystemTimeZones(); + var results = new List(timeZones.Count); + var utcNow = DateTime.UtcNow; + + foreach (var timeZone in timeZones) + { + if (!timeZone.DaylightName.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase) + && !timeZone.DaylightName.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) + { + continue; + } + + var title = timeZone.SupportsDaylightSavingTime && timeZone.IsDaylightSavingTime(utcNow) + ? timeZone.DaylightName + : timeZone.StandardName; + + var timeInTimeZone = TimeZoneInfo.ConvertTime(utcNow, timeZone); + + var result = new Result + { + Title = title, + SubTitle = $"Time: {timeInTimeZone:HH:mm:ss}", + ToolTipData = new ToolTipData(title, $"Offset: {timeZone.BaseUtcOffset}"), + }; + + results.Add(result); + } + + return results.OrderBy(result => result.Title).ToList(); + } + + /// + /// Change all theme-based elements (typical called when the plugin theme has changed) + /// + /// The old + /// The new + private void OnThemeChanged(Theme oldtheme, Theme newTheme) + { + UpdateIconPath(newTheme); + } + + /// + /// Update all icons (typical called when the plugin theme has changed) + /// + /// The new for the icons + private void UpdateIconPath(Theme theme) + { + _defaultIconPath = theme == Theme.Light || theme == Theme.HighContrastWhite + ? "Images/reg.light.png" + : "Images/reg.dark.png"; + } + + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Wrapper method for that dispose additional objects and events form the plugin itself + /// + /// Indicate that the plugin is disposed + protected virtual void Dispose(bool disposing) + { + if (_disposed || !disposing) + { + return; + } + + if (!(_context is null)) + { + _context.API.ThemeChanged -= OnThemeChanged; + } + + _disposed = true; + } + + /// + public string GetTranslatedPluginTitle() + { + return Resources.PluginTitle; + } + + /// + public string GetTranslatedPluginDescription() + { + return Resources.PluginDescription; + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj new file mode 100644 index 00000000000..2b72cf23789 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj @@ -0,0 +1,115 @@ + + + + netcoreapp3.1 + Microsoft.PowerToys.Run.Plugin.TimeZone + Microsoft.PowerToys.Run.Plugin.TimeZone + $(Version).0 + false + false + x64 + en-US + 8.0 + enable + + + + true + ..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeZone\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + 4 + false + true + + + + ..\..\..\..\..\x64\Release\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeZone\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + 4 + true + + + + + + + + + + + GlobalSuppressions.cs + + + StyleCop.json + + + + + + false + + + false + + + + + + PreserveNewest + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + True + True + Resources.resx + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + PreserveNewest + + + PreserveNewest + + + + diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs new file mode 100644 index 00000000000..1290444649c --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -0,0 +1,81 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.PowerToys.Run.Plugin.TimeZone.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Gets the the current time of a time zone. + /// + internal static string PluginDescription { + get { + return ResourceManager.GetString("PluginDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Time zone. + /// + internal static string PluginTitle { + get { + return ResourceManager.GetString("PluginTitle", resourceCulture); + } + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx new file mode 100644 index 00000000000..ea7bcbcb0a2 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Gets the the current time of a time zone + + + Time zone + + \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json new file mode 100644 index 00000000000..3c3fdaec5ea --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json @@ -0,0 +1,13 @@ +{ + "ID": "BADD1B06EF0A4B61AD95395F24241D69", + "ActionKeyword": "&", + "IsGlobal": false, + "Name": "TimeZone", + "Author": "TobiasSekan", + "Version": "1.0.0", + "Language": "csharp", + "Website": "https://aka.ms/powertoys", + "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.TimeZone.dll", + "IcoPathDark": "Images\\reg.dark.png", + "IcoPathLight": "Images\\reg.light.png" +} From d8e5c018575658ca8499ad665ee9e6264e24b843 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Mon, 24 May 2021 13:45:01 +0200 Subject: [PATCH 02/67] Translations, better search results, copy to clipboard, cleanup --- .../Helper/ContextMenuHelper.cs | 87 ++++++++++ .../Helper/ResultHelper.cs | 154 ++++++++++++++++++ .../Main.cs | 42 ++--- .../Properties/Resources.Designer.cs | 54 ++++++ .../Properties/Resources.resx | 18 ++ 5 files changed, 326 insertions(+), 29 deletions(-) create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ContextMenuHelper.cs create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ContextMenuHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ContextMenuHelper.cs new file mode 100644 index 00000000000..6d2444cf6f5 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ContextMenuHelper.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Input; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; +using Wox.Plugin; +using Wox.Plugin.Logger; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper +{ + /// + /// Helper class to easier work with context menu entries + /// + internal static class ContextMenuHelper + { + /// + /// Return a list with all context menu entries for the given + /// Symbols taken from + /// + /// The result for the context menu entires + /// The name of the this assembly + /// A list with context menu entries + internal static List GetContextMenu(Result result, string assemblyName) + { + if (!(result?.ContextData is TimeZoneInfo timeZoneInfo)) + { + return new List(0); + } + + var list = new List + { + new ContextMenuResult + { + AcceleratorKey = Key.C, + AcceleratorModifiers = ModifierKeys.Control, + Action = _ => TryToCopyToClipBoard(GetTimeInTimeZone(timeZoneInfo)), + FontFamily = "Segoe MDL2 Assets", + Glyph = "\xE8C8", // E8C8 => Symbol: Copy + PluginName = assemblyName, + Title = $"{Resources.CopyTime} (Ctrl+C)", + }, + }; + + return list; + } + + /// + /// Return a human readable time of the current time in the given . + /// + /// The to calculate the current time in it. + /// A human readable time. + private static string GetTimeInTimeZone(TimeZoneInfo timeZoneInfo) + { + var timeInTimeZone = TimeZoneInfo.ConvertTime(DateTime.UtcNow, timeZoneInfo); + var stringToCopy = $"{timeInTimeZone:HH:mm:ss}"; + return stringToCopy; + } + + #pragma warning disable CA1031 // Do not catch general exception types + + /// + /// Copy the given text to the clipboard + /// + /// The text to copy to the clipboard + /// The text successful copy to the clipboard, otherwise + private static bool TryToCopyToClipBoard(in string text) + { + try + { + Clipboard.Clear(); + Clipboard.SetText(text); + return true; + } + catch (Exception exception) + { + Log.Exception("Can't copy to clipboard", exception, typeof(Main)); + return false; + } + } + + #pragma warning restore CA1031 // Do not catch general exception types + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs new file mode 100644 index 00000000000..fe2f8f01a40 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; +using Mono.Collections.Generic; +using Wox.Plugin; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper +{ + /// + /// Helper class to easier work with results + /// + internal static class ResultHelper + { + /// + /// Return a list of s based on the given . + /// + /// The to filter the . + /// A list with s. + internal static IEnumerable GetResults(Query query, string iconPath) + { + var searchFor = GetSerchString(query); + var timeZoneInfos = TimeZoneInfo.GetSystemTimeZones(); + var results = new Collection(); + var utcNow = DateTime.UtcNow; + + foreach (var timeZoneInfo in timeZoneInfos) + { + if (TimeZoneInfoMatchQuery(timeZoneInfo, searchFor)) + { + var result = GetResult(timeZoneInfo, utcNow, iconPath); + results.Add(result); + } + } + + var orderResults = results.OrderBy(result => result.Title); + return orderResults; + } + + /// + /// Return the string to search, based on the given . + /// + /// The that contain the string to search. + /// A string for a search. + private static string GetSerchString(Query query) + { + var secondChar = query.Search.ElementAtOrDefault(1); + + if (secondChar == '0') + { + return query.Search; + } + + if (!char.IsDigit(secondChar)) + { + return query.Search; + } + + // Allow the user to direct search for "+9", instead of "+09". + var searchFor = query.Search; + + if (query.Search.StartsWith('+')) + { + searchFor = "+0" + query.Search.Substring(1); + } + + if (query.Search.StartsWith('-')) + { + searchFor = "-0" + query.Search.Substring(1); + } + + return searchFor; + } + + /// + /// Check if the given contains a value that match the given . + /// + /// The to check. + /// The that should match. + /// if it's match, otherwise . + private static bool TimeZoneInfoMatchQuery(TimeZoneInfo timeZoneInfo, string searchFor) + { + if (timeZoneInfo.DisplayName.Contains(searchFor, StringComparison.InvariantCultureIgnoreCase)) + { + return true; + } + + if (timeZoneInfo.StandardName.Contains(searchFor, StringComparison.InvariantCultureIgnoreCase)) + { + return true; + } + + if (timeZoneInfo.DaylightName.Contains(searchFor, StringComparison.InvariantCultureIgnoreCase)) + { + return true; + } + + return false; + } + + /// + /// Return a based on the given . + /// + /// The that contain the information for the . + /// The current time in UTC for the . + /// A . + private static Result GetResult(TimeZoneInfo timeZoneInfo, DateTime utcNow, string iconPath) + { + var title = GetTitle(timeZoneInfo, utcNow); + var timeInTimeZone = TimeZoneInfo.ConvertTime(utcNow, timeZoneInfo); + + var toolTip = $"{Resources.StandardName}: {timeZoneInfo.StandardName}" + + $"{Environment.NewLine}{Resources.DaylightName}: {timeZoneInfo.DaylightName}" + + $"{Environment.NewLine}{Resources.DisplayName}: {timeZoneInfo.DisplayName}" + + $"{Environment.NewLine}{Resources.Offset}: {timeZoneInfo.BaseUtcOffset}"; + + var result = new Result + { + ContextData = timeZoneInfo, + IcoPath = iconPath, + SubTitle = $"{Resources.CurrentTime}: {timeInTimeZone:HH:mm:ss}", + Title = title, + ToolTipData = new ToolTipData(title, toolTip), + }; + + return result; + } + + /// + /// Return the title for a and + /// + /// The for the title. + /// The current time in UTC, only need for time zones that support daylight time. + /// A title for a or . + private static string GetTitle(TimeZoneInfo timeZoneInfo, DateTime utcNow) + { + if (!timeZoneInfo.SupportsDaylightSavingTime) + { + return timeZoneInfo.StandardName; + } + + if (!timeZoneInfo.IsDaylightSavingTime(utcNow)) + { + return timeZoneInfo.StandardName; + } + + return timeZoneInfo.DaylightName; + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index 8ae45df8295..fd6024557c9 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -7,12 +7,13 @@ using System.Linq; using System.Reflection; using ManagedCommon; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Helper; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Wox.Plugin; namespace Microsoft.PowerToys.Run.Plugin.TimeZone { - public class Main : IPlugin, IPluginI18n, IDisposable + public class Main : IPlugin, IContextMenu, IPluginI18n, IDisposable { /// /// The name of this assembly @@ -70,35 +71,18 @@ public List Query(Query query) return new List(0); } - var timeZones = TimeZoneInfo.GetSystemTimeZones(); - var results = new List(timeZones.Count); - var utcNow = DateTime.UtcNow; - - foreach (var timeZone in timeZones) - { - if (!timeZone.DaylightName.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase) - && !timeZone.DaylightName.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) - { - continue; - } - - var title = timeZone.SupportsDaylightSavingTime && timeZone.IsDaylightSavingTime(utcNow) - ? timeZone.DaylightName - : timeZone.StandardName; - - var timeInTimeZone = TimeZoneInfo.ConvertTime(utcNow, timeZone); - - var result = new Result - { - Title = title, - SubTitle = $"Time: {timeInTimeZone:HH:mm:ss}", - ToolTipData = new ToolTipData(title, $"Offset: {timeZone.BaseUtcOffset}"), - }; - - results.Add(result); - } + var results = ResultHelper.GetResults(query, _defaultIconPath).ToList(); + return results; + } - return results.OrderBy(result => result.Title).ToList(); + /// + /// Return a list context menu entries for a given (shown at the right side of the result) + /// + /// The for the list with context menu entries + /// A list context menu entries + public List LoadContextMenus(Result selectedResult) + { + return ContextMenuHelper.GetContextMenu(selectedResult, _assemblyName); } /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 1290444649c..e5ef3e7281f 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -60,6 +60,51 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Copy time. + /// + internal static string CopyTime { + get { + return ResourceManager.GetString("CopyTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Current time. + /// + internal static string CurrentTime { + get { + return ResourceManager.GetString("CurrentTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Daylight name. + /// + internal static string DaylightName { + get { + return ResourceManager.GetString("DaylightName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Display name. + /// + internal static string DisplayName { + get { + return ResourceManager.GetString("DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Offset. + /// + internal static string Offset { + get { + return ResourceManager.GetString("Offset", resourceCulture); + } + } + /// /// Looks up a localized string similar to Gets the the current time of a time zone. /// @@ -77,5 +122,14 @@ internal static string PluginTitle { return ResourceManager.GetString("PluginTitle", resourceCulture); } } + + /// + /// Looks up a localized string similar to Standard name. + /// + internal static string StandardName { + get { + return ResourceManager.GetString("StandardName", resourceCulture); + } + } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index ea7bcbcb0a2..8cf83bfe9d5 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -117,10 +117,28 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Copy time + + + Current time + + + Daylight name + + + Display name + + + Offset + Gets the the current time of a time zone Time zone + + Standard name + \ No newline at end of file From 8715d9924c912c3f15fa819377f7b226c815ab62 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Mon, 24 May 2021 13:59:09 +0200 Subject: [PATCH 03/67] fix typo --- .../Helper/ResultHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index fe2f8f01a40..b588e4fd1a3 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -23,7 +23,7 @@ internal static class ResultHelper /// A list with s. internal static IEnumerable GetResults(Query query, string iconPath) { - var searchFor = GetSerchString(query); + var searchFor = GetSearchString(query); var timeZoneInfos = TimeZoneInfo.GetSystemTimeZones(); var results = new Collection(); var utcNow = DateTime.UtcNow; @@ -46,7 +46,7 @@ internal static IEnumerable GetResults(Query query, string iconPath) /// /// The that contain the string to search. /// A string for a search. - private static string GetSerchString(Query query) + private static string GetSearchString(Query query) { var secondChar = query.Search.ElementAtOrDefault(1); From 5db4b2d644f5201977903489e7e398ef973062ef Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Sat, 29 May 2021 14:43:54 +0200 Subject: [PATCH 04/67] Add shortcut search and prepare JSON for later usage --- .../Classes/TimeZoneInfoExtended.cs | 252 ++++++++++++++++++ .../Helper/ResultHelper.cs | 139 ++++++---- .../Main.cs | 9 +- 3 files changed, 337 insertions(+), 63 deletions(-) create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs new file mode 100644 index 00000000000..b3e0dab2c7d --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Security; +using System.Text; +using Wox.Plugin.Logger; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone +{ + /// + /// A extended version of + /// with additional fields to easier find a timezone. + /// + internal sealed class TimeZoneInfoExtended + { + /// + /// The underling of this . + /// + private TimeZoneInfo? _underlyingTimeZone; + + /// + /// Initializes a new instance of the class. + /// + public TimeZoneInfoExtended() + { + DisplayName = string.Empty; + StandardName = string.Empty; + DaylightName = string.Empty; + Id = string.Empty; + Offset = string.Empty; + StandardShortcut = string.Empty; + DaylightShortcut = string.Empty; + } + + // TODO: Remove after JSON is used + internal TimeZoneInfoExtended(TimeZoneInfo timeZone) + { + Id = timeZone.Id; + + Offset = $"{timeZone.BaseUtcOffset:hh\\:mm}"; + + if (Offset.StartsWith("0", StringComparison.InvariantCultureIgnoreCase)) + { + Offset = Offset.Substring(1); + } + + if (!Offset.StartsWith("+", StringComparison.InvariantCultureIgnoreCase)) + { + Offset = $"+{Offset}"; + } + + StandardName = timeZone.StandardName; + StandardShortcut = GetShortcut(StandardName); + DisplayName = timeZone.DisplayName; + + if (!timeZone.SupportsDaylightSavingTime) + { + DaylightName = timeZone.DaylightName; + DaylightShortcut = GetShortcut(DaylightName); + } + } + + // TODO: Remove after JSON is used + private static string? GetShortcut(string name) + { + if (name.StartsWith("UTC", StringComparison.InvariantCultureIgnoreCase)) + { + return null; + } + + var result = new StringBuilder(); + + foreach (var ch in name) + { + if (ch >= 'A' && ch <= 'Z') + { + result.Append(ch); + } + } + + if (result.Length == 0) + { + return null; + } + + return result.ToString(); + } + + /// + /// Gets or sets the general display name that represents the time zone. + /// + internal string DisplayName { get; set; } + + /// + /// Gets or sets the search-able time difference between the current time zone's standard time and Coordinated Universal Time (UTC). + /// + public string Offset { get; set; } + + /// + /// Gets or sets the time zone identifier. + /// + public string Id { get; set; } + + /// + /// Gets or sets the display name for the time zone's standard time. + /// + public string StandardName { get; set; } + + /// + /// Gets or sets the shortcut of the display name for the time zone's standard time. + /// + public string? StandardShortcut { get; set; } + + /// + /// Gets or sets the display name for the current time zone's daylight saving time. + /// + public string? DaylightName { get; set; } + + /// + /// Gets or sets the shortcut of the display name for the current time zone's daylight saving time. + /// + public string? DaylightShortcut { get; set; } + + /// + /// Indicates whether a specified date and time falls in the range of daylight saving + /// time for the time zone of the current System.TimeZoneInfo object. + /// + /// A date and time value. + /// if the dateTime parameter is a daylight saving time; otherwise, . + internal bool IsDaylightSavingTime(DateTime dateTime) + { + var result = false; + + FindTimeZone(); + if (_underlyingTimeZone is null) + { + return result; + } + + if (!_underlyingTimeZone.SupportsDaylightSavingTime) + { + return result; + } + + try + { + result = _underlyingTimeZone.IsDaylightSavingTime(dateTime); + } + catch (ArgumentException exception) + { + Log.Exception( + "The System.DateTime.Kind property of the dateTime value is System.DateTimeKind.Local and dateTime is an invalid time.", + exception, + typeof(TimeZoneInfoExtended)); + } + + return result; + } + + /// + /// Converts a time to the time in a particular time zone. + /// + /// The date and time to convert. + /// The date and time in this time zone. + internal DateTime ConvertTime(DateTime dateTime) + { + var result = DateTime.MinValue; + + FindTimeZone(); + if (_underlyingTimeZone is null) + { + return result; + } + + try + { + result = TimeZoneInfo.ConvertTime(dateTime, _underlyingTimeZone); + } + catch (ArgumentNullException exception) + { + Log.Exception( + "The value of the destinationTimeZone parameter is null.", + exception, + typeof(TimeZoneInfoExtended)); + } + catch (ArgumentException exception) + { + Log.Exception( + "The value of the dateTime parameter represents an invalid time.", + exception, + typeof(TimeZoneInfoExtended)); + } + + return result; + } + + /// + /// Try to find a that have the same + /// The is need for the time calculation. + /// + internal void FindTimeZone() + { + if (_underlyingTimeZone is null) + { + try + { + _underlyingTimeZone = TimeZoneInfo.FindSystemTimeZoneById(Id); + } + catch (OutOfMemoryException exception) + { + Log.Exception( + "The system does not have enough memory to hold information about the time zone.", + exception, + typeof(TimeZoneInfoExtended)); + } + catch (ArgumentNullException exception) + { + Log.Exception( + "The id parameter is null.", + exception, + typeof(TimeZoneInfoExtended)); + } + catch (TimeZoneNotFoundException exception) + { + Log.Exception( + "The time zone identifier specified by id was not found." + + " This means that a time zone identifier whose name matches id does not exist," + + " or that the identifier exists but does not contain any time zone data.", + exception, + typeof(TimeZoneInfoExtended)); + } + catch (SecurityException exception) + { + Log.Exception( + "The process does not have the permissions required to read from the registry key" + + " that contains the time zone information.", + exception, + typeof(TimeZoneInfoExtended)); + } + catch (InvalidTimeZoneException exception) + { + Log.Exception( + "The time zone identifier was found, but the registry data is corrupted.", + exception, + typeof(TimeZoneInfoExtended)); + } + } + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index b588e4fd1a3..3410d6566ae 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -4,10 +4,14 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Mono.Collections.Generic; using Wox.Plugin; +using Wox.Plugin.Logger; namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { @@ -16,6 +20,22 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper /// internal static class ResultHelper { + private static IEnumerable _allTimeZones = Enumerable.Empty(); + + internal static void CollectAllTimeZones() + { + // TODO: remove after JSON + var timeZoneInfos = TimeZoneInfo.GetSystemTimeZones(); + var allTimeZones = new List(); + foreach (var timeZone in timeZoneInfos) + { + var extendedTiemZone = new TimeZoneInfoExtended(timeZone); + allTimeZones.Add(extendedTiemZone); + } + + _allTimeZones = allTimeZones; + } + /// /// Return a list of s based on the given . /// @@ -23,16 +43,14 @@ internal static class ResultHelper /// A list with s. internal static IEnumerable GetResults(Query query, string iconPath) { - var searchFor = GetSearchString(query); - var timeZoneInfos = TimeZoneInfo.GetSystemTimeZones(); var results = new Collection(); var utcNow = DateTime.UtcNow; - foreach (var timeZoneInfo in timeZoneInfos) + foreach (var timeZone in _allTimeZones) { - if (TimeZoneInfoMatchQuery(timeZoneInfo, searchFor)) + if (TimeZoneInfoMatchQuery(timeZone, query)) { - var result = GetResult(timeZoneInfo, utcNow, iconPath); + var result = GetResult(timeZone, utcNow, iconPath); results.Add(result); } } @@ -42,59 +60,37 @@ internal static IEnumerable GetResults(Query query, string iconPath) } /// - /// Return the string to search, based on the given . + /// Check if the given contains a value that match the given . /// - /// The that contain the string to search. - /// A string for a search. - private static string GetSearchString(Query query) + /// The to check. + /// The that should match. + /// if it's match, otherwise . + private static bool TimeZoneInfoMatchQuery(TimeZoneInfoExtended timeZone, Query query) { - var secondChar = query.Search.ElementAtOrDefault(1); - - if (secondChar == '0') + if (timeZone.Offset.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) { - return query.Search; - } - - if (!char.IsDigit(secondChar)) - { - return query.Search; - } - - // Allow the user to direct search for "+9", instead of "+09". - var searchFor = query.Search; - - if (query.Search.StartsWith('+')) - { - searchFor = "+0" + query.Search.Substring(1); + return true; } - if (query.Search.StartsWith('-')) + if (timeZone.StandardName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) { - searchFor = "-0" + query.Search.Substring(1); + return true; } - return searchFor; - } - - /// - /// Check if the given contains a value that match the given . - /// - /// The to check. - /// The that should match. - /// if it's match, otherwise . - private static bool TimeZoneInfoMatchQuery(TimeZoneInfo timeZoneInfo, string searchFor) - { - if (timeZoneInfo.DisplayName.Contains(searchFor, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.StandardShortcut != null + && timeZone.StandardShortcut.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) { return true; } - if (timeZoneInfo.StandardName.Contains(searchFor, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.DaylightName != null + && timeZone.DaylightName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) { return true; } - if (timeZoneInfo.DaylightName.Contains(searchFor, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.DaylightShortcut != null + && timeZone.DaylightShortcut.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -103,24 +99,24 @@ private static bool TimeZoneInfoMatchQuery(TimeZoneInfo timeZoneInfo, string sea } /// - /// Return a based on the given . + /// Return a based on the given . /// - /// The that contain the information for the . + /// The that contain the information for the . /// The current time in UTC for the . /// A . - private static Result GetResult(TimeZoneInfo timeZoneInfo, DateTime utcNow, string iconPath) + private static Result GetResult(TimeZoneInfoExtended timeZone, DateTime utcNow, string iconPath) { - var title = GetTitle(timeZoneInfo, utcNow); - var timeInTimeZone = TimeZoneInfo.ConvertTime(utcNow, timeZoneInfo); + var title = GetTitle(timeZone, utcNow); + var timeInTimeZone = timeZone.ConvertTime(utcNow); - var toolTip = $"{Resources.StandardName}: {timeZoneInfo.StandardName}" - + $"{Environment.NewLine}{Resources.DaylightName}: {timeZoneInfo.DaylightName}" - + $"{Environment.NewLine}{Resources.DisplayName}: {timeZoneInfo.DisplayName}" - + $"{Environment.NewLine}{Resources.Offset}: {timeZoneInfo.BaseUtcOffset}"; + var toolTip = $"{Resources.StandardName}: {timeZone.StandardName}" + + $"{Environment.NewLine}{Resources.DaylightName}: {timeZone.DaylightName}" + + $"{Environment.NewLine}{Resources.DisplayName}: {timeZone.DisplayName}" + + $"{Environment.NewLine}{Resources.Offset}: {timeZone.Offset}"; var result = new Result { - ContextData = timeZoneInfo, + ContextData = timeZone, IcoPath = iconPath, SubTitle = $"{Resources.CurrentTime}: {timeInTimeZone:HH:mm:ss}", Title = title, @@ -133,22 +129,47 @@ private static Result GetResult(TimeZoneInfo timeZoneInfo, DateTime utcNow, stri /// /// Return the title for a and /// - /// The for the title. + /// The for the title. /// The current time in UTC, only need for time zones that support daylight time. /// A title for a or . - private static string GetTitle(TimeZoneInfo timeZoneInfo, DateTime utcNow) + private static string GetTitle(TimeZoneInfoExtended timeZone, DateTime utcNow) { - if (!timeZoneInfo.SupportsDaylightSavingTime) + if (string.IsNullOrEmpty(timeZone.DaylightName)) { - return timeZoneInfo.StandardName; + return timeZone.StandardName; } - if (!timeZoneInfo.IsDaylightSavingTime(utcNow)) + if (!timeZone.IsDaylightSavingTime(utcNow)) { - return timeZoneInfo.StandardName; + return timeZone.StandardName; } - return timeZoneInfo.DaylightName; + return timeZone.DaylightName; + } + + // TODO: Remove after JSON is used + internal static void SaveJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + }; + + try + { + using var fileStream = File.Create("D:\\timezones.json"); + using var streamWriter = new StreamWriter(fileStream); + + var json = JsonSerializer.Serialize(_allTimeZones, options); + streamWriter.WriteLine(json); + } +#pragma warning disable CA1031 // Do not catch general exception types + catch (Exception exception) +#pragma warning restore CA1031 // Do not catch general exception types + { + Log.Exception("uh", exception, typeof(Main)); + } } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index fd6024557c9..6c381fada12 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -46,12 +46,13 @@ public Main() { _assemblyName = Assembly.GetExecutingAssembly().GetName().Name ?? GetTranslatedPluginTitle(); _defaultIconPath = "Images/reg.light.png"; + ResultHelper.CollectAllTimeZones(); } - /// - /// Initialize the plugin with the given - /// - /// The for this plugin +/// +/// Initialize the plugin with the given +/// +/// The for this plugin public void Init(PluginInitContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); From b96e83e0ebb9a204d742b9a49c51ca816dc63b98 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Sun, 30 May 2021 09:24:36 +0200 Subject: [PATCH 05/67] Fix typo --- .../Classes/TimeZoneInfoExtended.cs | 2 +- .../Helper/ResultHelper.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs index b3e0dab2c7d..fe745dda053 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs @@ -11,7 +11,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone { /// /// A extended version of - /// with additional fields to easier find a timezone. + /// with additional fields to easier find a time zone. /// internal sealed class TimeZoneInfoExtended { diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 3410d6566ae..505225b337a 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -29,8 +29,8 @@ internal static void CollectAllTimeZones() var allTimeZones = new List(); foreach (var timeZone in timeZoneInfos) { - var extendedTiemZone = new TimeZoneInfoExtended(timeZone); - allTimeZones.Add(extendedTiemZone); + var extendedTimeZone = new TimeZoneInfoExtended(timeZone); + allTimeZones.Add(extendedTimeZone); } _allTimeZones = allTimeZones; @@ -158,7 +158,7 @@ internal static void SaveJson() try { - using var fileStream = File.Create("D:\\timezones.json"); + using var fileStream = File.Create("D:\\TimeZones.json"); using var streamWriter = new StreamWriter(fileStream); var json = JsonSerializer.Serialize(_allTimeZones, options); From b09843b69fe460971e698023c3fe66f2a889c342 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 20 Oct 2021 15:08:50 +0200 Subject: [PATCH 06/67] Use timezone Data only from JSON --- PowerToys.sln | 15 +- .../Classes/TimeZone.cs | 30 + .../Classes/TimeZoneList.cs | 19 + .../Helper/ResultHelper.cs | 119 +-- .../Main.cs | 36 +- .../timezone.schema.json | 44 + .../timezones.json | 799 ++++++++++++++++++ 7 files changed, 974 insertions(+), 88 deletions(-) create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZone.cs create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezone.schema.json create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json diff --git a/PowerToys.sln b/PowerToys.sln index 4841c15ef7d..d57774572b8 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.452 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31815.197 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runner", "src\runner\runner.vcxproj", "{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}" ProjectSection(ProjectDependencies) = postProject @@ -920,6 +920,14 @@ Global {2EDB3EB4-FA92-4BFF-B2D8-566584837231}.Release|x64.ActiveCfg = Release|x64 {2EDB3EB4-FA92-4BFF-B2D8-566584837231}.Release|x64.Build.0 = Release|x64 {2EDB3EB4-FA92-4BFF-B2D8-566584837231}.Release|x86.ActiveCfg = Release|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x64.ActiveCfg = Debug|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x64.Build.0 = Debug|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x86.ActiveCfg = Debug|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x86.Build.0 = Debug|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.ActiveCfg = Release|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.Build.0 = Release|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x86.ActiveCfg = Release|x64 + {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x86.Build.0 = Release|x64 {48804216-2A0E-4168-A6D8-9CD068D14227}.Debug|x64.ActiveCfg = Debug|x64 {48804216-2A0E-4168-A6D8-9CD068D14227}.Debug|x64.Build.0 = Debug|x64 {48804216-2A0E-4168-A6D8-9CD068D14227}.Debug|x86.ActiveCfg = Debug|x64 @@ -1057,6 +1065,7 @@ Global {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x64.ActiveCfg = Release|x64 {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x64.Build.0 = Release|x64 {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x86.ActiveCfg = Release|x64 +<<<<<<< HEAD <<<<<<< HEAD {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x64.ActiveCfg = Debug|x64 {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x64.Build.0 = Debug|x64 @@ -1088,6 +1097,8 @@ Global {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.ActiveCfg = Release|x64 {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.Build.0 = Release|x64 >>>>>>> f5e943784 (Initial commit - simple idea for a time zone plugin) +======= +>>>>>>> 6811ff503 (Use timezone Data only from JSON) EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZone.cs new file mode 100644 index 00000000000..2473d73ec91 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZone.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Classes +{ + public sealed class TimeZone + { + public TimeZone() + { + Offset = "0:00"; + Name = string.Empty; + Shortcut = string.Empty; + Countries = Enumerable.Empty(); + } + + public string Offset { get; set; } + + public string Shortcut { get; set; } + + public bool DaylightSavingTime { get; set; } + + public string Name { get; set; } + + public IEnumerable Countries { get; set; } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs new file mode 100644 index 00000000000..7ff5f90b8b7 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Classes +{ + public sealed class TimeZoneList + { + public TimeZoneList() + { + TimeZones = Enumerable.Empty(); + } + + public IEnumerable TimeZones { get; set; } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 505225b337a..e014bc9133a 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -4,14 +4,12 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Text.Json; -using System.Text.Json.Serialization; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Mono.Collections.Generic; using Wox.Plugin; -using Wox.Plugin.Logger; namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { @@ -20,35 +18,19 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper /// internal static class ResultHelper { - private static IEnumerable _allTimeZones = Enumerable.Empty(); - - internal static void CollectAllTimeZones() - { - // TODO: remove after JSON - var timeZoneInfos = TimeZoneInfo.GetSystemTimeZones(); - var allTimeZones = new List(); - foreach (var timeZone in timeZoneInfos) - { - var extendedTimeZone = new TimeZoneInfoExtended(timeZone); - allTimeZones.Add(extendedTimeZone); - } - - _allTimeZones = allTimeZones; - } - /// /// Return a list of s based on the given . /// - /// The to filter the . + /// The to filter the . /// A list with s. - internal static IEnumerable GetResults(Query query, string iconPath) + internal static IEnumerable GetResults(IEnumerable timeZones, string search, string iconPath) { var results = new Collection(); var utcNow = DateTime.UtcNow; - foreach (var timeZone in _allTimeZones) + foreach (var timeZone in timeZones) { - if (TimeZoneInfoMatchQuery(timeZone, query)) + if (TimeZoneInfoMatchQuery(timeZone, search)) { var result = GetResult(timeZone, utcNow, iconPath); results.Add(result); @@ -63,34 +45,28 @@ internal static IEnumerable GetResults(Query query, string iconPath) /// Check if the given contains a value that match the given . /// /// The to check. - /// The that should match. + /// The that should match. /// if it's match, otherwise . - private static bool TimeZoneInfoMatchQuery(TimeZoneInfoExtended timeZone, Query query) + private static bool TimeZoneInfoMatchQuery(Classes.TimeZone timeZone, string search) { - if (timeZone.Offset.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) - { - return true; - } - - if (timeZone.StandardName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) + if (timeZone.Offset.Contains(search, StringComparison.InvariantCultureIgnoreCase)) { return true; } - if (timeZone.StandardShortcut != null - && timeZone.StandardShortcut.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.Name.Contains(search, StringComparison.CurrentCultureIgnoreCase)) { return true; } - if (timeZone.DaylightName != null - && timeZone.DaylightName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) + if (timeZone.Shortcut != null + && timeZone.Shortcut.Contains(search, StringComparison.InvariantCultureIgnoreCase)) { return true; } - if (timeZone.DaylightShortcut != null - && timeZone.DaylightShortcut.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.Countries != null + && timeZone.Countries.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) { return true; } @@ -104,21 +80,25 @@ private static bool TimeZoneInfoMatchQuery(TimeZoneInfoExtended timeZone, Query /// The that contain the information for the . /// The current time in UTC for the . /// A . - private static Result GetResult(TimeZoneInfoExtended timeZone, DateTime utcNow, string iconPath) + private static Result GetResult(Classes.TimeZone timeZone, DateTime utcNow, string iconPath) { - var title = GetTitle(timeZone, utcNow); - var timeInTimeZone = timeZone.ConvertTime(utcNow); + // TODO: respect DST on time calculation + // TODO: DST into SubTitle and toolTip + // TODO: add timezones + // TODO: add shortcuts + + var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow); - var toolTip = $"{Resources.StandardName}: {timeZone.StandardName}" - + $"{Environment.NewLine}{Resources.DaylightName}: {timeZone.DaylightName}" - + $"{Environment.NewLine}{Resources.DisplayName}: {timeZone.DisplayName}" - + $"{Environment.NewLine}{Resources.Offset}: {timeZone.Offset}"; + var title = string.IsNullOrWhiteSpace(timeZone.Name) ? timeZone.Offset : timeZone.Name; + + var toolTip = $"{Environment.NewLine}{Resources.StandardName}: {timeZone.Name}" + + $"{Environment.NewLine}{Resources.Offset}: {timeZone.Offset}"; var result = new Result { ContextData = timeZone, IcoPath = iconPath, - SubTitle = $"{Resources.CurrentTime}: {timeInTimeZone:HH:mm:ss}", + SubTitle = $"{Resources.CurrentTime}: {timeInZoneTime:HH:mm:ss}", Title = title, ToolTipData = new ToolTipData(title, toolTip), }; @@ -126,50 +106,35 @@ private static Result GetResult(TimeZoneInfoExtended timeZone, DateTime utcNow, return result; } - /// - /// Return the title for a and - /// - /// The for the title. - /// The current time in UTC, only need for time zones that support daylight time. - /// A title for a or . - private static string GetTitle(TimeZoneInfoExtended timeZone, DateTime utcNow) + private static DateTime GetTimeInTimeZone(Classes.TimeZone timeZone, DateTime utcNow) { - if (string.IsNullOrEmpty(timeZone.DaylightName)) + string offset; + DateTime result; + + if (timeZone.Offset.StartsWith("-", StringComparison.InvariantCultureIgnoreCase)) { - return timeZone.StandardName; + offset = timeZone.Offset.Substring(1); } - - if (!timeZone.IsDaylightSavingTime(utcNow)) + else { - return timeZone.StandardName; + offset = timeZone.Offset; } - return timeZone.DaylightName; - } + var offsetSplit = offset.Split(':'); - // TODO: Remove after JSON is used - internal static void SaveJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - }; + int.TryParse(offsetSplit.FirstOrDefault(), out var hours); + int.TryParse(offsetSplit.LastOrDefault(), out var minutes); - try + if (timeZone.Offset.StartsWith("-", StringComparison.InvariantCultureIgnoreCase)) { - using var fileStream = File.Create("D:\\TimeZones.json"); - using var streamWriter = new StreamWriter(fileStream); - - var json = JsonSerializer.Serialize(_allTimeZones, options); - streamWriter.WriteLine(json); + result = utcNow.AddHours(-hours).AddMinutes(-minutes); } -#pragma warning disable CA1031 // Do not catch general exception types - catch (Exception exception) -#pragma warning restore CA1031 // Do not catch general exception types + else { - Log.Exception("uh", exception, typeof(Main)); + result = utcNow.AddHours(hours).AddMinutes(minutes); } + + return result; } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index 6c381fada12..9676ada6f1b 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Reflection; using ManagedCommon; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; using Microsoft.PowerToys.Run.Plugin.TimeZone.Helper; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Wox.Plugin; @@ -35,9 +36,10 @@ public class Main : IPlugin, IContextMenu, IPluginI18n, IDisposable /// private bool _disposed; - public string Name => Resources.PluginTitle; - - public string Description => Resources.PluginDescription; + /// + /// A class that contain all possible timezones. + /// + private TimeZoneList? _timezones; /// /// Initializes a new instance of the class. @@ -46,18 +48,29 @@ public Main() { _assemblyName = Assembly.GetExecutingAssembly().GetName().Name ?? GetTranslatedPluginTitle(); _defaultIconPath = "Images/reg.light.png"; - ResultHelper.CollectAllTimeZones(); } -/// -/// Initialize the plugin with the given -/// -/// The for this plugin + /// + /// Gets the localized name. + /// + public string Name => Resources.PluginTitle; + + /// + /// Gets the localized description. + /// + public string Description => Resources.PluginDescription; + + /// + /// Initialize the plugin with the given + /// + /// The for this plugin public void Init(PluginInitContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); _context.API.ThemeChanged += OnThemeChanged; UpdateIconPath(_context.API.GetCurrentTheme()); + + _timezones = JsonSettingsListHelper.ReadAllPossibleTimezones(); } /// @@ -67,12 +80,17 @@ public void Init(PluginInitContext context) /// A filtered list, can be empty when nothing was found public List Query(Query query) { + if (_timezones?.TimeZones is null) + { + return new List(0); + } + if (query is null) { return new List(0); } - var results = ResultHelper.GetResults(query, _defaultIconPath).ToList(); + var results = ResultHelper.GetResults(_timezones.TimeZones, query.Search, _defaultIconPath).ToList(); return results; } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezone.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezone.schema.json new file mode 100644 index 00000000000..8b8449094bd --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezone.schema.json @@ -0,0 +1,44 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": + { + "TimeZones": + { + "type": "array", + "items": + { + "type": "object", + "additionalProperties": false, + "properties": + { + "Offset": + { + "type": "string" + }, + "Name": + { + "type": "string" + }, + "Shortcut": + { + "type": "string" + }, + "DaylightSavingTime": + { + "type": "boolean" + }, + "Countries": + { + "type": "array", + "uniqueItems": true, + "items": + { + "type": "string" + } + } + } + } + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json new file mode 100644 index 00000000000..094491ca247 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -0,0 +1,799 @@ +{ + "$schema": "./timezone.schema.json", + "TimeZones": + [ + { + "Offset": "-12:00", + "DaylightSavingTime": false, + "Name": "International Date Line", + "Countries": [ + "Baker Island", + "Howland Island" + ] + }, + { + "Offset": "-11:00", + "DaylightSavingTime": false, + "Countries": [ + "American Samoa", + "Jarvis Island", + "Kingman Reef", + "Midway Atoll", + "Niue", + "Palmyra Atoll" + ] + }, + { + "Offset": "-10:00", + "DaylightSavingTime": false, + "Countries": [ + "Cook Islands", + "French Polynesia (most)", + "Johnston Atoll", + "United States: Hawaii" + ] + }, + { + "Offset": "-10:00", + "DaylightSavingTime": true, + "Countries": [ + "United States: Andreanof Islands", + "United States: Islands of Four Mountains", + "United States: Near Islands", + "United States: Rat Islands (Aleutian Islands, Alaska)" + ] + }, + { + "Offset": "−09:30", + "DaylightSavingTime": false, + "Countries": [ + "French Polynesia: Marquesas Islands" + ] + }, + { + "Offset": "−09:00", + "DaylightSavingTime": false, + "Countries": [ + "French Polynesia: Gambier Islands" + ] + }, + { + "Offset": "−09:00", + "DaylightSavingTime": true, + "Countries": [ + "United States: Alaska (most)" + ] + }, + { + "Offset": "−08:00", + "DaylightSavingTime": false, + "Countries": [ + "Clipperton Island", + "Pitcairn Islands" + ] + }, + { + "Offset": "−08:00", + "DaylightSavingTime": true, + "Countries": [ + "Canada: British Columbia (most)", + "Mexico: Baja California", + "United States: California", + "United States: Idaho (north)", + "United States: Nevada", + "United States: Oregon (most)", + "United States: Washington" + ] + }, + { + "Offset": "−07:00", + "DaylightSavingTime": false, + "Name": "Mountain Time Zone", + "Countries": [ + "Canada: British Columbia (northeast)", + "Canada: Yukon", + "Mexico: Sonora", + "United States: Arizona (most)" + ] + }, + { + "Offset": "−07:00", + "DaylightSavingTime": false, + "Name": "Pacific Time Zone", + "Countries": [ + "Canada: Alberta", + "Canada: British Columbia (southeast)", + "Canada: Northwest Territories", + "Canada: Nunavut (west)", + "Mexico: Baja California Sur", + "Mexico: Chihuahua", + "Mexico: Nayarit (most)", + "Mexico: Sinaloa", + "United States: Colorado", + "United States: Idaho (most)", + "United States: Montana", + "United States: New Mexico", + "United States: Utah", + "United States: Wyoming" + ] + }, + { + "Offset": "−06:00", + "DaylightSavingTime": false, + "Name": "Central Time Zone", + "Countries": [ + "Belize", + "Canada: Saskatchewan (most)", + "Costa Rica", + "Ecuador: Galápagos", + "El Salvador", + "Guatemala", + "Honduras", + "Nicaragua" + ] + }, + { + "Offset": "−06:00", + "DaylightSavingTime": true, + "Name": "Mountain Time Zone", + "Countries": [ + "Canada: Manitoba", + "Canada: Nunavut (central)", + "Canada: Ontario (west)", + "Chile: Easter Island", + "Mexico (most)", + "United States: Alabama", + "United States: Arkansas", + "United States: Illinois", + "United States: Iowa", + "United States: Kansas (most)", + "United States: Louisiana", + "United States: Minnesota", + "United States: Mississippi", + "United States: Missouri", + "United States: Nebraska (most)", + "United States: North Dakota (most)", + "United States: Oklahoma", + "United States: South Dakota (most)", + "United States: Tennessee (most)", + "United States: Texas (most)", + "United States: Wisconsin" + ] + }, + { + "Offset": "−05:00", + "DaylightSavingTime": false, + "Name": "Eastern Time Zone", + "Countries": [ + "Brazil: Acre", + "Canada: Atikokan", + "Canada: Mishkeegogamang", + "Canada: Southampton Island", + "Cayman Islands", + "Colombia", + "Ecuador (most)", + "Jamaica", + "Mexico: Quintana Roo", + "Navassa Island", + "Panama", + "Peru" + ] + }, + { + "Offset": "−05:00", + "DaylightSavingTime": true, + "Name": "Central Time Zone", + "Countries": [ + "Bahamas", + "Canada: Nunavut (east)", + "Canada: Ontario (most)", + "Canada: Quebec (most)", + "Cuba", + "Haiti", + "Turks and Caicos Islands", + "United States: Connecticut", + "United States: Delaware", + "United States: District of Columbia", + "United States: Florida (most)", + "United States: Georgia", + "United States: Indiana (most)", + "United States: Kentucky (most)", + "United States: Maine", + "United States: Maryland", + "United States: Massachusetts", + "United States: Michigan (most)", + "United States: New Hampshire", + "United States: New Jersey", + "United States: New York", + "United States: North Carolina", + "United States: Ohio", + "United States: Pennsylvania", + "United States: Rhode Island", + "United States: South Carolina", + "United States: Vermont", + "United States: Virginia", + "United States: West Virginia" + ] + }, + { + "Offset": "−04:00", + "DaylightSavingTime": false, + "Name": "Atlantic Time Zone", + "Countries": [ + "Anguilla", + "Antigua and Barbuda", + "Aruba", + "Barbados", + "Bolivia", + "Brazil: Amazonas (most)", + "Brazil: Mato Grosso", + "Brazil: Mato Grosso do Sul", + "Brazil: Rondônia", + "Brazil: Roraima", + "British Virgin Islands", + "Canada: Quebec (east)", + "Caribbean Netherlands", + "Curaçao", + "Dominica", + "Dominican Republic", + "Grenada", + "Guadeloupe", + "Guyana", + "Martinique", + "Montserrat", + "Puerto Rico", + "Saint Barthélemy", + "Saint Kitts and Nevis", + "Saint Lucia", + "Saint Martin", + "Saint Vincent and the Grenadines", + "Sint Maarten", + "Trinidad and Tobago", + "U.S. Virgin Islands", + "Venezuela" + ] + }, + { + "Offset": "−04:00", + "DaylightSavingTime": true, + "Name": "Eastern Time Zone", + "Countries": [ + "Bermuda", + "Canada: Labrador (most)", + "Canada: New Brunswick", + "Canada: Nova Scotia", + "Canada: Prince Edward Island", + "Chile (most)", + "Greenland: Thule Air Base", + "Paraguay" + ] + }, + { + "Offset": "−03:30", + "DaylightSavingTime": true, + "Countries": [ + "Canada: Newfoundland", + "Canada: Labrador (southeast)" + ] + }, + { + "Offset": "−03:00", + "DaylightSavingTime": false, + "Countries": [ + "Argentina", + "Brazil (most)", + "Chile: Magallanes", + "Falkland Islands", + "French Guiana", + "Suriname", + "Uruguay" + ] + }, + { + "Offset": "−03:00", + "DaylightSavingTime": true, + "Countries": [ + "Greenland (most)", + "Saint Pierre and Miquelon" + ] + }, + { + "Offset": "−02:00", + "DaylightSavingTime": false, + "Countries": [ + "Brazil: Fernando de Noronha", + "South Georgia and the South Sandwich Islands" + ] + }, + { + "Offset": "−01:00", + "DaylightSavingTime": false, + "Countries": [ + "Cape Verde" + ] + }, + { + "Offset": "−01:00", + "DaylightSavingTime": true, + "Countries": [ + "Greenland: Ittoqqortoormiit", + "Portugal: Azores" + ] + }, + { + "Offset": "00:00", + "DaylightSavingTime": false, + "Countries": [ + "Ascension and Tristan da Cunha", + "Burkina Faso", + "Danmarkshavn", + "Gambia", + "Ghana", + "Guinea-Bissau", + "Guinea", + "Iceland", + "Ivory Coast", + "Liberia", + "Mali", + "Mauritania", + "Saint Helena", + "São Tomé and Príncipe", + "Senegal", + "Sierra Leone", + "Togo" + ] + }, + { + "Offset": "00:00", + "DaylightSavingTime": true, + "Countries": [ + "Canary Islands", + "Faroe Islands", + "Guernsey", + "Ireland", + "Isle of Man", + "Jersey", + "Portugal (most)", + "United Kingdom" + ] + }, + { + "Offset": "01:00", + "DaylightSavingTime": false, + "Countries": [ + "Algeria", + "Angola", + "Benin", + "Cameroon", + "Central African Republic", + "Chad", + "Congo", + "Democratic Republic of the Congo: Équateur", + "Democratic Republic of the Congo: Kinshasa", + "Democratic Republic of the Congo: Kongo Central", + "Democratic Republic of the Congo: Kwango", + "Democratic Republic of the Congo: Kwilu", + "Democratic Republic of the Congo: Mai-Ndombe", + "Democratic Republic of the Congo: Mongala", + "Democratic Republic of the Congo: Nord-Ubangi", + "Democratic Republic of the Congo: Sud-Ubangi", + "Democratic Republic of the Congo: Tshuapa", + "Equatorial Guinea", + "Gabon", + "Morocco", + "Niger", + "Nigeria", + "Tunisia", + "Weste" + ] + }, + { + "Offset": "01:00", + "DaylightSavingTime": true, + "Countries": [ + "Albania", + "Andorra", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Croatia", + "Czech Republic", + "Denmark", + "France (metropolitan)", + "Germany", + "Gibraltar", + "Hungary", + "Italy", + "Kosovo", + "Liechtenstein", + "Luxembourg", + "Malta", + "Monaco", + "Montenegro", + "Netherlands (European)", + "North Macedonia", + "Norway", + "Poland", + "San Marino", + "Serbia", + "Slovakia", + "Slovenia", + "Spain (most)", + "Sweden", + "Switzerland", + "Vatican City" + ] + }, + { + "Offset": "02:00", + "DaylightSavingTime": false, + "Countries": [ + "Botswana", + "Burundi", + "Democratic Republic of the Congo (most)", + "Egypt", + "Eswatini", + "Lesotho", + "Libya", + "Malawi", + "Mozambique", + "Namibia", + "Russia: Kaliningrad", + "Rwanda", + "South Africa (most)", + "South Sudan", + "Sudan", + "Zambia", + "Zimbabwe" + ] + }, + { + "Offset": "02:00", + "DaylightSavingTime": true, + "Countries": [ + "Akrotiri and Dhekelia", + "Bulgaria", + "Cyprus", + "Estonia", + "Finland", + "Greece", + "Israel", + "Jordan", + "Latvia", + "Lebanon", + "Lithuania", + "Moldova", + "Northern Cyprus", + "Palestine", + "Romania", + "Transnistria", + "Syria" + ] + }, + { + "Offset": "03:00", + "DaylightSavingTime": false, + "Countries": [ + "Abkhazia", + "Bahrain", + "Belarus", + "Comoros", + "Crimea", + "Djibouti", + "Donetsk PR", + "Eritrea", + "Ethiopia", + "French Southern and Antarctic Lands: Scattered Islands", + "Iraq", + "Kenya", + "Kuwait", + "Luhansk PR", + "Madagascar", + "Mayotte", + "Qatar", + "Russia (most of European part)", + "Saudi Arabia", + "Somalia", + "Somaliland", + "South Africa: Prince Edward Islands", + "South Ossetia", + "Tanzania", + "Turkey", + "Uganda", + "Yemen" + ] + }, + { + "Offset": "03:30", + "DaylightSavingTime": true, + "Countries": [ + "Iran" + ] + }, + { + "Offset": "04:00", + "DaylightSavingTime": true, + "Countries": [ + "Armenia", + "Artsakh", + "Azerbaijan", + "French Southern and Antarctic Lands: Crozet Islands", + "Georgia", + "Mauritius", + "Oman", + "Russia: Astrakhan", + "Russia: Samara", + "Russia: Saratov", + "Russia: Udmurtia", + "Russia: Ulyanovsk", + "Réunion", + "Seychelles", + "United Arab Emirates" + ] + }, + { + "Offset": "04:30", + "DaylightSavingTime": false, + "Countries": [ + "Afghanistan" + ] + }, + { + "Offset": "05:00", + "DaylightSavingTime": false, + "Countries": [ + "French Southern and Antarctic Lands: Amsterdam Island", + "French Southern and Antarctic Lands: Kerguelen Islands", + "French Southern and Antarctic Lands: Saint Paul Island", + "Heard Island and McDonald Islands", + "Kazakhstan: Aktobe", + "Kazakhstan: Atyrau", + "Kazakhstan: Baikonur", + "Kazakhstan: Kyzylorda", + "Kazakhstan: Mangystau", + "Kazakhstan: West Kazakhstan", + "Maldives", + "Pakistan", + "Russia: Bashkortostan", + "Russia: Chelyabinsk", + "Russia: Khanty-Mansi", + "Russia: Kurgan", + "Russia: Orenburg", + "Russia: Perm", + "Russia: Sverdlovsk", + "Russia: Tyumen", + "Russia: Yamalia", + "Tajikistan", + "Turkmenistan", + "Uzbekistan" + ] + }, + { + "Offset": "05:30", + "DaylightSavingTime": false, + "Countries": [ + "India", + "Sri Lanka" + ] + }, + { + "Offset": "05:45", + "DaylightSavingTime": false, + "Countries": [ + "Nepal" + ] + }, + { + "Offset": "06:00", + "DaylightSavingTime": false, + "Countries": [ + "Bangladesh", + "Bhutan", + "British Indian Ocean Territory", + "Kazakhstan (most)", + "Kyrgyzstan", + "Russia: Omsk" + ] + }, + { + "Offset": "06:30", + "DaylightSavingTime": false, + "Countries": [ + "Cocos Islands", + "Myanmar" + ] + }, + { + "Offset": "07:00", + "DaylightSavingTime": false, + "Countries": [ + "Cambodia", + "Christmas Island", + "Indonesia: Central Kalimantan", + "Indonesia: Java", + "Indonesia: Sumatra", + "Indonesia: West Kalimantan", + "Laos", + "Mongolia: Bayan-Ölgii", + "Mongolia: Khovd", + "Mongolia: Uvs", + "Russia: Altai Krai", + "Russia: Altai Republic", + "Russia: Kemerovo", + "Russia: Khakassia", + "Russia: Krasnoyarsk", + "Russia: Novosibirsk", + "Russia: Tomsk", + "Russia: Tuva", + "Thailand", + "Vietnam" + ] + }, + { + "Offset": "08:00", + "DaylightSavingTime": false, + "Countries": [ + "Australia: Western Australia (most)", + "Brunei", + "China", + "Hong Kong", + "Indonesia: Bali", + "Indonesia: East Kalimantan", + "Indonesia: East Nusa Tenggara", + "Indonesia: North Kalimantan", + "Indonesia: South Kalimantan", + "Indonesia: Sulawesi", + "Indonesia: West Nusa Tenggara", + "Macau", + "Malaysia", + "Mongolia (most)", + "Philippines", + "Russia: Buryatia", + "Russia: Irkutsk", + "Singapore", + "Taiwan" + ] + }, + { + "Offset": "08:45", + "DaylightSavingTime": false, + "Countries": [ + "Eucla" + ] + }, + { + "Offset": "09:00", + "DaylightSavingTime": false, + "Countries": [ + "East Timor", + "Indonesia: Maluku", + "Indonesia: North Maluku", + "Indonesia: Papua", + "Indonesia: West Papua", + "Japan", + "North Korea", + "Palau", + "Russia: Amur", + "Russia: Sakha (most)", + "Russia: Zabaykalsky", + "South Korea" + ] + }, + { + "Offset": "09:30", + "DaylightSavingTime": false, + "Countries": [ + "Northern Territory" + ] + }, + { + "Offset": "09:30", + "DaylightSavingTime": true, + "Countries": [ + "Australia: South Australia" + ] + }, + { + "Offset": "10:00", + "DaylightSavingTime": false, + "Countries": [ + "Australia: Queensland", + "Guam", + "Micronesia: Chuuk", + "Micronesia: Yap", + "Northern Mariana Islands", + "Papua New Guinea (most)", + "Russia: Jewish", + "Russia: Khabarovsk", + "Russia: Primorsky", + "Russia: Sakha (central-east)" + ] + }, + { + "Offset": "10:00", + "DaylightSavingTime": true, + "Countries": [ + "Australia: Australian Capital Territory", + "Australia: Jervis Bay Territory", + "Australia: New South Wales (most)", + "Australia: Tasmania", + "Australia: Victoria" + ] + }, + { + "Offset": "10:30", + "DaylightSavingTime": true, + "Countries": [ + "Australia: Lord Howe Island" + ] + }, + { + "Offset": "11:00", + "DaylightSavingTime": false, + "Countries": [ + "Micronesia: Kosrae", + "Micronesia: Pohnpei", + "New Caledonia", + "Papua New Guinea: Bougainville", + "Russia: Magadan", + "Russia: Sakha (east)", + "Russia: Sakhalin", + "Solomon Islands", + "Vanuatu" + ] + }, + { + "Offset": "11:00", + "DaylightSavingTime": true, + "Countries": [ + "Norfolk Island" + ] + }, + { + "Offset": "12:00", + "DaylightSavingTime": false, + "Countries": [ + "Fiji", + "Kiribati: Gilbert Islands", + "Marshall Islands", + "Nauru", + "Russia: Chukotka", + "Russia: Kamchatka", + "Tuvalu", + "Wake Island", + "Wallis and Futuna" + ] + }, + { + "Offset": "12:00", + "DaylightSavingTime": true, + "Countries": [ + "New Zealand" + ] + }, + { + "Offset": "12:45", + "DaylightSavingTime": true, + "Countries": [ + "New Zealand: Chatham Islands" + ] + }, + { + "Offset": "13:00", + "DaylightSavingTime": false, + "Countries": [ + "Kiribati: Phoenix Islands", + "Samoa", + "Tokelau", + "Tonga" + ] + }, + { + "Offset": "14:00", + "DaylightSavingTime": false, + "Countries": [ + "Kiribati: Line Islands" + ] + } + ] +} From 6aa06b41ec7655e52003b8aa72d86c505da3abe4 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 21 Oct 2021 18:28:19 +0200 Subject: [PATCH 07/67] Exclude json file from spell checker --- .github/actions/spell-check/excludes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/spell-check/excludes.txt b/.github/actions/spell-check/excludes.txt index c3f6cd0bf36..779d0cf363f 100644 --- a/.github/actions/spell-check/excludes.txt +++ b/.github/actions/spell-check/excludes.txt @@ -48,3 +48,5 @@ ignore$ ^\.github/ ^\.github/actions/spell-check/ ^\.gitmodules$ +(?:^|/)WindowsSettings\.json$ +(?:^|/)timezones\.json$ From 08d353d1f0bb678774c0a4d1ba16f296ef3722a2 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 21 Oct 2021 18:28:32 +0200 Subject: [PATCH 08/67] fix wrong dst --- .../Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 094491ca247..d0d31e14b71 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -98,7 +98,7 @@ }, { "Offset": "−07:00", - "DaylightSavingTime": false, + "DaylightSavingTime": true, "Name": "Pacific Time Zone", "Countries": [ "Canada: Alberta", From 2455b8ce9f7571e7dca287e217ff10c4b03811b9 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 21 Oct 2021 18:29:07 +0200 Subject: [PATCH 09/67] Improved results (title, subtitle, tooltip) and fix namespace/class problem --- .../Classes/{TimeZone.cs => OneTimeZone.cs} | 4 +- .../Classes/TimeZoneList.cs | 4 +- .../Helper/JsonSettingsListHelper.cs | 63 +++++++++ .../Helper/ResultHelper.cs | 131 +++++++++++++++--- ...osoft.PowerToys.Run.Plugin.TimeZone.csproj | 8 ++ .../Properties/Resources.Designer.cs | 35 +++-- .../Properties/Resources.resx | 19 +-- 7 files changed, 216 insertions(+), 48 deletions(-) rename src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/{TimeZone.cs => OneTimeZone.cs} (91%) create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs similarity index 91% rename from src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZone.cs rename to src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index 2473d73ec91..819ec3b3ccd 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -7,9 +7,9 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Classes { - public sealed class TimeZone + public sealed class OneTimeZone { - public TimeZone() + public OneTimeZone() { Offset = "0:00"; Name = string.Empty; diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs index 7ff5f90b8b7..d058f5b0633 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs @@ -11,9 +11,9 @@ public sealed class TimeZoneList { public TimeZoneList() { - TimeZones = Enumerable.Empty(); + TimeZones = Enumerable.Empty(); } - public IEnumerable TimeZones { get; set; } + public IEnumerable TimeZones { get; set; } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs new file mode 100644 index 00000000000..a905e25fe1b --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text.Json; +using System.Text.Json.Serialization; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; +using Wox.Plugin.Logger; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper +{ + /// + /// Helper class to easier work with the JSON file that contains all Windows settings + /// + internal static class JsonSettingsListHelper + { + /// + /// The name of the file that contains all settings for the query + /// + private const string _settingsFile = "timezones.json"; + + /// + /// Read all possible Windows settings. + /// + /// A list with all possible windows settings. + internal static TimeZoneList ReadAllPossibleTimezones() + { + var assembly = Assembly.GetExecutingAssembly(); + var type = assembly.GetTypes().FirstOrDefault(x => x.Name == nameof(Main)); + + TimeZoneList? settings = null; + + try + { + var resourceName = $"{type?.Namespace}.{_settingsFile}"; + using var stream = assembly.GetManifestResourceStream(resourceName); + if (stream is null) + { + throw new Exception("stream is null"); + } + + var options = new JsonSerializerOptions(); + options.Converters.Add(new JsonStringEnumConverter()); + + using var reader = new StreamReader(stream); + var text = reader.ReadToEnd(); + + settings = JsonSerializer.Deserialize(text, options); + } + catch (Exception exception) + { + Log.Exception("Error loading settings JSON file", exception, typeof(JsonSettingsListHelper)); + } + + return settings ?? new TimeZoneList(); + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index e014bc9133a..5d573bb6aa0 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.Json; using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Mono.Collections.Generic; @@ -23,7 +22,7 @@ internal static class ResultHelper /// /// The to filter the . /// A list with s. - internal static IEnumerable GetResults(IEnumerable timeZones, string search, string iconPath) + internal static IEnumerable GetResults(IEnumerable timeZones, string search, string iconPath) { var results = new Collection(); var utcNow = DateTime.UtcNow; @@ -32,7 +31,7 @@ internal static IEnumerable GetResults(IEnumerable tim { if (TimeZoneInfoMatchQuery(timeZone, search)) { - var result = GetResult(timeZone, utcNow, iconPath); + var result = GetResult(timeZone, utcNow, search, iconPath); results.Add(result); } } @@ -47,7 +46,7 @@ internal static IEnumerable GetResults(IEnumerable tim /// The to check. /// The that should match. /// if it's match, otherwise . - private static bool TimeZoneInfoMatchQuery(Classes.TimeZone timeZone, string search) + private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) { if (timeZone.Offset.Contains(search, StringComparison.InvariantCultureIgnoreCase)) { @@ -80,37 +79,94 @@ private static bool TimeZoneInfoMatchQuery(Classes.TimeZone timeZone, string sea /// The that contain the information for the . /// The current time in UTC for the . /// A . - private static Result GetResult(Classes.TimeZone timeZone, DateTime utcNow, string iconPath) + private static Result GetResult(OneTimeZone timeZone, DateTime utcNow, string search, string iconPath) { - // TODO: respect DST on time calculation - // TODO: DST into SubTitle and toolTip // TODO: add timezones // TODO: add shortcuts - - var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow); - - var title = string.IsNullOrWhiteSpace(timeZone.Name) ? timeZone.Offset : timeZone.Name; - - var toolTip = $"{Environment.NewLine}{Resources.StandardName}: {timeZone.Name}" - + $"{Environment.NewLine}{Resources.Offset}: {timeZone.Offset}"; + var title = GetTitle(timeZone, utcNow); var result = new Result { ContextData = timeZone, IcoPath = iconPath, - SubTitle = $"{Resources.CurrentTime}: {timeInZoneTime:HH:mm:ss}", + SubTitle = GetCountires(timeZone, search, maxLength: 100), Title = title, - ToolTipData = new ToolTipData(title, toolTip), + ToolTipData = new ToolTipData(title, GetToolTip(timeZone)), }; return result; } - private static DateTime GetTimeInTimeZone(Classes.TimeZone timeZone, DateTime utcNow) + private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow) { - string offset; DateTime result; + var (hours, minutes) = GetHoursAndMinutes(timeZone); + + if (timeZone.Offset.StartsWith("-", StringComparison.InvariantCultureIgnoreCase)) + { + result = utcNow.AddHours(-hours).AddMinutes(-minutes); + } + else + { + result = utcNow.AddHours(hours).AddMinutes(minutes); + } + + if (timeZone.DaylightSavingTime) + { + result = result.AddHours(1); + } + + return result; + } + + private static string GetTitle(OneTimeZone timeZone, DateTime utcNow) + { + string result; + + var (hours, minutes) = GetHoursAndMinutes(timeZone); + var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow); + + if (timeZone.DaylightSavingTime) + { + hours += 1; + } + + if (timeZone.Offset.StartsWith('-')) + { + result = $"{timeInZoneTime:HH:mm:ss} - UTC-{hours}:{minutes:00}"; + } + else + { + result = $"{timeInZoneTime:HH:mm:ss} - UTC+{hours}:{minutes:00}"; + } + + if (timeZone.DaylightSavingTime) + { + result = $"{result} - {Resources.DaylightSavingTime}"; + } + + return result; + } + + private static string GetToolTip(OneTimeZone timeZone) + { + var useDst = timeZone.DaylightSavingTime ? Resources.Yes : Resources.No; + + var countires = GetCountires(timeZone, search: string.Empty, maxLength: int.MaxValue); + + var result = $"{Environment.NewLine}{Resources.Name}: {timeZone.Name}" + + $"{Environment.NewLine}{Resources.Offset}: {timeZone.Offset}" + + $"{Environment.NewLine}{Resources.DaylightSavingTime}:{useDst}" + + $"{Environment.NewLine}{Resources.Countries}:{countires}"; + + return result; + } + + private static (byte hours, byte minutes) GetHoursAndMinutes(OneTimeZone timeZone) + { + string offset; + if (timeZone.Offset.StartsWith("-", StringComparison.InvariantCultureIgnoreCase)) { offset = timeZone.Offset.Substring(1); @@ -122,16 +178,45 @@ private static DateTime GetTimeInTimeZone(Classes.TimeZone timeZone, DateTime ut var offsetSplit = offset.Split(':'); - int.TryParse(offsetSplit.FirstOrDefault(), out var hours); - int.TryParse(offsetSplit.LastOrDefault(), out var minutes); + byte.TryParse(offsetSplit.FirstOrDefault(), out var hours); + byte.TryParse(offsetSplit.LastOrDefault(), out var minutes); - if (timeZone.Offset.StartsWith("-", StringComparison.InvariantCultureIgnoreCase)) + return (hours, minutes); + } + + private static string GetCountires(OneTimeZone timeZone, string search, int maxLength) + { + IEnumerable countries; + + // TODO: translate country names + if (string.IsNullOrWhiteSpace(search)) { - result = utcNow.AddHours(-hours).AddMinutes(-minutes); + countries = timeZone.Countries; } else { - result = utcNow.AddHours(hours).AddMinutes(minutes); + // INFO: I'm not sure if "CurrentCultureIgnoreCase" is correct here + countries = timeZone.Countries.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); + if (!countries.Any()) + { + countries = timeZone.Countries; + } + } + + var result = countries.Aggregate(string.Empty, (current, next) + => current.Length == 0 ? next : $"{current}, {next}"); + + // To many countries => reduce length, first pass + if (result.Length > maxLength) + { + result = countries.Aggregate(string.Empty, (current, next) + => current.Length == 0 ? $"{next[..3]}..." : $"{current}, {next[..3]}..."); + } + + // To many countries => reduce length, second pass + if (result.Length > maxLength) + { + result = $"{result[..maxLength]}..."; } return result; diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj index 2b72cf23789..929f61b7cc5 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj @@ -44,6 +44,10 @@ + + + + GlobalSuppressions.cs @@ -53,6 +57,10 @@ + + + + false diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index e5ef3e7281f..51eb4c6f0aa 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -70,29 +70,38 @@ internal static string CopyTime { } /// - /// Looks up a localized string similar to Current time. + /// Looks up a localized string similar to Countries. /// - internal static string CurrentTime { + internal static string Countries { get { - return ResourceManager.GetString("CurrentTime", resourceCulture); + return ResourceManager.GetString("Countries", resourceCulture); } } /// - /// Looks up a localized string similar to Daylight name. + /// Looks up a localized string similar to Daylight saving time. /// - internal static string DaylightName { + internal static string DaylightSavingTime { get { - return ResourceManager.GetString("DaylightName", resourceCulture); + return ResourceManager.GetString("DaylightSavingTime", resourceCulture); } } /// - /// Looks up a localized string similar to Display name. + /// Looks up a localized string similar to Name. /// - internal static string DisplayName { + internal static string Name { get { - return ResourceManager.GetString("DisplayName", resourceCulture); + return ResourceManager.GetString("Name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + internal static string No { + get { + return ResourceManager.GetString("No", resourceCulture); } } @@ -124,11 +133,11 @@ internal static string PluginTitle { } /// - /// Looks up a localized string similar to Standard name. + /// Looks up a localized string similar to Yes. /// - internal static string StandardName { + internal static string Yes { get { - return ResourceManager.GetString("StandardName", resourceCulture); + return ResourceManager.GetString("Yes", resourceCulture); } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index 8cf83bfe9d5..c2fe6a2969a 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -120,14 +120,17 @@ Copy time - - Current time + + Countries - - Daylight name + + Daylight saving time - - Display name + + Name + + + No Offset @@ -138,7 +141,7 @@ Time zone - - Standard name + + Yes \ No newline at end of file From 33f2a58e29e32b84d362c31596ce06ff6b00f590 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 22 Oct 2021 08:41:24 +0200 Subject: [PATCH 10/67] Always show full offset (-##:## and +##:##) --- .../Helper/ResultHelper.cs | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 5d573bb6aa0..214189bff9e 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -122,24 +122,9 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow) private static string GetTitle(OneTimeZone timeZone, DateTime utcNow) { - string result; - - var (hours, minutes) = GetHoursAndMinutes(timeZone); var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow); - if (timeZone.DaylightSavingTime) - { - hours += 1; - } - - if (timeZone.Offset.StartsWith('-')) - { - result = $"{timeInZoneTime:HH:mm:ss} - UTC-{hours}:{minutes:00}"; - } - else - { - result = $"{timeInZoneTime:HH:mm:ss} - UTC+{hours}:{minutes:00}"; - } + var result = $"{timeInZoneTime:HH:mm:ss} - UTC{GetFullOffset(timeZone)}"; if (timeZone.DaylightSavingTime) { @@ -156,7 +141,7 @@ private static string GetToolTip(OneTimeZone timeZone) var countires = GetCountires(timeZone, search: string.Empty, maxLength: int.MaxValue); var result = $"{Environment.NewLine}{Resources.Name}: {timeZone.Name}" - + $"{Environment.NewLine}{Resources.Offset}: {timeZone.Offset}" + + $"{Environment.NewLine}{Resources.Offset}: {GetFullOffset(timeZone)}" + $"{Environment.NewLine}{Resources.DaylightSavingTime}:{useDst}" + $"{Environment.NewLine}{Resources.Countries}:{countires}"; @@ -221,5 +206,23 @@ private static string GetCountires(OneTimeZone timeZone, string search, int maxL return result; } + + private static string GetFullOffset(OneTimeZone timeZone) + { + var (hours, minutes) = GetHoursAndMinutes(timeZone); + + string result; + + if (timeZone.Offset.StartsWith('-')) + { + result = "-{hours}:{minutes:00}"; + } + else + { + result = $"+{hours}:{minutes:00}"; + } + + return result; + } } } From e698f613f5e662ebfb04d25b7e42f8cdccedb61d Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 22 Oct 2021 09:32:22 +0200 Subject: [PATCH 11/67] Add and show timezone names (first pass) --- .../Helper/ResultHelper.cs | 22 ++++++--- .../timezones.json | 47 ++++++++++++++++--- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 214189bff9e..60264e72a63 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -81,7 +81,8 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) /// A . private static Result GetResult(OneTimeZone timeZone, DateTime utcNow, string search, string iconPath) { - // TODO: add timezones + // TODO: revisit timezone names, maybe a list of time zone names + // TODO: add standard and DST time zone names // TODO: add shortcuts var title = GetTitle(timeZone, utcNow); @@ -122,16 +123,25 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow) private static string GetTitle(OneTimeZone timeZone, DateTime utcNow) { - var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow); + string timeZoneName; - var result = $"{timeInZoneTime:HH:mm:ss} - UTC{GetFullOffset(timeZone)}"; + if (string.IsNullOrEmpty(timeZone.Name)) + { + timeZoneName = $"UTC{GetFullOffset(timeZone)}"; - if (timeZone.DaylightSavingTime) + if (timeZone.DaylightSavingTime) + { + timeZoneName = $"{timeZoneName} - {Resources.DaylightSavingTime}"; + } + } + else { - result = $"{result} - {Resources.DaylightSavingTime}"; + timeZoneName = timeZone.Name; } - return result; + var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow); + + return $"{timeInZoneTime:HH:mm:ss} - {timeZoneName}"; } private static string GetToolTip(OneTimeZone timeZone) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index d0d31e14b71..5b6f37498e8 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -14,7 +14,9 @@ { "Offset": "-11:00", "DaylightSavingTime": false, - "Countries": [ + "Name": "Samoa Time Zone", + "Countries": + [ "American Samoa", "Jarvis Island", "Kingman Reef", @@ -26,6 +28,7 @@ { "Offset": "-10:00", "DaylightSavingTime": false, + "Name": "Hawaii–Aleutian Time Zone", "Countries": [ "Cook Islands", "French Polynesia (most)", @@ -36,6 +39,7 @@ { "Offset": "-10:00", "DaylightSavingTime": true, + "Name": "Hawaii–Aleutian Time Zone", "Countries": [ "United States: Andreanof Islands", "United States: Islands of Four Mountains", @@ -53,6 +57,7 @@ { "Offset": "−09:00", "DaylightSavingTime": false, + "Name": "Alaska Time Zone", "Countries": [ "French Polynesia: Gambier Islands" ] @@ -60,6 +65,7 @@ { "Offset": "−09:00", "DaylightSavingTime": true, + "Name": "Alaska Time Zone", "Countries": [ "United States: Alaska (most)" ] @@ -67,6 +73,7 @@ { "Offset": "−08:00", "DaylightSavingTime": false, + "Name": "Pacific Time Zone", "Countries": [ "Clipperton Island", "Pitcairn Islands" @@ -75,6 +82,7 @@ { "Offset": "−08:00", "DaylightSavingTime": true, + "Name": "Alaska Time Zone", "Countries": [ "Canada: British Columbia (most)", "Mexico: Baja California", @@ -99,7 +107,7 @@ { "Offset": "−07:00", "DaylightSavingTime": true, - "Name": "Pacific Time Zone", + "Name": "Mountain Time Zone", "Countries": [ "Canada: Alberta", "Canada: British Columbia (southeast)", @@ -135,7 +143,7 @@ { "Offset": "−06:00", "DaylightSavingTime": true, - "Name": "Mountain Time Zone", + "Name": "Central Time Zone", "Countries": [ "Canada: Manitoba", "Canada: Nunavut (central)", @@ -182,7 +190,7 @@ { "Offset": "−05:00", "DaylightSavingTime": true, - "Name": "Central Time Zone", + "Name": "Eastern Time Zone", "Countries": [ "Bahamas", "Canada: Nunavut (east)", @@ -256,7 +264,7 @@ { "Offset": "−04:00", "DaylightSavingTime": true, - "Name": "Eastern Time Zone", + "Name": "Atlantic Time Zone", "Countries": [ "Bermuda", "Canada: Labrador (most)", @@ -271,6 +279,7 @@ { "Offset": "−03:30", "DaylightSavingTime": true, + "Name": "Newfoundland Time Zone", "Countries": [ "Canada: Newfoundland", "Canada: Labrador (southeast)" @@ -285,7 +294,7 @@ "Chile: Magallanes", "Falkland Islands", "French Guiana", - "Suriname", + "SuriName", "Uruguay" ] }, @@ -323,6 +332,7 @@ { "Offset": "00:00", "DaylightSavingTime": false, + "Name": "Western European Time", "Countries": [ "Ascension and Tristan da Cunha", "Burkina Faso", @@ -346,6 +356,7 @@ { "Offset": "00:00", "DaylightSavingTime": true, + "Name": "Western European Time", "Countries": [ "Canary Islands", "Faroe Islands", @@ -360,6 +371,7 @@ { "Offset": "01:00", "DaylightSavingTime": false, + "Name": "Central European Time", "Countries": [ "Algeria", "Angola", @@ -390,6 +402,7 @@ { "Offset": "01:00", "DaylightSavingTime": true, + "Name": "Central European Time", "Countries": [ "Albania", "Andorra", @@ -427,6 +440,7 @@ { "Offset": "02:00", "DaylightSavingTime": false, + "Name": "Eastern European Time", "Countries": [ "Botswana", "Burundi", @@ -450,6 +464,7 @@ { "Offset": "02:00", "DaylightSavingTime": true, + "Name": "Eastern European Time", "Countries": [ "Akrotiri and Dhekelia", "Bulgaria", @@ -473,6 +488,7 @@ { "Offset": "03:00", "DaylightSavingTime": false, + "Name": "Further-eastern European Time", "Countries": [ "Abkhazia", "Bahrain", @@ -506,6 +522,7 @@ { "Offset": "03:30", "DaylightSavingTime": true, + "Name": "Iran Standard Time", "Countries": [ "Iran" ] @@ -513,6 +530,7 @@ { "Offset": "04:00", "DaylightSavingTime": true, + "Name": "Samara Time", "Countries": [ "Armenia", "Artsakh", @@ -534,6 +552,7 @@ { "Offset": "04:30", "DaylightSavingTime": false, + "Name": "Afghanistan Time", "Countries": [ "Afghanistan" ] @@ -541,6 +560,7 @@ { "Offset": "05:00", "DaylightSavingTime": false, + "Name": "Pakistan Standard Time", "Countries": [ "French Southern and Antarctic Lands: Amsterdam Island", "French Southern and Antarctic Lands: Kerguelen Islands", @@ -571,6 +591,7 @@ { "Offset": "05:30", "DaylightSavingTime": false, + "Name": "Indian Standard Time", "Countries": [ "India", "Sri Lanka" @@ -579,6 +600,7 @@ { "Offset": "05:45", "DaylightSavingTime": false, + "Name": "Nepal Standard Time", "Countries": [ "Nepal" ] @@ -586,6 +608,7 @@ { "Offset": "06:00", "DaylightSavingTime": false, + "Name": "Bangladesh Standard Time", "Countries": [ "Bangladesh", "Bhutan", @@ -598,6 +621,7 @@ { "Offset": "06:30", "DaylightSavingTime": false, + "Name": "Myanmar Standard Time", "Countries": [ "Cocos Islands", "Myanmar" @@ -606,6 +630,7 @@ { "Offset": "07:00", "DaylightSavingTime": false, + "Name": "Western Indonesian Time", "Countries": [ "Cambodia", "Christmas Island", @@ -632,6 +657,7 @@ { "Offset": "08:00", "DaylightSavingTime": false, + "Name": "Central Indonesian Time", "Countries": [ "Australia: Western Australia (most)", "Brunei", @@ -657,6 +683,7 @@ { "Offset": "08:45", "DaylightSavingTime": false, + "Name": "Central Western Standard Time", "Countries": [ "Eucla" ] @@ -664,6 +691,7 @@ { "Offset": "09:00", "DaylightSavingTime": false, + "Name": "Eastern Indonesian Time", "Countries": [ "East Timor", "Indonesia: Maluku", @@ -682,6 +710,7 @@ { "Offset": "09:30", "DaylightSavingTime": false, + "Name": "Central Standard Time", "Countries": [ "Northern Territory" ] @@ -689,6 +718,7 @@ { "Offset": "09:30", "DaylightSavingTime": true, + "Name": "Central Standard Time", "Countries": [ "Australia: South Australia" ] @@ -712,6 +742,7 @@ { "Offset": "10:00", "DaylightSavingTime": true, + "Name": "Vladivostok Time", "Countries": [ "Australia: Australian Capital Territory", "Australia: Jervis Bay Territory", @@ -730,6 +761,7 @@ { "Offset": "11:00", "DaylightSavingTime": false, + "Name": "Magadan Time", "Countries": [ "Micronesia: Kosrae", "Micronesia: Pohnpei", @@ -752,6 +784,7 @@ { "Offset": "12:00", "DaylightSavingTime": false, + "Name": "Kamchatka Time", "Countries": [ "Fiji", "Kiribati: Gilbert Islands", @@ -774,6 +807,7 @@ { "Offset": "12:45", "DaylightSavingTime": true, + "Name": "Chatham Standard Time", "Countries": [ "New Zealand: Chatham Islands" ] @@ -781,6 +815,7 @@ { "Offset": "13:00", "DaylightSavingTime": false, + "Name": "", "Countries": [ "Kiribati: Phoenix Islands", "Samoa", From b81262f4760c56996632988fd549035eedb8388e Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 22 Oct 2021 09:39:06 +0200 Subject: [PATCH 12/67] Fix typos --- .../Helper/JsonSettingsListHelper.cs | 6 ++---- .../Helper/ResultHelper.cs | 10 +++++----- .../Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs | 10 +++++----- .../Microsoft.PowerToys.Run.Plugin.TimeZone.csproj | 6 +----- .../{timezone.schema.json => timeZones.schema.json} | 0 .../timezones.json | 2 +- 6 files changed, 14 insertions(+), 20 deletions(-) rename src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/{timezone.schema.json => timeZones.schema.json} (100%) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs index a905e25fe1b..675c7207b39 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs @@ -3,9 +3,7 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Reflection; using System.Text.Json; using System.Text.Json.Serialization; @@ -22,7 +20,7 @@ internal static class JsonSettingsListHelper /// /// The name of the file that contains all settings for the query /// - private const string _settingsFile = "timezones.json"; + private const string _settingsFile = "timeZones.json"; /// /// Read all possible Windows settings. @@ -31,7 +29,7 @@ internal static class JsonSettingsListHelper internal static TimeZoneList ReadAllPossibleTimezones() { var assembly = Assembly.GetExecutingAssembly(); - var type = assembly.GetTypes().FirstOrDefault(x => x.Name == nameof(Main)); + var type = Array.Find(assembly.GetTypes(), x => x.Name == nameof(Main)); TimeZoneList? settings = null; diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 60264e72a63..4e536379989 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -81,7 +81,7 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) /// A . private static Result GetResult(OneTimeZone timeZone, DateTime utcNow, string search, string iconPath) { - // TODO: revisit timezone names, maybe a list of time zone names + // TODO: revisit time zone names, maybe a list of time zone names // TODO: add standard and DST time zone names // TODO: add shortcuts var title = GetTitle(timeZone, utcNow); @@ -90,7 +90,7 @@ private static Result GetResult(OneTimeZone timeZone, DateTime utcNow, string se { ContextData = timeZone, IcoPath = iconPath, - SubTitle = GetCountires(timeZone, search, maxLength: 100), + SubTitle = GetCountries(timeZone, search, maxLength: 100), Title = title, ToolTipData = new ToolTipData(title, GetToolTip(timeZone)), }; @@ -148,12 +148,12 @@ private static string GetToolTip(OneTimeZone timeZone) { var useDst = timeZone.DaylightSavingTime ? Resources.Yes : Resources.No; - var countires = GetCountires(timeZone, search: string.Empty, maxLength: int.MaxValue); + var countries = GetCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); var result = $"{Environment.NewLine}{Resources.Name}: {timeZone.Name}" + $"{Environment.NewLine}{Resources.Offset}: {GetFullOffset(timeZone)}" + $"{Environment.NewLine}{Resources.DaylightSavingTime}:{useDst}" - + $"{Environment.NewLine}{Resources.Countries}:{countires}"; + + $"{Environment.NewLine}{Resources.Countries}:{countries}"; return result; } @@ -179,7 +179,7 @@ private static (byte hours, byte minutes) GetHoursAndMinutes(OneTimeZone timeZon return (hours, minutes); } - private static string GetCountires(OneTimeZone timeZone, string search, int maxLength) + private static string GetCountries(OneTimeZone timeZone, string search, int maxLength) { IEnumerable countries; diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index 9676ada6f1b..5c47a1d655e 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -37,9 +37,9 @@ public class Main : IPlugin, IContextMenu, IPluginI18n, IDisposable private bool _disposed; /// - /// A class that contain all possible timezones. + /// A class that contain all possible time zones. /// - private TimeZoneList? _timezones; + private TimeZoneList? _timeZoneList; /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public void Init(PluginInitContext context) _context.API.ThemeChanged += OnThemeChanged; UpdateIconPath(_context.API.GetCurrentTheme()); - _timezones = JsonSettingsListHelper.ReadAllPossibleTimezones(); + _timeZoneList = JsonSettingsListHelper.ReadAllPossibleTimezones(); } /// @@ -80,7 +80,7 @@ public void Init(PluginInitContext context) /// A filtered list, can be empty when nothing was found public List Query(Query query) { - if (_timezones?.TimeZones is null) + if (_timeZoneList?.TimeZones is null) { return new List(0); } @@ -90,7 +90,7 @@ public List Query(Query query) return new List(0); } - var results = ResultHelper.GetResults(_timezones.TimeZones, query.Search, _defaultIconPath).ToList(); + var results = ResultHelper.GetResults(_timeZoneList.TimeZones, query.Search, _defaultIconPath).ToList(); return results; } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj index 929f61b7cc5..8f687ba30b1 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj @@ -44,10 +44,6 @@ - - - - GlobalSuppressions.cs @@ -58,7 +54,7 @@ - + diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezone.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json similarity index 100% rename from src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezone.schema.json rename to src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 5b6f37498e8..4c7ced0a000 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -1,5 +1,5 @@ { - "$schema": "./timezone.schema.json", + "$schema": "./timeZones.schema.json", "TimeZones": [ { From 0c8eed11be19a5285da4fa055f14e7cf159004bf Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 22 Oct 2021 09:45:42 +0200 Subject: [PATCH 13/67] fix build --- .../Helper/JsonSettingsListHelper.cs | 5 +++++ .../Helper/ResultHelper.cs | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs index 675c7207b39..922b5e69de7 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs @@ -50,9 +50,14 @@ internal static TimeZoneList ReadAllPossibleTimezones() settings = JsonSerializer.Deserialize(text, options); } + catch (JsonException exception) + { + Log.Exception("Error loading settings JSON file", exception, typeof(JsonSettingsListHelper)); + } catch (Exception exception) { Log.Exception("Error loading settings JSON file", exception, typeof(JsonSettingsListHelper)); + throw; } return settings ?? new TimeZoneList(); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 4e536379989..203faee8a7c 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -173,10 +173,12 @@ private static (byte hours, byte minutes) GetHoursAndMinutes(OneTimeZone timeZon var offsetSplit = offset.Split(':'); - byte.TryParse(offsetSplit.FirstOrDefault(), out var hours); - byte.TryParse(offsetSplit.LastOrDefault(), out var minutes); + if (byte.TryParse(offsetSplit.FirstOrDefault(), out var hours) && byte.TryParse(offsetSplit.LastOrDefault(), out var minutes)) + { + return (hours, minutes); + } - return (hours, minutes); + return (0, 0); } private static string GetCountries(OneTimeZone timeZone, string search, int maxLength) From ce63b405d1d1b77501ad410aa32fa3b589b5fcc6 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 22 Oct 2021 11:34:30 +0200 Subject: [PATCH 14/67] JSON: fix wrong minus sign and put extra country info the end --- .../timezones.json | 444 +++++++++--------- 1 file changed, 222 insertions(+), 222 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 4c7ced0a000..728f76fd645 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -33,7 +33,7 @@ "Cook Islands", "French Polynesia (most)", "Johnston Atoll", - "United States: Hawaii" + "Hawaii (United States)" ] }, { @@ -41,37 +41,37 @@ "DaylightSavingTime": true, "Name": "Hawaii–Aleutian Time Zone", "Countries": [ - "United States: Andreanof Islands", - "United States: Islands of Four Mountains", - "United States: Near Islands", - "United States: Rat Islands (Aleutian Islands, Alaska)" + "Andreanof Islands (United States)", + "Islands of Four Mountains (United States)", + "Near Islands (United States)", + "Rat Islands (Aleutian Islands, Alaska, United States)" ] }, { - "Offset": "−09:30", + "Offset": "-09:30", "DaylightSavingTime": false, "Countries": [ - "French Polynesia: Marquesas Islands" + "Marquesas Islands (French Polynesia)" ] }, { - "Offset": "−09:00", + "Offset": "-09:00", "DaylightSavingTime": false, "Name": "Alaska Time Zone", "Countries": [ - "French Polynesia: Gambier Islands" + "Gambier Islands (French Polynesia)" ] }, { - "Offset": "−09:00", + "Offset": "-09:00", "DaylightSavingTime": true, "Name": "Alaska Time Zone", "Countries": [ - "United States: Alaska (most)" + "Alaska (most, United States)" ] }, { - "Offset": "−08:00", + "Offset": "-08:00", "DaylightSavingTime": false, "Name": "Pacific Time Zone", "Countries": [ @@ -80,58 +80,58 @@ ] }, { - "Offset": "−08:00", + "Offset": "-08:00", "DaylightSavingTime": true, "Name": "Alaska Time Zone", "Countries": [ - "Canada: British Columbia (most)", - "Mexico: Baja California", - "United States: California", - "United States: Idaho (north)", - "United States: Nevada", - "United States: Oregon (most)", - "United States: Washington" + "British Columbia (most, Canada)", + "Baja California (Mexico)", + "California (United States)", + "Idaho (north, United States)", + "Nevada (United States)", + "Oregon (most, United States)", + "Washington (United States)" ] }, { - "Offset": "−07:00", + "Offset": "-07:00", "DaylightSavingTime": false, "Name": "Mountain Time Zone", "Countries": [ - "Canada: British Columbia (northeast)", - "Canada: Yukon", - "Mexico: Sonora", - "United States: Arizona (most)" + "British Columbia (northeast, Canada)", + "Yukon (Canada)", + "Sonora (Mexico)", + "Arizona (most, United States)" ] }, { - "Offset": "−07:00", + "Offset": "-07:00", "DaylightSavingTime": true, "Name": "Mountain Time Zone", "Countries": [ - "Canada: Alberta", - "Canada: British Columbia (southeast)", - "Canada: Northwest Territories", - "Canada: Nunavut (west)", - "Mexico: Baja California Sur", - "Mexico: Chihuahua", - "Mexico: Nayarit (most)", - "Mexico: Sinaloa", - "United States: Colorado", - "United States: Idaho (most)", - "United States: Montana", - "United States: New Mexico", - "United States: Utah", - "United States: Wyoming" + "Alberta (Canada)", + "British Columbia (southeast, Canada)", + "Northwest Territories (Canada)", + "Nunavut (west, Canada)", + "Baja California Sur (Mexico)", + "Chihuahua (Mexico)", + "Nayarit (most, Mexico)", + "Sinaloa (Mexico)", + "Colorado (United States)", + "Idaho (most, United States)", + "Montana (United States)", + "New Mexico (United States)", + "Utah (United States)", + "Wyoming (United States)" ] }, { - "Offset": "−06:00", + "Offset": "-06:00", "DaylightSavingTime": false, "Name": "Central Time Zone", "Countries": [ "Belize", - "Canada: Saskatchewan (most)", + "Saskatchewan (most, Canada)", "Costa Rica", "Ecuador: Galápagos", "El Salvador", @@ -141,90 +141,90 @@ ] }, { - "Offset": "−06:00", + "Offset": "-06:00", "DaylightSavingTime": true, "Name": "Central Time Zone", "Countries": [ - "Canada: Manitoba", - "Canada: Nunavut (central)", - "Canada: Ontario (west)", - "Chile: Easter Island", + "Manitoba (Canada)", + "Nunavut (central, Canada)", + "Ontario (west, Canada)", + "Easter Island (Chile)", "Mexico (most)", - "United States: Alabama", - "United States: Arkansas", - "United States: Illinois", - "United States: Iowa", - "United States: Kansas (most)", - "United States: Louisiana", - "United States: Minnesota", - "United States: Mississippi", - "United States: Missouri", - "United States: Nebraska (most)", - "United States: North Dakota (most)", - "United States: Oklahoma", - "United States: South Dakota (most)", - "United States: Tennessee (most)", - "United States: Texas (most)", - "United States: Wisconsin" - ] - }, - { - "Offset": "−05:00", + "Alabama (United States)", + "Arkansas (United States)", + "Illinois (United States)", + "Iowa (United States)", + "Kansas (most, United States)", + "Louisiana (United States)", + "Minnesota (United States)", + "Mississippi (United States)", + "Missouri (United States)", + "Nebraska (most, United States)", + "North Dakota (most, United States)", + "Oklahoma, United States", + "South Dakota (most, United States)", + "Tennessee (most, United States)", + "Texas (most, United States)", + "Wisconsin (United States)" + ] + }, + { + "Offset": "-05:00", "DaylightSavingTime": false, "Name": "Eastern Time Zone", "Countries": [ - "Brazil: Acre", - "Canada: Atikokan", - "Canada: Mishkeegogamang", - "Canada: Southampton Island", + "Acre (Brazil)", + "Atikokan (Canada)", + "Mishkeegogamang (Canada)", + "Southampton Island (Canada)", "Cayman Islands", "Colombia", "Ecuador (most)", "Jamaica", - "Mexico: Quintana Roo", + "Quintana Roo (Mexico)", "Navassa Island", "Panama", "Peru" ] }, { - "Offset": "−05:00", + "Offset": "-05:00", "DaylightSavingTime": true, "Name": "Eastern Time Zone", "Countries": [ "Bahamas", - "Canada: Nunavut (east)", - "Canada: Ontario (most)", - "Canada: Quebec (most)", + "Nunavut (east, Canada)", + "Ontario (most, Canada)", + "Quebec (most, Canada)", "Cuba", "Haiti", "Turks and Caicos Islands", - "United States: Connecticut", - "United States: Delaware", - "United States: District of Columbia", - "United States: Florida (most)", - "United States: Georgia", - "United States: Indiana (most)", - "United States: Kentucky (most)", - "United States: Maine", - "United States: Maryland", - "United States: Massachusetts", - "United States: Michigan (most)", - "United States: New Hampshire", - "United States: New Jersey", - "United States: New York", - "United States: North Carolina", - "United States: Ohio", - "United States: Pennsylvania", - "United States: Rhode Island", - "United States: South Carolina", - "United States: Vermont", - "United States: Virginia", - "United States: West Virginia" - ] - }, - { - "Offset": "−04:00", + "Connecticut (United States)", + "Delaware (United States)", + "District of Columbia (United States)", + "Florida (most, United States))", + "Georgia (United States)", + "Indiana (most, United States))", + "Kentucky (most, United States))", + "Maine (United States)", + "Maryland (United States)", + "Massachusetts", + "Michigan (most, United States))", + "New Hampshire (United States)", + "New Jersey (United States)", + "New York (United States)", + "North Carolina (United States)", + "Ohio (United States)", + "Pennsylvania (United States)", + "Rhode Island (United States)", + "South Carolina (United States)", + "Vermont (United States)", + "Virginia (United States)", + "West Virginia (United States)" + ] + }, + { + "Offset": "-04:00", "DaylightSavingTime": false, "Name": "Atlantic Time Zone", "Countries": [ @@ -233,13 +233,13 @@ "Aruba", "Barbados", "Bolivia", - "Brazil: Amazonas (most)", - "Brazil: Mato Grosso", - "Brazil: Mato Grosso do Sul", - "Brazil: Rondônia", - "Brazil: Roraima", + "Amazonas (most, Brazil)", + "Mato Grosso (Brazil)", + "Mato Grosso do Sul (Brazil)", + "Rondônia (Brazil)", + "Roraima (Brazil)", "British Virgin Islands", - "Canada: Quebec (east)", + "Quebec (east, Canada)", "Caribbean Netherlands", "Curaçao", "Dominica", @@ -262,44 +262,44 @@ ] }, { - "Offset": "−04:00", + "Offset": "-04:00", "DaylightSavingTime": true, "Name": "Atlantic Time Zone", "Countries": [ "Bermuda", - "Canada: Labrador (most)", - "Canada: New Brunswick", - "Canada: Nova Scotia", - "Canada: Prince Edward Island", + "Labrador (most, Canada)", + "New Brunswick (Canada)", + "Nova Scotia (Canada)", + "Prince Edward Island (Canada)", "Chile (most)", - "Greenland: Thule Air Base", + "Thule Air Base (Greenland)", "Paraguay" ] }, { - "Offset": "−03:30", + "Offset": "-03:30", "DaylightSavingTime": true, "Name": "Newfoundland Time Zone", "Countries": [ - "Canada: Newfoundland", - "Canada: Labrador (southeast)" + "Newfoundland (Canada)", + "Labrador (southeast, Canada)" ] }, { - "Offset": "−03:00", + "Offset": "-03:00", "DaylightSavingTime": false, "Countries": [ "Argentina", "Brazil (most)", - "Chile: Magallanes", + "Magallanes (Chile)", "Falkland Islands", "French Guiana", - "SuriName", + "Suriname", "Uruguay" ] }, { - "Offset": "−03:00", + "Offset": "-03:00", "DaylightSavingTime": true, "Countries": [ "Greenland (most)", @@ -307,26 +307,26 @@ ] }, { - "Offset": "−02:00", + "Offset": "-02:00", "DaylightSavingTime": false, "Countries": [ - "Brazil: Fernando de Noronha", + "Fernando de Noronha (Brazil)", "South Georgia and the South Sandwich Islands" ] }, { - "Offset": "−01:00", + "Offset": "-01:00", "DaylightSavingTime": false, "Countries": [ "Cape Verde" ] }, { - "Offset": "−01:00", + "Offset": "-01:00", "DaylightSavingTime": true, "Countries": [ - "Greenland: Ittoqqortoormiit", - "Portugal: Azores" + "Ittoqqortoormiit (Greenland)", + "Azores (Portugal)" ] }, { @@ -380,16 +380,16 @@ "Central African Republic", "Chad", "Congo", - "Democratic Republic of the Congo: Équateur", - "Democratic Republic of the Congo: Kinshasa", - "Democratic Republic of the Congo: Kongo Central", - "Democratic Republic of the Congo: Kwango", - "Democratic Republic of the Congo: Kwilu", - "Democratic Republic of the Congo: Mai-Ndombe", - "Democratic Republic of the Congo: Mongala", - "Democratic Republic of the Congo: Nord-Ubangi", - "Democratic Republic of the Congo: Sud-Ubangi", - "Democratic Republic of the Congo: Tshuapa", + "Équateur (Democratic Republic of the Congo)", + "Kinshasa (Democratic Republic of the Congo)", + "Kongo Central (Democratic Republic of the Congo)", + "Kwango (Democratic Republic of the Congo)", + "Kwilu (Democratic Republic of the Congo)", + "Mai-Ndombe (Democratic Republic of the Congo)", + "Mongala (Democratic Republic of the Congo)", + "Nord-Ubangi (Democratic Republic of the Congo)", + "Sud-Ubangi (Democratic Republic of the Congo)", + "Tshuapa (Democratic Republic of the Congo)", "Equatorial Guinea", "Gabon", "Morocco", @@ -452,7 +452,7 @@ "Malawi", "Mozambique", "Namibia", - "Russia: Kaliningrad", + "Kaliningrad (Russia)", "Rwanda", "South Africa (most)", "South Sudan", @@ -499,7 +499,7 @@ "Donetsk PR", "Eritrea", "Ethiopia", - "French Southern and Antarctic Lands: Scattered Islands", + "Scattered Islands (French Southern and Antarctic Lands)", "Iraq", "Kenya", "Kuwait", @@ -511,7 +511,7 @@ "Saudi Arabia", "Somalia", "Somaliland", - "South Africa: Prince Edward Islands", + "Prince Edward Islands (South Africa)", "South Ossetia", "Tanzania", "Turkey", @@ -535,15 +535,15 @@ "Armenia", "Artsakh", "Azerbaijan", - "French Southern and Antarctic Lands: Crozet Islands", + "Crozet Islands (French Southern and Antarctic Lands)", "Georgia", "Mauritius", "Oman", - "Russia: Astrakhan", - "Russia: Samara", - "Russia: Saratov", - "Russia: Udmurtia", - "Russia: Ulyanovsk", + "Astrakhan (Russia)", + "Samara (Russia)", + "Saratov (Russia)", + "Udmurtia (Russia)", + "Ulyanovsk (Russia)", "Réunion", "Seychelles", "United Arab Emirates" @@ -562,27 +562,27 @@ "DaylightSavingTime": false, "Name": "Pakistan Standard Time", "Countries": [ - "French Southern and Antarctic Lands: Amsterdam Island", - "French Southern and Antarctic Lands: Kerguelen Islands", - "French Southern and Antarctic Lands: Saint Paul Island", + "Amsterdam Island (French Southern and Antarctic Lands)", + "Kerguelen Islands (French Southern and Antarctic Lands)", + "Saint Paul Island (French Southern and Antarctic Lands)", "Heard Island and McDonald Islands", - "Kazakhstan: Aktobe", - "Kazakhstan: Atyrau", - "Kazakhstan: Baikonur", - "Kazakhstan: Kyzylorda", - "Kazakhstan: Mangystau", - "Kazakhstan: West Kazakhstan", + "Aktobe (Kazakhstan)", + "Atyrau (Kazakhstan)", + "Baikonur (Kazakhstan)", + "Kyzylorda (Kazakhstan)", + "Mangystau (Kazakhstan)", + "West Kazakhstan (Kazakhstan)", "Maldives", "Pakistan", - "Russia: Bashkortostan", - "Russia: Chelyabinsk", - "Russia: Khanty-Mansi", - "Russia: Kurgan", - "Russia: Orenburg", - "Russia: Perm", - "Russia: Sverdlovsk", - "Russia: Tyumen", - "Russia: Yamalia", + "Bashkortostan (Russia)", + "Chelyabinsk (Russia)", + "Khanty-Mansi (Russia)", + "Kurgan (Russia)", + "Orenburg (Russia)", + "Perm (Russia)", + "Sverdlovsk (Russia)", + "Tyumen (Russia)", + "Yamalia (Russia)", "Tajikistan", "Turkmenistan", "Uzbekistan" @@ -615,7 +615,7 @@ "British Indian Ocean Territory", "Kazakhstan (most)", "Kyrgyzstan", - "Russia: Omsk" + "Omsk (Russia)" ] }, { @@ -634,22 +634,22 @@ "Countries": [ "Cambodia", "Christmas Island", - "Indonesia: Central Kalimantan", - "Indonesia: Java", - "Indonesia: Sumatra", - "Indonesia: West Kalimantan", + "Central Kalimantan (Indonesia)", + "Java (Indonesia)", + "Sumatra (Indonesia)", + "West Kalimantan (Indonesia)", "Laos", - "Mongolia: Bayan-Ölgii", - "Mongolia: Khovd", - "Mongolia: Uvs", - "Russia: Altai Krai", - "Russia: Altai Republic", - "Russia: Kemerovo", - "Russia: Khakassia", - "Russia: Krasnoyarsk", - "Russia: Novosibirsk", - "Russia: Tomsk", - "Russia: Tuva", + "Bayan-Ölgii (Mongolia)", + "Khovd (Mongolia)", + "Uvs (Mongolia)", + "Altai Krai (Russia)", + "Altai Republic (Russia)", + "Kemerovo (Russia)", + "Khakassia (Russia)", + "Krasnoyarsk (Russia)", + "Novosibirsk (Russia)", + "Tomsk (Russia)", + "Tuva (Russia)", "Thailand", "Vietnam" ] @@ -663,19 +663,19 @@ "Brunei", "China", "Hong Kong", - "Indonesia: Bali", - "Indonesia: East Kalimantan", - "Indonesia: East Nusa Tenggara", - "Indonesia: North Kalimantan", - "Indonesia: South Kalimantan", - "Indonesia: Sulawesi", - "Indonesia: West Nusa Tenggara", + "Bali (Indonesia)", + "East Kalimantan (Indonesia)", + "East Nusa Tenggara (Indonesia)", + "North Kalimantan (Indonesia)", + "South Kalimantan (Indonesia)", + "Sulawesi (Indonesia)", + "West Nusa Tenggara (Indonesia)", "Macau", "Malaysia", "Mongolia (most)", "Philippines", - "Russia: Buryatia", - "Russia: Irkutsk", + "Buryatia (Russia)", + "Irkutsk (Russia)", "Singapore", "Taiwan" ] @@ -694,16 +694,16 @@ "Name": "Eastern Indonesian Time", "Countries": [ "East Timor", - "Indonesia: Maluku", - "Indonesia: North Maluku", - "Indonesia: Papua", - "Indonesia: West Papua", + "Maluku (Indonesia)", + "North Maluku (Indonesia)", + "Papua (Indonesia)", + "West Papua (Indonesia)", "Japan", "North Korea", "Palau", - "Russia: Amur", - "Russia: Sakha (most)", - "Russia: Zabaykalsky", + "Amur (Russia)", + "Sakha (most, Russia)", + "Zabaykalsky (Russia)", "South Korea" ] }, @@ -720,23 +720,23 @@ "DaylightSavingTime": true, "Name": "Central Standard Time", "Countries": [ - "Australia: South Australia" + "South Australia (Australia)" ] }, { "Offset": "10:00", "DaylightSavingTime": false, "Countries": [ - "Australia: Queensland", + "Queensland (Australia)", "Guam", - "Micronesia: Chuuk", - "Micronesia: Yap", + "Chuuk (Micronesia)", + "Yap (Micronesia)", "Northern Mariana Islands", "Papua New Guinea (most)", - "Russia: Jewish", - "Russia: Khabarovsk", - "Russia: Primorsky", - "Russia: Sakha (central-east)" + "Jewish (Russia)", + "Khabarovsk (Russia)", + "Primorsky (Russia)", + "Sakha (central-east, Russia)" ] }, { @@ -744,18 +744,18 @@ "DaylightSavingTime": true, "Name": "Vladivostok Time", "Countries": [ - "Australia: Australian Capital Territory", - "Australia: Jervis Bay Territory", - "Australia: New South Wales (most)", - "Australia: Tasmania", - "Australia: Victoria" + "Australian Capital Territory (Australia)", + "Jervis Bay Territory (Australia)", + "New South Wales (most, Australia)", + "Tasmania (Australia)", + "Victoria (Australia)" ] }, { "Offset": "10:30", "DaylightSavingTime": true, "Countries": [ - "Australia: Lord Howe Island" + "Lord Howe Island (Australia)" ] }, { @@ -763,13 +763,13 @@ "DaylightSavingTime": false, "Name": "Magadan Time", "Countries": [ - "Micronesia: Kosrae", - "Micronesia: Pohnpei", + "Kosrae (Micronesia)", + "Pohnpei (Micronesia)", "New Caledonia", - "Papua New Guinea: Bougainville", - "Russia: Magadan", - "Russia: Sakha (east)", - "Russia: Sakhalin", + "Bougainville (Papua New Guinea)", + "Magadan (Russia)", + "Sakha (east, Russia)", + "Sakhalin (Russia)", "Solomon Islands", "Vanuatu" ] @@ -787,11 +787,11 @@ "Name": "Kamchatka Time", "Countries": [ "Fiji", - "Kiribati: Gilbert Islands", + "Gilbert Islands (Kiribati)", "Marshall Islands", "Nauru", - "Russia: Chukotka", - "Russia: Kamchatka", + "Chukotka (Russia)", + "Kamchatka (Russia)", "Tuvalu", "Wake Island", "Wallis and Futuna" @@ -809,7 +809,7 @@ "DaylightSavingTime": true, "Name": "Chatham Standard Time", "Countries": [ - "New Zealand: Chatham Islands" + "Chatham Islands (New Zealand)" ] }, { @@ -817,7 +817,7 @@ "DaylightSavingTime": false, "Name": "", "Countries": [ - "Kiribati: Phoenix Islands", + "Phoenix Islands (Kiribati)", "Samoa", "Tokelau", "Tonga" @@ -827,7 +827,7 @@ "Offset": "14:00", "DaylightSavingTime": false, "Countries": [ - "Kiribati: Line Islands" + "Line Islands (Kiribati)" ] } ] From c2d8d151e1ff56127921d4a70c850434ac9bc3d7 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 22 Oct 2021 11:35:15 +0200 Subject: [PATCH 15/67] Improved Subtitle for many matched countries and allow full offset search (+ and -) --- .../Extensions/StringBuilderExtensions.cs | 32 +++++ .../Helper/ResultHelper.cs | 119 ++++++++++++++---- 2 files changed, 130 insertions(+), 21 deletions(-) create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs new file mode 100644 index 00000000000..128fe49a135 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Text; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Extensions +{ + /// + /// Extensions for -Objects + /// + internal static class StringBuilderExtensions + { + /// + /// Save append the given value with the given maximum length to the + /// + /// The to append the string. + /// The value that should be append. + /// The max length of the value that should append. + internal static void SaveAppend(this StringBuilder stringBuilder, string value, int maxLength) + { + if (value.Length > maxLength) + { + stringBuilder.Append(value, 0, maxLength); + } + else + { + stringBuilder.Append(value); + } + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 203faee8a7c..374faf9c035 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -5,7 +5,9 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text; using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Extensions; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Mono.Collections.Generic; using Wox.Plugin; @@ -48,6 +50,25 @@ internal static IEnumerable GetResults(IEnumerable timeZone /// if it's match, otherwise . private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) { + // allow search for "-x:xx" + if (search.StartsWith('-') && timeZone.Offset.StartsWith('-')) + { + if (timeZone.Offset.ElementAtOrDefault(1) == '0') + { + if (timeZone.Offset.Substring(2).StartsWith(search.Substring(1), StringComparison.InvariantCultureIgnoreCase)) + { + return true; + } + } + } + + // allow search for "+xx:xx" + if (search.StartsWith('+') && timeZone.Offset.StartsWith(search.Substring(1), StringComparison.InvariantCultureIgnoreCase)) + { + return true; + } + + // "-1x:xx" match here if (timeZone.Offset.Contains(search, StringComparison.InvariantCultureIgnoreCase)) { return true; @@ -58,8 +79,7 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) return true; } - if (timeZone.Shortcut != null - && timeZone.Shortcut.Contains(search, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.Shortcut.Contains(search, StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -147,15 +167,18 @@ private static string GetTitle(OneTimeZone timeZone, DateTime utcNow) private static string GetToolTip(OneTimeZone timeZone) { var useDst = timeZone.DaylightSavingTime ? Resources.Yes : Resources.No; - + var fullTimeOffset = GetFullOffset(timeZone); var countries = GetCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); - var result = $"{Environment.NewLine}{Resources.Name}: {timeZone.Name}" - + $"{Environment.NewLine}{Resources.Offset}: {GetFullOffset(timeZone)}" - + $"{Environment.NewLine}{Resources.DaylightSavingTime}:{useDst}" - + $"{Environment.NewLine}{Resources.Countries}:{countries}"; + var stringBuilder = new StringBuilder(); - return result; + stringBuilder.Append(Resources.Name).Append(':').Append(' ').AppendLine(timeZone.Name); + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(fullTimeOffset); + stringBuilder.Append(Resources.DaylightSavingTime).Append(':').Append(' ').AppendLine(useDst); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Countries).Append(':').Append(' ').AppendLine(countries); + + return stringBuilder.ToString(); } private static (byte hours, byte minutes) GetHoursAndMinutes(OneTimeZone timeZone) @@ -164,7 +187,7 @@ private static (byte hours, byte minutes) GetHoursAndMinutes(OneTimeZone timeZon if (timeZone.Offset.StartsWith("-", StringComparison.InvariantCultureIgnoreCase)) { - offset = timeZone.Offset.Substring(1); + offset = timeZone.Offset[1..]; } else { @@ -192,7 +215,6 @@ private static string GetCountries(OneTimeZone timeZone, string search, int maxL } else { - // INFO: I'm not sure if "CurrentCultureIgnoreCase" is correct here countries = timeZone.Countries.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); if (!countries.Any()) { @@ -200,23 +222,78 @@ private static string GetCountries(OneTimeZone timeZone, string search, int maxL } } - var result = countries.Aggregate(string.Empty, (current, next) - => current.Length == 0 ? next : $"{current}, {next}"); + var stringBuilder = new StringBuilder(); + var lastEntry = countries.LastOrDefault(); - // To many countries => reduce length, first pass - if (result.Length > maxLength) + foreach (var country in countries) { - result = countries.Aggregate(string.Empty, (current, next) - => current.Length == 0 ? $"{next[..3]}..." : $"{current}, {next[..3]}..."); + stringBuilder.Append(country); + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } } - // To many countries => reduce length, second pass - if (result.Length > maxLength) + // To many countries (first pass) => remove extra info + if (stringBuilder.Length > maxLength) { - result = $"{result[..maxLength]}..."; + stringBuilder.Clear(); + + foreach (var country in countries) + { + var extraInfoStart = country.IndexOf('(', StringComparison.InvariantCultureIgnoreCase); + if (extraInfoStart > 0) + { + stringBuilder.Append(country[..extraInfoStart]); + } + else + { + stringBuilder.Append(country); + } + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } } - return result; + // To many countries (second pass) => remove extra info and cut country length + if (stringBuilder.Length > maxLength) + { + foreach (var country in countries) + { + var extraInfoStart = country.IndexOf('(', StringComparison.InvariantCultureIgnoreCase); + if (extraInfoStart > 0) + { + stringBuilder.SaveAppend(country[..extraInfoStart], maxLength: 5); + } + else + { + stringBuilder.SaveAppend(country, maxLength: 5); + } + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + } + + // To many countries (third pass) => cut text length + if (stringBuilder.Length > maxLength) + { + stringBuilder.Length = maxLength - 3; + stringBuilder.Append('.'); + stringBuilder.Append('.'); + stringBuilder.Append('.'); + } + + return stringBuilder.ToString(); } private static string GetFullOffset(OneTimeZone timeZone) @@ -227,7 +304,7 @@ private static string GetFullOffset(OneTimeZone timeZone) if (timeZone.Offset.StartsWith('-')) { - result = "-{hours}:{minutes:00}"; + result = $"-{hours}:{minutes:00}"; } else { From 266421c5fa5e8284515c469bcc661c0a26b603e2 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 27 Oct 2021 08:34:24 +0200 Subject: [PATCH 16/67] Allow more than one names for time zones and remove leftover --- .../Classes/OneTimeZone.cs | 4 +- .../Classes/TimeZoneInfoExtended.cs | 252 ------------------ .../Helper/ResultHelper.cs | 98 +++++-- .../Properties/Resources.Designer.cs | 6 +- .../Properties/Resources.resx | 4 +- .../timeZones.schema.json | 36 ++- .../timezones.json | 85 +++--- 7 files changed, 136 insertions(+), 349 deletions(-) delete mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index 819ec3b3ccd..ff224f6aecd 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -12,7 +12,7 @@ public sealed class OneTimeZone public OneTimeZone() { Offset = "0:00"; - Name = string.Empty; + Names = Enumerable.Empty(); Shortcut = string.Empty; Countries = Enumerable.Empty(); } @@ -23,7 +23,7 @@ public OneTimeZone() public bool DaylightSavingTime { get; set; } - public string Name { get; set; } + public IEnumerable Names { get; set; } public IEnumerable Countries { get; set; } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs deleted file mode 100644 index fe745dda053..00000000000 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneInfoExtended.cs +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) Microsoft Corporation -// The Microsoft Corporation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Security; -using System.Text; -using Wox.Plugin.Logger; - -namespace Microsoft.PowerToys.Run.Plugin.TimeZone -{ - /// - /// A extended version of - /// with additional fields to easier find a time zone. - /// - internal sealed class TimeZoneInfoExtended - { - /// - /// The underling of this . - /// - private TimeZoneInfo? _underlyingTimeZone; - - /// - /// Initializes a new instance of the class. - /// - public TimeZoneInfoExtended() - { - DisplayName = string.Empty; - StandardName = string.Empty; - DaylightName = string.Empty; - Id = string.Empty; - Offset = string.Empty; - StandardShortcut = string.Empty; - DaylightShortcut = string.Empty; - } - - // TODO: Remove after JSON is used - internal TimeZoneInfoExtended(TimeZoneInfo timeZone) - { - Id = timeZone.Id; - - Offset = $"{timeZone.BaseUtcOffset:hh\\:mm}"; - - if (Offset.StartsWith("0", StringComparison.InvariantCultureIgnoreCase)) - { - Offset = Offset.Substring(1); - } - - if (!Offset.StartsWith("+", StringComparison.InvariantCultureIgnoreCase)) - { - Offset = $"+{Offset}"; - } - - StandardName = timeZone.StandardName; - StandardShortcut = GetShortcut(StandardName); - DisplayName = timeZone.DisplayName; - - if (!timeZone.SupportsDaylightSavingTime) - { - DaylightName = timeZone.DaylightName; - DaylightShortcut = GetShortcut(DaylightName); - } - } - - // TODO: Remove after JSON is used - private static string? GetShortcut(string name) - { - if (name.StartsWith("UTC", StringComparison.InvariantCultureIgnoreCase)) - { - return null; - } - - var result = new StringBuilder(); - - foreach (var ch in name) - { - if (ch >= 'A' && ch <= 'Z') - { - result.Append(ch); - } - } - - if (result.Length == 0) - { - return null; - } - - return result.ToString(); - } - - /// - /// Gets or sets the general display name that represents the time zone. - /// - internal string DisplayName { get; set; } - - /// - /// Gets or sets the search-able time difference between the current time zone's standard time and Coordinated Universal Time (UTC). - /// - public string Offset { get; set; } - - /// - /// Gets or sets the time zone identifier. - /// - public string Id { get; set; } - - /// - /// Gets or sets the display name for the time zone's standard time. - /// - public string StandardName { get; set; } - - /// - /// Gets or sets the shortcut of the display name for the time zone's standard time. - /// - public string? StandardShortcut { get; set; } - - /// - /// Gets or sets the display name for the current time zone's daylight saving time. - /// - public string? DaylightName { get; set; } - - /// - /// Gets or sets the shortcut of the display name for the current time zone's daylight saving time. - /// - public string? DaylightShortcut { get; set; } - - /// - /// Indicates whether a specified date and time falls in the range of daylight saving - /// time for the time zone of the current System.TimeZoneInfo object. - /// - /// A date and time value. - /// if the dateTime parameter is a daylight saving time; otherwise, . - internal bool IsDaylightSavingTime(DateTime dateTime) - { - var result = false; - - FindTimeZone(); - if (_underlyingTimeZone is null) - { - return result; - } - - if (!_underlyingTimeZone.SupportsDaylightSavingTime) - { - return result; - } - - try - { - result = _underlyingTimeZone.IsDaylightSavingTime(dateTime); - } - catch (ArgumentException exception) - { - Log.Exception( - "The System.DateTime.Kind property of the dateTime value is System.DateTimeKind.Local and dateTime is an invalid time.", - exception, - typeof(TimeZoneInfoExtended)); - } - - return result; - } - - /// - /// Converts a time to the time in a particular time zone. - /// - /// The date and time to convert. - /// The date and time in this time zone. - internal DateTime ConvertTime(DateTime dateTime) - { - var result = DateTime.MinValue; - - FindTimeZone(); - if (_underlyingTimeZone is null) - { - return result; - } - - try - { - result = TimeZoneInfo.ConvertTime(dateTime, _underlyingTimeZone); - } - catch (ArgumentNullException exception) - { - Log.Exception( - "The value of the destinationTimeZone parameter is null.", - exception, - typeof(TimeZoneInfoExtended)); - } - catch (ArgumentException exception) - { - Log.Exception( - "The value of the dateTime parameter represents an invalid time.", - exception, - typeof(TimeZoneInfoExtended)); - } - - return result; - } - - /// - /// Try to find a that have the same - /// The is need for the time calculation. - /// - internal void FindTimeZone() - { - if (_underlyingTimeZone is null) - { - try - { - _underlyingTimeZone = TimeZoneInfo.FindSystemTimeZoneById(Id); - } - catch (OutOfMemoryException exception) - { - Log.Exception( - "The system does not have enough memory to hold information about the time zone.", - exception, - typeof(TimeZoneInfoExtended)); - } - catch (ArgumentNullException exception) - { - Log.Exception( - "The id parameter is null.", - exception, - typeof(TimeZoneInfoExtended)); - } - catch (TimeZoneNotFoundException exception) - { - Log.Exception( - "The time zone identifier specified by id was not found." - + " This means that a time zone identifier whose name matches id does not exist," - + " or that the identifier exists but does not contain any time zone data.", - exception, - typeof(TimeZoneInfoExtended)); - } - catch (SecurityException exception) - { - Log.Exception( - "The process does not have the permissions required to read from the registry key" - + " that contains the time zone information.", - exception, - typeof(TimeZoneInfoExtended)); - } - catch (InvalidTimeZoneException exception) - { - Log.Exception( - "The time zone identifier was found, but the registry data is corrupted.", - exception, - typeof(TimeZoneInfoExtended)); - } - } - } - } -} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 374faf9c035..dfebb4fdfb3 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -43,9 +43,9 @@ internal static IEnumerable GetResults(IEnumerable timeZone } /// - /// Check if the given contains a value that match the given . + /// Check if the given contains a value that match the given . /// - /// The to check. + /// The to check. /// The that should match. /// if it's match, otherwise . private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) @@ -74,7 +74,8 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) return true; } - if (timeZone.Name.Contains(search, StringComparison.CurrentCultureIgnoreCase)) + if (timeZone.Names != null + & timeZone.Names.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) { return true; } @@ -94,17 +95,17 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) } /// - /// Return a based on the given . + /// Return a based on the given . /// - /// The that contain the information for the . + /// The that contain the information for the . /// The current time in UTC for the . /// A . private static Result GetResult(OneTimeZone timeZone, DateTime utcNow, string search, string iconPath) { - // TODO: revisit time zone names, maybe a list of time zone names + // TODO: revisit time zone names // TODO: add standard and DST time zone names // TODO: add shortcuts - var title = GetTitle(timeZone, utcNow); + var title = GetTitle(timeZone, search, utcNow); var result = new Result { @@ -141,27 +142,12 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow) return result; } - private static string GetTitle(OneTimeZone timeZone, DateTime utcNow) + private static string GetTitle(OneTimeZone timeZone, string search, DateTime utcNow) { - string timeZoneName; - - if (string.IsNullOrEmpty(timeZone.Name)) - { - timeZoneName = $"UTC{GetFullOffset(timeZone)}"; - - if (timeZone.DaylightSavingTime) - { - timeZoneName = $"{timeZoneName} - {Resources.DaylightSavingTime}"; - } - } - else - { - timeZoneName = timeZone.Name; - } - var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow); + var timeZoneNames = GetNames(timeZone, search, maxLength: 50); - return $"{timeInZoneTime:HH:mm:ss} - {timeZoneName}"; + return $"{timeInZoneTime:HH:mm:ss} - {timeZoneNames}"; } private static string GetToolTip(OneTimeZone timeZone) @@ -169,10 +155,11 @@ private static string GetToolTip(OneTimeZone timeZone) var useDst = timeZone.DaylightSavingTime ? Resources.Yes : Resources.No; var fullTimeOffset = GetFullOffset(timeZone); var countries = GetCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); + var names = GetNames(timeZone, search: string.Empty, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Name).Append(':').Append(' ').AppendLine(timeZone.Name); + stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(fullTimeOffset); stringBuilder.Append(Resources.DaylightSavingTime).Append(':').Append(' ').AppendLine(useDst); stringBuilder.AppendLine(string.Empty); @@ -296,6 +283,65 @@ private static string GetCountries(OneTimeZone timeZone, string search, int maxL return stringBuilder.ToString(); } + private static string GetNames(OneTimeZone timeZone, string search, int maxLength) + { + IEnumerable names; + + // TODO: translate country names + if (string.IsNullOrWhiteSpace(search)) + { + names = timeZone.Names; + } + else + { + names = timeZone.Countries.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); + if (!names.Any()) + { + names = timeZone.Countries; + } + } + + var stringBuilder = new StringBuilder(); + var lastEntry = names.LastOrDefault(); + + foreach (var name in names) + { + stringBuilder.Append(name); + + if (name != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + + // To many names (first pass) => cut name length + if (stringBuilder.Length > maxLength) + { + foreach (var country in names) + { + stringBuilder.SaveAppend(country, maxLength: 5); + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + } + + // To many names (third pass) => cut text length + if (stringBuilder.Length > maxLength) + { + stringBuilder.Length = maxLength - 3; + stringBuilder.Append('.'); + stringBuilder.Append('.'); + stringBuilder.Append('.'); + } + + return stringBuilder.ToString(); + } + private static string GetFullOffset(OneTimeZone timeZone) { var (hours, minutes) = GetHoursAndMinutes(timeZone); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 51eb4c6f0aa..c5ca9fbe845 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -88,11 +88,11 @@ internal static string DaylightSavingTime { } /// - /// Looks up a localized string similar to Name. + /// Looks up a localized string similar to Names. /// - internal static string Name { + internal static string Names { get { - return ResourceManager.GetString("Name", resourceCulture); + return ResourceManager.GetString("Names", resourceCulture); } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index c2fe6a2969a..b4012cbfe39 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -126,8 +126,8 @@ Daylight saving time - - Name + + Names No diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json index 8b8449094bd..1250c866dd3 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json @@ -1,39 +1,33 @@ { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", - "properties": - { - "TimeZones": - { + "properties": { + "TimeZones": { "type": "array", - "items": - { + "items": { "type": "object", "additionalProperties": false, - "properties": - { - "Offset": - { + "properties": { + "Offset": { "type": "string" }, - "Name": - { - "type": "string" + "Name": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } }, - "Shortcut": - { + "Shortcut": { "type": "string" }, - "DaylightSavingTime": - { + "DaylightSavingTime": { "type": "boolean" }, - "Countries": - { + "Countries": { "type": "array", "uniqueItems": true, - "items": - { + "items": { "type": "string" } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 728f76fd645..f882bc365ad 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -5,7 +5,7 @@ { "Offset": "-12:00", "DaylightSavingTime": false, - "Name": "International Date Line", + "Name": [ "International Date Line" ], "Countries": [ "Baker Island", "Howland Island" @@ -14,7 +14,7 @@ { "Offset": "-11:00", "DaylightSavingTime": false, - "Name": "Samoa Time Zone", + "Name": [ "Samoa Time Zone" ], "Countries": [ "American Samoa", @@ -28,7 +28,7 @@ { "Offset": "-10:00", "DaylightSavingTime": false, - "Name": "Hawaii–Aleutian Time Zone", + "Name": [ "Hawaii–Aleutian Time Zone" ], "Countries": [ "Cook Islands", "French Polynesia (most)", @@ -39,7 +39,7 @@ { "Offset": "-10:00", "DaylightSavingTime": true, - "Name": "Hawaii–Aleutian Time Zone", + "Name": [ "Hawaii–Aleutian Time Zone" ], "Countries": [ "Andreanof Islands (United States)", "Islands of Four Mountains (United States)", @@ -57,7 +57,7 @@ { "Offset": "-09:00", "DaylightSavingTime": false, - "Name": "Alaska Time Zone", + "Name": [ "Alaska Time Zone" ], "Countries": [ "Gambier Islands (French Polynesia)" ] @@ -65,7 +65,7 @@ { "Offset": "-09:00", "DaylightSavingTime": true, - "Name": "Alaska Time Zone", + "Name": [ "Alaska Time Zone" ], "Countries": [ "Alaska (most, United States)" ] @@ -73,7 +73,7 @@ { "Offset": "-08:00", "DaylightSavingTime": false, - "Name": "Pacific Time Zone", + "Name": [ "Pacific Time Zone" ], "Countries": [ "Clipperton Island", "Pitcairn Islands" @@ -82,7 +82,7 @@ { "Offset": "-08:00", "DaylightSavingTime": true, - "Name": "Alaska Time Zone", + "Name": [ "Alaska Time Zone" ], "Countries": [ "British Columbia (most, Canada)", "Baja California (Mexico)", @@ -96,7 +96,7 @@ { "Offset": "-07:00", "DaylightSavingTime": false, - "Name": "Mountain Time Zone", + "Name": [ "Mountain Time Zone" ], "Countries": [ "British Columbia (northeast, Canada)", "Yukon (Canada)", @@ -107,7 +107,7 @@ { "Offset": "-07:00", "DaylightSavingTime": true, - "Name": "Mountain Time Zone", + "Name": [ "Mountain Time Zone" ], "Countries": [ "Alberta (Canada)", "British Columbia (southeast, Canada)", @@ -128,7 +128,7 @@ { "Offset": "-06:00", "DaylightSavingTime": false, - "Name": "Central Time Zone", + "Name": [ "Central Time Zone" ], "Countries": [ "Belize", "Saskatchewan (most, Canada)", @@ -143,7 +143,7 @@ { "Offset": "-06:00", "DaylightSavingTime": true, - "Name": "Central Time Zone", + "Name": [ "Central Time Zone" ], "Countries": [ "Manitoba (Canada)", "Nunavut (central, Canada)", @@ -171,7 +171,7 @@ { "Offset": "-05:00", "DaylightSavingTime": false, - "Name": "Eastern Time Zone", + "Name": [ "Eastern Time Zone" ], "Countries": [ "Acre (Brazil)", "Atikokan (Canada)", @@ -190,7 +190,7 @@ { "Offset": "-05:00", "DaylightSavingTime": true, - "Name": "Eastern Time Zone", + "Name": [ "Eastern Time Zone" ], "Countries": [ "Bahamas", "Nunavut (east, Canada)", @@ -226,7 +226,7 @@ { "Offset": "-04:00", "DaylightSavingTime": false, - "Name": "Atlantic Time Zone", + "Name": [ "Atlantic Time Zone" ], "Countries": [ "Anguilla", "Antigua and Barbuda", @@ -264,7 +264,7 @@ { "Offset": "-04:00", "DaylightSavingTime": true, - "Name": "Atlantic Time Zone", + "Name": [ "Atlantic Time Zone" ], "Countries": [ "Bermuda", "Labrador (most, Canada)", @@ -279,7 +279,7 @@ { "Offset": "-03:30", "DaylightSavingTime": true, - "Name": "Newfoundland Time Zone", + "Name": [ "Newfoundland Time Zone" ], "Countries": [ "Newfoundland (Canada)", "Labrador (southeast, Canada)" @@ -332,7 +332,7 @@ { "Offset": "00:00", "DaylightSavingTime": false, - "Name": "Western European Time", + "Name": [ "Western European Time" ], "Countries": [ "Ascension and Tristan da Cunha", "Burkina Faso", @@ -356,7 +356,7 @@ { "Offset": "00:00", "DaylightSavingTime": true, - "Name": "Western European Time", + "Name": [ "Western European Time" ], "Countries": [ "Canary Islands", "Faroe Islands", @@ -371,7 +371,7 @@ { "Offset": "01:00", "DaylightSavingTime": false, - "Name": "Central European Time", + "Name": [ "Central European Time" ], "Countries": [ "Algeria", "Angola", @@ -402,7 +402,7 @@ { "Offset": "01:00", "DaylightSavingTime": true, - "Name": "Central European Time", + "Name": [ "Central European Time" ], "Countries": [ "Albania", "Andorra", @@ -440,7 +440,7 @@ { "Offset": "02:00", "DaylightSavingTime": false, - "Name": "Eastern European Time", + "Name": [ "Eastern European Time" ], "Countries": [ "Botswana", "Burundi", @@ -464,7 +464,7 @@ { "Offset": "02:00", "DaylightSavingTime": true, - "Name": "Eastern European Time", + "Name": [ "Eastern European Time" ], "Countries": [ "Akrotiri and Dhekelia", "Bulgaria", @@ -488,7 +488,7 @@ { "Offset": "03:00", "DaylightSavingTime": false, - "Name": "Further-eastern European Time", + "Name": [ "Further-eastern European Time" ], "Countries": [ "Abkhazia", "Bahrain", @@ -522,7 +522,7 @@ { "Offset": "03:30", "DaylightSavingTime": true, - "Name": "Iran Standard Time", + "Name": [ "Iran Standard Time" ], "Countries": [ "Iran" ] @@ -530,7 +530,7 @@ { "Offset": "04:00", "DaylightSavingTime": true, - "Name": "Samara Time", + "Name": [ "Samara Time" ], "Countries": [ "Armenia", "Artsakh", @@ -552,7 +552,7 @@ { "Offset": "04:30", "DaylightSavingTime": false, - "Name": "Afghanistan Time", + "Name": [ "Afghanistan Time" ], "Countries": [ "Afghanistan" ] @@ -560,7 +560,7 @@ { "Offset": "05:00", "DaylightSavingTime": false, - "Name": "Pakistan Standard Time", + "Name": [ "Pakistan Standard Time" ], "Countries": [ "Amsterdam Island (French Southern and Antarctic Lands)", "Kerguelen Islands (French Southern and Antarctic Lands)", @@ -591,7 +591,7 @@ { "Offset": "05:30", "DaylightSavingTime": false, - "Name": "Indian Standard Time", + "Name": [ "Indian Standard Time" ], "Countries": [ "India", "Sri Lanka" @@ -600,7 +600,7 @@ { "Offset": "05:45", "DaylightSavingTime": false, - "Name": "Nepal Standard Time", + "Name": [ "Nepal Standard Time" ], "Countries": [ "Nepal" ] @@ -608,7 +608,7 @@ { "Offset": "06:00", "DaylightSavingTime": false, - "Name": "Bangladesh Standard Time", + "Name": [ "Bangladesh Standard Time" ], "Countries": [ "Bangladesh", "Bhutan", @@ -621,7 +621,7 @@ { "Offset": "06:30", "DaylightSavingTime": false, - "Name": "Myanmar Standard Time", + "Name": [ "Myanmar Standard Time" ], "Countries": [ "Cocos Islands", "Myanmar" @@ -630,7 +630,7 @@ { "Offset": "07:00", "DaylightSavingTime": false, - "Name": "Western Indonesian Time", + "Name": [ "Western Indonesian Time" ], "Countries": [ "Cambodia", "Christmas Island", @@ -657,7 +657,7 @@ { "Offset": "08:00", "DaylightSavingTime": false, - "Name": "Central Indonesian Time", + "Name": [ "Central Indonesian Time" ], "Countries": [ "Australia: Western Australia (most)", "Brunei", @@ -683,7 +683,7 @@ { "Offset": "08:45", "DaylightSavingTime": false, - "Name": "Central Western Standard Time", + "Name": [ "Central Western Standard Time" ], "Countries": [ "Eucla" ] @@ -691,7 +691,7 @@ { "Offset": "09:00", "DaylightSavingTime": false, - "Name": "Eastern Indonesian Time", + "Name": [ "Eastern Indonesian Time" ], "Countries": [ "East Timor", "Maluku (Indonesia)", @@ -710,7 +710,7 @@ { "Offset": "09:30", "DaylightSavingTime": false, - "Name": "Central Standard Time", + "Name": [ "Central Standard Time" ], "Countries": [ "Northern Territory" ] @@ -718,7 +718,7 @@ { "Offset": "09:30", "DaylightSavingTime": true, - "Name": "Central Standard Time", + "Name": [ "Central Standard Time" ], "Countries": [ "South Australia (Australia)" ] @@ -742,7 +742,7 @@ { "Offset": "10:00", "DaylightSavingTime": true, - "Name": "Vladivostok Time", + "Name": [ "Vladivostok Time" ], "Countries": [ "Australian Capital Territory (Australia)", "Jervis Bay Territory (Australia)", @@ -761,7 +761,7 @@ { "Offset": "11:00", "DaylightSavingTime": false, - "Name": "Magadan Time", + "Name": [ "Magadan Time" ], "Countries": [ "Kosrae (Micronesia)", "Pohnpei (Micronesia)", @@ -784,7 +784,7 @@ { "Offset": "12:00", "DaylightSavingTime": false, - "Name": "Kamchatka Time", + "Name": [ "Kamchatka Time" ], "Countries": [ "Fiji", "Gilbert Islands (Kiribati)", @@ -807,7 +807,7 @@ { "Offset": "12:45", "DaylightSavingTime": true, - "Name": "Chatham Standard Time", + "Name": [ "Chatham Standard Time" ], "Countries": [ "Chatham Islands (New Zealand)" ] @@ -815,7 +815,6 @@ { "Offset": "13:00", "DaylightSavingTime": false, - "Name": "", "Countries": [ "Phoenix Islands (Kiribati)", "Samoa", From 70f00dfed081dc56720dc9e2587c8c9fdd631586 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 27 Oct 2021 08:52:57 +0200 Subject: [PATCH 17/67] Add military time zone names, and fix name result --- .../Helper/ResultHelper.cs | 4 +- .../timeZones.schema.json | 2 +- .../timezones.json | 94 ++++++++++--------- 3 files changed, 54 insertions(+), 46 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index dfebb4fdfb3..8cdf2212f16 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -294,10 +294,10 @@ private static string GetNames(OneTimeZone timeZone, string search, int maxLengt } else { - names = timeZone.Countries.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); + names = timeZone.Names.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); if (!names.Any()) { - names = timeZone.Countries; + names = timeZone.Names; } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json index 1250c866dd3..b46639702fc 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json @@ -11,7 +11,7 @@ "Offset": { "type": "string" }, - "Name": { + "Names": { "type": "array", "uniqueItems": true, "items": { diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index f882bc365ad..cad763cb5fd 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -5,7 +5,7 @@ { "Offset": "-12:00", "DaylightSavingTime": false, - "Name": [ "International Date Line" ], + "Names": [ "International Date Line", "Yankee Time Zone" ], "Countries": [ "Baker Island", "Howland Island" @@ -14,7 +14,7 @@ { "Offset": "-11:00", "DaylightSavingTime": false, - "Name": [ "Samoa Time Zone" ], + "Names": [ "Samoa Time Zone", "X-ray Time Zone" ], "Countries": [ "American Samoa", @@ -28,7 +28,7 @@ { "Offset": "-10:00", "DaylightSavingTime": false, - "Name": [ "Hawaii–Aleutian Time Zone" ], + "Names": [ "Hawaii–Aleutian Time Zone", "Whiskey Time Zone" ], "Countries": [ "Cook Islands", "French Polynesia (most)", @@ -39,7 +39,7 @@ { "Offset": "-10:00", "DaylightSavingTime": true, - "Name": [ "Hawaii–Aleutian Time Zone" ], + "Names": [ "Hawaii–Aleutian Time Zone", "Whiskey Time Zone" ], "Countries": [ "Andreanof Islands (United States)", "Islands of Four Mountains (United States)", @@ -57,7 +57,7 @@ { "Offset": "-09:00", "DaylightSavingTime": false, - "Name": [ "Alaska Time Zone" ], + "Names": [ "Alaska Time Zone", "Victor Time Zone" ], "Countries": [ "Gambier Islands (French Polynesia)" ] @@ -65,7 +65,7 @@ { "Offset": "-09:00", "DaylightSavingTime": true, - "Name": [ "Alaska Time Zone" ], + "Names": [ "Alaska Time Zone", "Victor Time Zone" ], "Countries": [ "Alaska (most, United States)" ] @@ -73,7 +73,7 @@ { "Offset": "-08:00", "DaylightSavingTime": false, - "Name": [ "Pacific Time Zone" ], + "Names": [ "Pacific Time Zone", "Uniform Time Zone" ], "Countries": [ "Clipperton Island", "Pitcairn Islands" @@ -82,7 +82,7 @@ { "Offset": "-08:00", "DaylightSavingTime": true, - "Name": [ "Alaska Time Zone" ], + "Names": [ "Pacific Time Zone", "Uniform Time Zone" ], "Countries": [ "British Columbia (most, Canada)", "Baja California (Mexico)", @@ -96,7 +96,7 @@ { "Offset": "-07:00", "DaylightSavingTime": false, - "Name": [ "Mountain Time Zone" ], + "Names": [ "Mountain Time Zone", "Tango Time Zone" ], "Countries": [ "British Columbia (northeast, Canada)", "Yukon (Canada)", @@ -107,7 +107,7 @@ { "Offset": "-07:00", "DaylightSavingTime": true, - "Name": [ "Mountain Time Zone" ], + "Names": [ "Mountain Time Zone", "Tango Time Zone" ], "Countries": [ "Alberta (Canada)", "British Columbia (southeast, Canada)", @@ -128,7 +128,7 @@ { "Offset": "-06:00", "DaylightSavingTime": false, - "Name": [ "Central Time Zone" ], + "Names": [ "Central Time Zone", "Sierra Time Zone" ], "Countries": [ "Belize", "Saskatchewan (most, Canada)", @@ -143,7 +143,7 @@ { "Offset": "-06:00", "DaylightSavingTime": true, - "Name": [ "Central Time Zone" ], + "Names": [ "Central Time Zone", "Sierra Time Zone" ], "Countries": [ "Manitoba (Canada)", "Nunavut (central, Canada)", @@ -171,7 +171,7 @@ { "Offset": "-05:00", "DaylightSavingTime": false, - "Name": [ "Eastern Time Zone" ], + "Names": [ "Eastern Time Zone", "Romeo Time Zone" ], "Countries": [ "Acre (Brazil)", "Atikokan (Canada)", @@ -190,7 +190,7 @@ { "Offset": "-05:00", "DaylightSavingTime": true, - "Name": [ "Eastern Time Zone" ], + "Names": [ "Eastern Time Zone", "Romeo Time Zone" ], "Countries": [ "Bahamas", "Nunavut (east, Canada)", @@ -226,7 +226,7 @@ { "Offset": "-04:00", "DaylightSavingTime": false, - "Name": [ "Atlantic Time Zone" ], + "Names": [ "Atlantic Time Zone", "Quebec Time Zone" ], "Countries": [ "Anguilla", "Antigua and Barbuda", @@ -264,7 +264,7 @@ { "Offset": "-04:00", "DaylightSavingTime": true, - "Name": [ "Atlantic Time Zone" ], + "Names": [ "Atlantic Time Zone", "Quebec Time Zone" ], "Countries": [ "Bermuda", "Labrador (most, Canada)", @@ -279,7 +279,7 @@ { "Offset": "-03:30", "DaylightSavingTime": true, - "Name": [ "Newfoundland Time Zone" ], + "Names": [ "Newfoundland Time Zone" ], "Countries": [ "Newfoundland (Canada)", "Labrador (southeast, Canada)" @@ -287,6 +287,7 @@ }, { "Offset": "-03:00", + "Names": [ "Papa Time Zone"], "DaylightSavingTime": false, "Countries": [ "Argentina", @@ -294,12 +295,13 @@ "Magallanes (Chile)", "Falkland Islands", "French Guiana", - "Suriname", + "SuriNames", "Uruguay" ] }, { "Offset": "-03:00", + "Names": [ "Papa Time Zone" ], "DaylightSavingTime": true, "Countries": [ "Greenland (most)", @@ -308,6 +310,7 @@ }, { "Offset": "-02:00", + "Names": [ "Oscar Time Zone" ], "DaylightSavingTime": false, "Countries": [ "Fernando de Noronha (Brazil)", @@ -316,6 +319,7 @@ }, { "Offset": "-01:00", + "Names": [ "November Time Zone" ], "DaylightSavingTime": false, "Countries": [ "Cape Verde" @@ -323,6 +327,7 @@ }, { "Offset": "-01:00", + "Names": [ "November Time Zone" ], "DaylightSavingTime": true, "Countries": [ "Ittoqqortoormiit (Greenland)", @@ -332,7 +337,7 @@ { "Offset": "00:00", "DaylightSavingTime": false, - "Name": [ "Western European Time" ], + "Names": [ "Western European Time", "Zulu Time Zone" ], "Countries": [ "Ascension and Tristan da Cunha", "Burkina Faso", @@ -356,7 +361,7 @@ { "Offset": "00:00", "DaylightSavingTime": true, - "Name": [ "Western European Time" ], + "Names": [ "Western European Time", "Zulu Time Zone" ], "Countries": [ "Canary Islands", "Faroe Islands", @@ -371,7 +376,7 @@ { "Offset": "01:00", "DaylightSavingTime": false, - "Name": [ "Central European Time" ], + "Names": [ "Central European Time", "Alpha Time Zone" ], "Countries": [ "Algeria", "Angola", @@ -402,7 +407,7 @@ { "Offset": "01:00", "DaylightSavingTime": true, - "Name": [ "Central European Time" ], + "Names": [ "Central European Time", "Alpha Time Zone" ], "Countries": [ "Albania", "Andorra", @@ -440,7 +445,7 @@ { "Offset": "02:00", "DaylightSavingTime": false, - "Name": [ "Eastern European Time" ], + "Names": [ "Eastern European Time", "Bravo Time Zone" ], "Countries": [ "Botswana", "Burundi", @@ -464,7 +469,7 @@ { "Offset": "02:00", "DaylightSavingTime": true, - "Name": [ "Eastern European Time" ], + "Names": [ "Eastern European Time", "Bravo Time Zone" ], "Countries": [ "Akrotiri and Dhekelia", "Bulgaria", @@ -488,7 +493,7 @@ { "Offset": "03:00", "DaylightSavingTime": false, - "Name": [ "Further-eastern European Time" ], + "Names": [ "Further-eastern European Time", "Charlie Time Zone" ], "Countries": [ "Abkhazia", "Bahrain", @@ -522,7 +527,7 @@ { "Offset": "03:30", "DaylightSavingTime": true, - "Name": [ "Iran Standard Time" ], + "Names": [ "Iran Standard Time" ], "Countries": [ "Iran" ] @@ -530,7 +535,7 @@ { "Offset": "04:00", "DaylightSavingTime": true, - "Name": [ "Samara Time" ], + "Names": [ "Samara Time", "Delta Time Zone" ], "Countries": [ "Armenia", "Artsakh", @@ -552,7 +557,7 @@ { "Offset": "04:30", "DaylightSavingTime": false, - "Name": [ "Afghanistan Time" ], + "Names": [ "Afghanistan Time" ], "Countries": [ "Afghanistan" ] @@ -560,7 +565,7 @@ { "Offset": "05:00", "DaylightSavingTime": false, - "Name": [ "Pakistan Standard Time" ], + "Names": [ "Pakistan Standard Time", "Echo Time Zone" ], "Countries": [ "Amsterdam Island (French Southern and Antarctic Lands)", "Kerguelen Islands (French Southern and Antarctic Lands)", @@ -591,7 +596,7 @@ { "Offset": "05:30", "DaylightSavingTime": false, - "Name": [ "Indian Standard Time" ], + "Names": [ "Indian Standard Time" ], "Countries": [ "India", "Sri Lanka" @@ -600,7 +605,7 @@ { "Offset": "05:45", "DaylightSavingTime": false, - "Name": [ "Nepal Standard Time" ], + "Names": [ "Nepal Standard Time" ], "Countries": [ "Nepal" ] @@ -608,7 +613,7 @@ { "Offset": "06:00", "DaylightSavingTime": false, - "Name": [ "Bangladesh Standard Time" ], + "Names": [ "Bangladesh Standard Time", "Foxtrot Time Zone" ], "Countries": [ "Bangladesh", "Bhutan", @@ -621,7 +626,7 @@ { "Offset": "06:30", "DaylightSavingTime": false, - "Name": [ "Myanmar Standard Time" ], + "Names": [ "Myanmar Standard Time" ], "Countries": [ "Cocos Islands", "Myanmar" @@ -630,7 +635,7 @@ { "Offset": "07:00", "DaylightSavingTime": false, - "Name": [ "Western Indonesian Time" ], + "Names": [ "Western Indonesian Time", "Golf Time Zone" ], "Countries": [ "Cambodia", "Christmas Island", @@ -657,7 +662,7 @@ { "Offset": "08:00", "DaylightSavingTime": false, - "Name": [ "Central Indonesian Time" ], + "Names": [ "Central Indonesian Time", "Hotel Time Zone" ], "Countries": [ "Australia: Western Australia (most)", "Brunei", @@ -683,7 +688,7 @@ { "Offset": "08:45", "DaylightSavingTime": false, - "Name": [ "Central Western Standard Time" ], + "Names": [ "Central Western Standard Time" ], "Countries": [ "Eucla" ] @@ -691,7 +696,7 @@ { "Offset": "09:00", "DaylightSavingTime": false, - "Name": [ "Eastern Indonesian Time" ], + "Names": [ "Eastern Indonesian Time", "India Time Zone" ], "Countries": [ "East Timor", "Maluku (Indonesia)", @@ -710,7 +715,7 @@ { "Offset": "09:30", "DaylightSavingTime": false, - "Name": [ "Central Standard Time" ], + "Names": [ "Central Standard Time" ], "Countries": [ "Northern Territory" ] @@ -718,13 +723,14 @@ { "Offset": "09:30", "DaylightSavingTime": true, - "Name": [ "Central Standard Time" ], + "Names": [ "Central Standard Time" ], "Countries": [ "South Australia (Australia)" ] }, { "Offset": "10:00", + "Names": [ "Kilo Time Zone" ], "DaylightSavingTime": false, "Countries": [ "Queensland (Australia)", @@ -742,7 +748,7 @@ { "Offset": "10:00", "DaylightSavingTime": true, - "Name": [ "Vladivostok Time" ], + "Names": [ "Vladivostok Time", "Kilo Time Zone" ], "Countries": [ "Australian Capital Territory (Australia)", "Jervis Bay Territory (Australia)", @@ -761,7 +767,7 @@ { "Offset": "11:00", "DaylightSavingTime": false, - "Name": [ "Magadan Time" ], + "Names": [ "Magadan Time", "Lima Time Zone" ], "Countries": [ "Kosrae (Micronesia)", "Pohnpei (Micronesia)", @@ -776,6 +782,7 @@ }, { "Offset": "11:00", + "Names": [ "Lima Time Zone" ], "DaylightSavingTime": true, "Countries": [ "Norfolk Island" @@ -784,7 +791,7 @@ { "Offset": "12:00", "DaylightSavingTime": false, - "Name": [ "Kamchatka Time" ], + "Names": [ "Kamchatka Time", "Mike Time Zone" ], "Countries": [ "Fiji", "Gilbert Islands (Kiribati)", @@ -799,6 +806,7 @@ }, { "Offset": "12:00", + "Names": [ "Mike Time Zone" ], "DaylightSavingTime": true, "Countries": [ "New Zealand" @@ -807,7 +815,7 @@ { "Offset": "12:45", "DaylightSavingTime": true, - "Name": [ "Chatham Standard Time" ], + "Names": [ "Chatham Standard Time" ], "Countries": [ "Chatham Islands (New Zealand)" ] From 50dcc5e299e18d6f71c8682810177ba88b7b8053 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 27 Oct 2021 09:37:09 +0200 Subject: [PATCH 18/67] Only use one JSON entry for one time zone --- .../Classes/OneTimeZone.cs | 23 +- .../Extensions/StringBuilderExtensions.cs | 13 ++ .../Helper/ResultHelper.cs | 215 +++++++++++++----- .../Properties/Resources.Designer.cs | 15 +- .../Properties/Resources.resx | 7 +- .../timeZones.schema.json | 11 +- .../timezones.json | 180 +++------------ 7 files changed, 249 insertions(+), 215 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index ff224f6aecd..f2f7050d24a 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -12,19 +12,32 @@ public sealed class OneTimeZone public OneTimeZone() { Offset = "0:00"; - Names = Enumerable.Empty(); Shortcut = string.Empty; + Names = Enumerable.Empty(); Countries = Enumerable.Empty(); + DstCountries = Enumerable.Empty(); } + /// + /// Gets or sets the time offset of this timezone (the gap from the UTC timezone) + /// public string Offset { get; set; } - public string Shortcut { get; set; } - - public bool DaylightSavingTime { get; set; } - + /// + /// Gets or sets a list with names of this time zone. + /// public IEnumerable Names { get; set; } + public string Shortcut { get; set; } + + /// + /// Gets or sets a list with all countries in this time zone that don't use a daylight saving time. + /// public IEnumerable Countries { get; set; } + + /// + /// Gets or sets a list with all countries in this time zone that use a daylight saving time. + /// + public IEnumerable DstCountries { get; set; } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs index 128fe49a135..082fbc239de 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs @@ -28,5 +28,18 @@ internal static void SaveAppend(this StringBuilder stringBuilder, string value, stringBuilder.Append(value); } } + + internal static void CutTooLong(this StringBuilder stringBuilder, int maxLength) + { + if (stringBuilder.Length <= maxLength) + { + return; + } + + stringBuilder.Length = maxLength - 3; + stringBuilder.Append('.'); + stringBuilder.Append('.'); + stringBuilder.Append('.'); + } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 8cdf2212f16..467ce5f89d4 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -26,15 +26,14 @@ internal static class ResultHelper /// A list with s. internal static IEnumerable GetResults(IEnumerable timeZones, string search, string iconPath) { - var results = new Collection(); + var results = new List(); var utcNow = DateTime.UtcNow; foreach (var timeZone in timeZones) { if (TimeZoneInfoMatchQuery(timeZone, search)) { - var result = GetResult(timeZone, utcNow, search, iconPath); - results.Add(result); + results.AddRange(GetResults(timeZone, utcNow, search, iconPath)); } } @@ -91,32 +90,62 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) return true; } + if (timeZone.DstCountries != null + && timeZone.DstCountries.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + { + return true; + } + return false; } /// - /// Return a based on the given . + /// Return a list with based on the given . /// /// The that contain the information for the . /// The current time in UTC for the . - /// A . - private static Result GetResult(OneTimeZone timeZone, DateTime utcNow, string search, string iconPath) + /// A list with . + private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utcNow, string search, string iconPath) { // TODO: revisit time zone names + // TODO: add time names + // TODO: don't mix time names with time zone names + // TODO: respect DST and none DST time names // TODO: add standard and DST time zone names // TODO: add shortcuts - var title = GetTitle(timeZone, search, utcNow); + var results = new Collection(); - var result = new Result + var countires = GetCountries(timeZone, search, maxLength: 100); + if (countires.Length > 0) { - ContextData = timeZone, - IcoPath = iconPath, - SubTitle = GetCountries(timeZone, search, maxLength: 100), - Title = title, - ToolTipData = new ToolTipData(title, GetToolTip(timeZone)), - }; + var title = GetTitle(timeZone, search, utcNow); - return result; + results.Add(new Result + { + ContextData = timeZone, + IcoPath = iconPath, + SubTitle = countires, + Title = title, + ToolTipData = new ToolTipData(title, GetToolTip(timeZone)), + }); + } + + var dstCountires = GetDstCountries(timeZone, search, maxLength: 100); + if (dstCountires.Length > 0) + { + var title = GetTitle(timeZone, search, utcNow.AddHours(1)); + + results.Add(new Result + { + ContextData = timeZone, + IcoPath = iconPath, + SubTitle = dstCountires, + Title = title, + ToolTipData = new ToolTipData(title, GetDstToolTip(timeZone)), + }); + } + + return results; } private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow) @@ -134,11 +163,6 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow) result = utcNow.AddHours(hours).AddMinutes(minutes); } - if (timeZone.DaylightSavingTime) - { - result = result.AddHours(1); - } - return result; } @@ -152,22 +176,40 @@ private static string GetTitle(OneTimeZone timeZone, string search, DateTime utc private static string GetToolTip(OneTimeZone timeZone) { - var useDst = timeZone.DaylightSavingTime ? Resources.Yes : Resources.No; var fullTimeOffset = GetFullOffset(timeZone); var countries = GetCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); var names = GetNames(timeZone, search: string.Empty, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(fullTimeOffset); - stringBuilder.Append(Resources.DaylightSavingTime).Append(':').Append(' ').AppendLine(useDst); + stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.No); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); stringBuilder.AppendLine(string.Empty); stringBuilder.Append(Resources.Countries).Append(':').Append(' ').AppendLine(countries); return stringBuilder.ToString(); } + private static string GetDstToolTip(OneTimeZone timeZone) + { + var fullTimeOffset = GetFullOffset(timeZone); + var dstCountries = GetDstCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); + var names = GetNames(timeZone, search: string.Empty, maxLength: int.MaxValue); + + var stringBuilder = new StringBuilder(); + + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(fullTimeOffset); + stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.Yes); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.CountriesWithDst).Append(':').Append(' ').AppendLine(dstCountries); + + return stringBuilder.ToString(); + } + private static (byte hours, byte minutes) GetHoursAndMinutes(OneTimeZone timeZone) { string offset; @@ -191,6 +233,58 @@ private static (byte hours, byte minutes) GetHoursAndMinutes(OneTimeZone timeZon return (0, 0); } + private static string GetNames(OneTimeZone timeZone, string search, int maxLength) + { + IEnumerable names; + + // TODO: translate country names + if (string.IsNullOrWhiteSpace(search)) + { + names = timeZone.Names; + } + else + { + names = timeZone.Names.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); + if (!names.Any()) + { + names = timeZone.Names; + } + } + + var stringBuilder = new StringBuilder(); + var lastEntry = names.LastOrDefault(); + + foreach (var name in names) + { + stringBuilder.Append(name); + + if (name != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + + // To many names (first pass) => cut name length + if (stringBuilder.Length > maxLength) + { + foreach (var country in names) + { + stringBuilder.SaveAppend(country, maxLength: 5); + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + } + + stringBuilder.CutTooLong(maxLength); + + return stringBuilder.ToString(); + } + private static string GetCountries(OneTimeZone timeZone, string search, int maxLength) { IEnumerable countries; @@ -203,10 +297,6 @@ private static string GetCountries(OneTimeZone timeZone, string search, int maxL else { countries = timeZone.Countries.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); - if (!countries.Any()) - { - countries = timeZone.Countries; - } } var stringBuilder = new StringBuilder(); @@ -271,56 +361,55 @@ private static string GetCountries(OneTimeZone timeZone, string search, int maxL } } - // To many countries (third pass) => cut text length - if (stringBuilder.Length > maxLength) - { - stringBuilder.Length = maxLength - 3; - stringBuilder.Append('.'); - stringBuilder.Append('.'); - stringBuilder.Append('.'); - } + stringBuilder.CutTooLong(maxLength); return stringBuilder.ToString(); } - private static string GetNames(OneTimeZone timeZone, string search, int maxLength) + private static string GetDstCountries(OneTimeZone timeZone, string search, int maxLength) { - IEnumerable names; + IEnumerable countries; // TODO: translate country names if (string.IsNullOrWhiteSpace(search)) { - names = timeZone.Names; + countries = timeZone.DstCountries; } else { - names = timeZone.Names.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); - if (!names.Any()) - { - names = timeZone.Names; - } + countries = timeZone.DstCountries.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); } var stringBuilder = new StringBuilder(); - var lastEntry = names.LastOrDefault(); + var lastEntry = countries.LastOrDefault(); - foreach (var name in names) + foreach (var country in countries) { - stringBuilder.Append(name); + stringBuilder.Append(country); - if (name != lastEntry) + if (country != lastEntry) { stringBuilder.Append(','); stringBuilder.Append(' '); } } - // To many names (first pass) => cut name length + // To many countries (first pass) => remove extra info if (stringBuilder.Length > maxLength) { - foreach (var country in names) + stringBuilder.Clear(); + + foreach (var country in countries) { - stringBuilder.SaveAppend(country, maxLength: 5); + var extraInfoStart = country.IndexOf('(', StringComparison.InvariantCultureIgnoreCase); + if (extraInfoStart > 0) + { + stringBuilder.Append(country[..extraInfoStart]); + } + else + { + stringBuilder.Append(country); + } if (country != lastEntry) { @@ -330,15 +419,31 @@ private static string GetNames(OneTimeZone timeZone, string search, int maxLengt } } - // To many names (third pass) => cut text length + // To many countries (second pass) => remove extra info and cut country length if (stringBuilder.Length > maxLength) { - stringBuilder.Length = maxLength - 3; - stringBuilder.Append('.'); - stringBuilder.Append('.'); - stringBuilder.Append('.'); + foreach (var country in countries) + { + var extraInfoStart = country.IndexOf('(', StringComparison.InvariantCultureIgnoreCase); + if (extraInfoStart > 0) + { + stringBuilder.SaveAppend(country[..extraInfoStart], maxLength: 5); + } + else + { + stringBuilder.SaveAppend(country, maxLength: 5); + } + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } } + stringBuilder.CutTooLong(maxLength); + return stringBuilder.ToString(); } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index c5ca9fbe845..668fd64214b 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -79,11 +79,11 @@ internal static string Countries { } /// - /// Looks up a localized string similar to Daylight saving time. + /// Looks up a localized string similar to Countires with daylight saving time. /// - internal static string DaylightSavingTime { + internal static string CountriesWithDst { get { - return ResourceManager.GetString("DaylightSavingTime", resourceCulture); + return ResourceManager.GetString("CountriesWithDst", resourceCulture); } } @@ -132,6 +132,15 @@ internal static string PluginTitle { } } + /// + /// Looks up a localized string similar to Use daylight saving time. + /// + internal static string UseDst { + get { + return ResourceManager.GetString("UseDst", resourceCulture); + } + } + /// /// Looks up a localized string similar to Yes. /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index b4012cbfe39..a2469e8747e 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -123,8 +123,8 @@ Countries - - Daylight saving time + + Countires with daylight saving time Names @@ -141,6 +141,9 @@ Time zone + + Use daylight saving time + Yes diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json index b46639702fc..9c9ca8ec507 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json @@ -7,6 +7,7 @@ "items": { "type": "object", "additionalProperties": false, + "required": [ "Offset" ], "properties": { "Offset": { "type": "string" @@ -21,15 +22,19 @@ "Shortcut": { "type": "string" }, - "DaylightSavingTime": { - "type": "boolean" - }, "Countries": { "type": "array", "uniqueItems": true, "items": { "type": "string" } + }, + "DstCountries": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index cad763cb5fd..90a006027fd 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -4,7 +4,6 @@ [ { "Offset": "-12:00", - "DaylightSavingTime": false, "Names": [ "International Date Line", "Yankee Time Zone" ], "Countries": [ "Baker Island", @@ -13,7 +12,6 @@ }, { "Offset": "-11:00", - "DaylightSavingTime": false, "Names": [ "Samoa Time Zone", "X-ray Time Zone" ], "Countries": [ @@ -27,20 +25,14 @@ }, { "Offset": "-10:00", - "DaylightSavingTime": false, "Names": [ "Hawaii–Aleutian Time Zone", "Whiskey Time Zone" ], "Countries": [ "Cook Islands", "French Polynesia (most)", "Johnston Atoll", "Hawaii (United States)" - ] - }, - { - "Offset": "-10:00", - "DaylightSavingTime": true, - "Names": [ "Hawaii–Aleutian Time Zone", "Whiskey Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Andreanof Islands (United States)", "Islands of Four Mountains (United States)", "Near Islands (United States)", @@ -49,41 +41,28 @@ }, { "Offset": "-09:30", - "DaylightSavingTime": false, "Countries": [ "Marquesas Islands (French Polynesia)" ] }, { "Offset": "-09:00", - "DaylightSavingTime": false, "Names": [ "Alaska Time Zone", "Victor Time Zone" ], "Countries": [ "Gambier Islands (French Polynesia)" - ] - }, - { - "Offset": "-09:00", - "DaylightSavingTime": true, - "Names": [ "Alaska Time Zone", "Victor Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Alaska (most, United States)" ] }, { "Offset": "-08:00", - "DaylightSavingTime": false, "Names": [ "Pacific Time Zone", "Uniform Time Zone" ], "Countries": [ "Clipperton Island", "Pitcairn Islands" - ] - }, - { - "Offset": "-08:00", - "DaylightSavingTime": true, - "Names": [ "Pacific Time Zone", "Uniform Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "British Columbia (most, Canada)", "Baja California (Mexico)", "California (United States)", @@ -95,20 +74,14 @@ }, { "Offset": "-07:00", - "DaylightSavingTime": false, "Names": [ "Mountain Time Zone", "Tango Time Zone" ], "Countries": [ "British Columbia (northeast, Canada)", "Yukon (Canada)", "Sonora (Mexico)", "Arizona (most, United States)" - ] - }, - { - "Offset": "-07:00", - "DaylightSavingTime": true, - "Names": [ "Mountain Time Zone", "Tango Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Alberta (Canada)", "British Columbia (southeast, Canada)", "Northwest Territories (Canada)", @@ -127,7 +100,6 @@ }, { "Offset": "-06:00", - "DaylightSavingTime": false, "Names": [ "Central Time Zone", "Sierra Time Zone" ], "Countries": [ "Belize", @@ -138,13 +110,8 @@ "Guatemala", "Honduras", "Nicaragua" - ] - }, - { - "Offset": "-06:00", - "DaylightSavingTime": true, - "Names": [ "Central Time Zone", "Sierra Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Manitoba (Canada)", "Nunavut (central, Canada)", "Ontario (west, Canada)", @@ -170,7 +137,6 @@ }, { "Offset": "-05:00", - "DaylightSavingTime": false, "Names": [ "Eastern Time Zone", "Romeo Time Zone" ], "Countries": [ "Acre (Brazil)", @@ -185,13 +151,8 @@ "Navassa Island", "Panama", "Peru" - ] - }, - { - "Offset": "-05:00", - "DaylightSavingTime": true, - "Names": [ "Eastern Time Zone", "Romeo Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Bahamas", "Nunavut (east, Canada)", "Ontario (most, Canada)", @@ -225,7 +186,6 @@ }, { "Offset": "-04:00", - "DaylightSavingTime": false, "Names": [ "Atlantic Time Zone", "Quebec Time Zone" ], "Countries": [ "Anguilla", @@ -259,13 +219,8 @@ "Trinidad and Tobago", "U.S. Virgin Islands", "Venezuela" - ] - }, - { - "Offset": "-04:00", - "DaylightSavingTime": true, - "Names": [ "Atlantic Time Zone", "Quebec Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Bermuda", "Labrador (most, Canada)", "New Brunswick (Canada)", @@ -278,7 +233,6 @@ }, { "Offset": "-03:30", - "DaylightSavingTime": true, "Names": [ "Newfoundland Time Zone" ], "Countries": [ "Newfoundland (Canada)", @@ -288,7 +242,6 @@ { "Offset": "-03:00", "Names": [ "Papa Time Zone"], - "DaylightSavingTime": false, "Countries": [ "Argentina", "Brazil (most)", @@ -297,13 +250,8 @@ "French Guiana", "SuriNames", "Uruguay" - ] - }, - { - "Offset": "-03:00", - "Names": [ "Papa Time Zone" ], - "DaylightSavingTime": true, - "Countries": [ + ], + "DstCountries": [ "Greenland (most)", "Saint Pierre and Miquelon" ] @@ -311,7 +259,6 @@ { "Offset": "-02:00", "Names": [ "Oscar Time Zone" ], - "DaylightSavingTime": false, "Countries": [ "Fernando de Noronha (Brazil)", "South Georgia and the South Sandwich Islands" @@ -320,23 +267,16 @@ { "Offset": "-01:00", "Names": [ "November Time Zone" ], - "DaylightSavingTime": false, "Countries": [ "Cape Verde" - ] - }, - { - "Offset": "-01:00", - "Names": [ "November Time Zone" ], - "DaylightSavingTime": true, - "Countries": [ + ], + "DstCountries": [ "Ittoqqortoormiit (Greenland)", "Azores (Portugal)" ] }, { "Offset": "00:00", - "DaylightSavingTime": false, "Names": [ "Western European Time", "Zulu Time Zone" ], "Countries": [ "Ascension and Tristan da Cunha", @@ -356,13 +296,8 @@ "Senegal", "Sierra Leone", "Togo" - ] - }, - { - "Offset": "00:00", - "DaylightSavingTime": true, - "Names": [ "Western European Time", "Zulu Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Canary Islands", "Faroe Islands", "Guernsey", @@ -375,7 +310,6 @@ }, { "Offset": "01:00", - "DaylightSavingTime": false, "Names": [ "Central European Time", "Alpha Time Zone" ], "Countries": [ "Algeria", @@ -402,13 +336,8 @@ "Nigeria", "Tunisia", "Weste" - ] - }, - { - "Offset": "01:00", - "DaylightSavingTime": true, - "Names": [ "Central European Time", "Alpha Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Albania", "Andorra", "Austria", @@ -444,7 +373,6 @@ }, { "Offset": "02:00", - "DaylightSavingTime": false, "Names": [ "Eastern European Time", "Bravo Time Zone" ], "Countries": [ "Botswana", @@ -464,13 +392,8 @@ "Sudan", "Zambia", "Zimbabwe" - ] - }, - { - "Offset": "02:00", - "DaylightSavingTime": true, - "Names": [ "Eastern European Time", "Bravo Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Akrotiri and Dhekelia", "Bulgaria", "Cyprus", @@ -492,7 +415,6 @@ }, { "Offset": "03:00", - "DaylightSavingTime": false, "Names": [ "Further-eastern European Time", "Charlie Time Zone" ], "Countries": [ "Abkhazia", @@ -526,17 +448,15 @@ }, { "Offset": "03:30", - "DaylightSavingTime": true, "Names": [ "Iran Standard Time" ], - "Countries": [ + "DstCountries": [ "Iran" ] }, { "Offset": "04:00", - "DaylightSavingTime": true, "Names": [ "Samara Time", "Delta Time Zone" ], - "Countries": [ + "DstCountries": [ "Armenia", "Artsakh", "Azerbaijan", @@ -556,7 +476,6 @@ }, { "Offset": "04:30", - "DaylightSavingTime": false, "Names": [ "Afghanistan Time" ], "Countries": [ "Afghanistan" @@ -564,7 +483,6 @@ }, { "Offset": "05:00", - "DaylightSavingTime": false, "Names": [ "Pakistan Standard Time", "Echo Time Zone" ], "Countries": [ "Amsterdam Island (French Southern and Antarctic Lands)", @@ -595,7 +513,6 @@ }, { "Offset": "05:30", - "DaylightSavingTime": false, "Names": [ "Indian Standard Time" ], "Countries": [ "India", @@ -604,7 +521,6 @@ }, { "Offset": "05:45", - "DaylightSavingTime": false, "Names": [ "Nepal Standard Time" ], "Countries": [ "Nepal" @@ -612,7 +528,6 @@ }, { "Offset": "06:00", - "DaylightSavingTime": false, "Names": [ "Bangladesh Standard Time", "Foxtrot Time Zone" ], "Countries": [ "Bangladesh", @@ -625,7 +540,6 @@ }, { "Offset": "06:30", - "DaylightSavingTime": false, "Names": [ "Myanmar Standard Time" ], "Countries": [ "Cocos Islands", @@ -634,7 +548,6 @@ }, { "Offset": "07:00", - "DaylightSavingTime": false, "Names": [ "Western Indonesian Time", "Golf Time Zone" ], "Countries": [ "Cambodia", @@ -661,7 +574,6 @@ }, { "Offset": "08:00", - "DaylightSavingTime": false, "Names": [ "Central Indonesian Time", "Hotel Time Zone" ], "Countries": [ "Australia: Western Australia (most)", @@ -687,7 +599,6 @@ }, { "Offset": "08:45", - "DaylightSavingTime": false, "Names": [ "Central Western Standard Time" ], "Countries": [ "Eucla" @@ -695,7 +606,6 @@ }, { "Offset": "09:00", - "DaylightSavingTime": false, "Names": [ "Eastern Indonesian Time", "India Time Zone" ], "Countries": [ "East Timor", @@ -714,7 +624,6 @@ }, { "Offset": "09:30", - "DaylightSavingTime": false, "Names": [ "Central Standard Time" ], "Countries": [ "Northern Territory" @@ -722,7 +631,6 @@ }, { "Offset": "09:30", - "DaylightSavingTime": true, "Names": [ "Central Standard Time" ], "Countries": [ "South Australia (Australia)" @@ -731,7 +639,6 @@ { "Offset": "10:00", "Names": [ "Kilo Time Zone" ], - "DaylightSavingTime": false, "Countries": [ "Queensland (Australia)", "Guam", @@ -743,13 +650,8 @@ "Khabarovsk (Russia)", "Primorsky (Russia)", "Sakha (central-east, Russia)" - ] - }, - { - "Offset": "10:00", - "DaylightSavingTime": true, - "Names": [ "Vladivostok Time", "Kilo Time Zone" ], - "Countries": [ + ], + "DstCountries": [ "Australian Capital Territory (Australia)", "Jervis Bay Territory (Australia)", "New South Wales (most, Australia)", @@ -759,14 +661,12 @@ }, { "Offset": "10:30", - "DaylightSavingTime": true, - "Countries": [ + "DstCountries": [ "Lord Howe Island (Australia)" ] }, { "Offset": "11:00", - "DaylightSavingTime": false, "Names": [ "Magadan Time", "Lima Time Zone" ], "Countries": [ "Kosrae (Micronesia)", @@ -778,19 +678,13 @@ "Sakhalin (Russia)", "Solomon Islands", "Vanuatu" - ] - }, - { - "Offset": "11:00", - "Names": [ "Lima Time Zone" ], - "DaylightSavingTime": true, - "Countries": [ + ], + "DstCountries": [ "Norfolk Island" ] }, { "Offset": "12:00", - "DaylightSavingTime": false, "Names": [ "Kamchatka Time", "Mike Time Zone" ], "Countries": [ "Fiji", @@ -802,19 +696,13 @@ "Tuvalu", "Wake Island", "Wallis and Futuna" - ] - }, - { - "Offset": "12:00", - "Names": [ "Mike Time Zone" ], - "DaylightSavingTime": true, - "Countries": [ + ], + "DstCountries": [ "New Zealand" ] }, { "Offset": "12:45", - "DaylightSavingTime": true, "Names": [ "Chatham Standard Time" ], "Countries": [ "Chatham Islands (New Zealand)" @@ -822,7 +710,6 @@ }, { "Offset": "13:00", - "DaylightSavingTime": false, "Countries": [ "Phoenix Islands (Kiribati)", "Samoa", @@ -832,7 +719,6 @@ }, { "Offset": "14:00", - "DaylightSavingTime": false, "Countries": [ "Line Islands (Kiribati)" ] From 7a4c72ae0b8ae9d0d25a5f5298813de198a4e8df Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 28 Oct 2021 09:50:17 +0200 Subject: [PATCH 19/67] Use TimeSpan for offset, use build-in calculation for time in time zone --- .../Classes/OneTimeZone.cs | 14 ++- .../Helper/ResultHelper.cs | 88 +++++-------------- 2 files changed, 32 insertions(+), 70 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index f2f7050d24a..09810e8bb3d 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -2,7 +2,9 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Classes @@ -11,8 +13,7 @@ public sealed class OneTimeZone { public OneTimeZone() { - Offset = "0:00"; - Shortcut = string.Empty; + Shortcuts = Enumerable.Empty(); Names = Enumerable.Empty(); Countries = Enumerable.Empty(); DstCountries = Enumerable.Empty(); @@ -21,14 +22,17 @@ public OneTimeZone() /// /// Gets or sets the time offset of this timezone (the gap from the UTC timezone) /// - public string Offset { get; set; } + public TimeSpan Offset { get; set; } /// /// Gets or sets a list with names of this time zone. /// public IEnumerable Names { get; set; } - public string Shortcut { get; set; } + /// + /// Gets or sets a list with shortcuts of the names this time zone. + /// + public IEnumerable Shortcuts { get; set; } /// /// Gets or sets a list with all countries in this time zone that don't use a daylight saving time. @@ -39,5 +43,7 @@ public OneTimeZone() /// Gets or sets a list with all countries in this time zone that use a daylight saving time. /// public IEnumerable DstCountries { get; set; } + + internal string OffsetString => Offset.ToString("-hh:mm", CultureInfo.InvariantCulture); } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 467ce5f89d4..95f985a14f4 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -50,11 +50,11 @@ internal static IEnumerable GetResults(IEnumerable timeZone private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) { // allow search for "-x:xx" - if (search.StartsWith('-') && timeZone.Offset.StartsWith('-')) + if (search.StartsWith('-') && timeZone.OffsetString.StartsWith('-')) { - if (timeZone.Offset.ElementAtOrDefault(1) == '0') + if (timeZone.OffsetString.ElementAtOrDefault(1) == '0') { - if (timeZone.Offset.Substring(2).StartsWith(search.Substring(1), StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.OffsetString[2..].StartsWith(search[1..], StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -62,13 +62,13 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) } // allow search for "+xx:xx" - if (search.StartsWith('+') && timeZone.Offset.StartsWith(search.Substring(1), StringComparison.InvariantCultureIgnoreCase)) + if (search.StartsWith('+') && timeZone.OffsetString.StartsWith(search[1..], StringComparison.InvariantCultureIgnoreCase)) { return true; } // "-1x:xx" match here - if (timeZone.Offset.Contains(search, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.OffsetString.Contains(search, StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -79,7 +79,8 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) return true; } - if (timeZone.Shortcut.Contains(search, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.Shortcuts != null + && timeZone.Shortcuts.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) { return true; } @@ -118,7 +119,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc var countires = GetCountries(timeZone, search, maxLength: 100); if (countires.Length > 0) { - var title = GetTitle(timeZone, search, utcNow); + var title = GetTitle(timeZone, search, utcNow, false); results.Add(new Result { @@ -133,7 +134,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc var dstCountires = GetDstCountries(timeZone, search, maxLength: 100); if (dstCountires.Length > 0) { - var title = GetTitle(timeZone, search, utcNow.AddHours(1)); + var title = GetTitle(timeZone, search, utcNow, true); results.Add(new Result { @@ -148,27 +149,25 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc return results; } - private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow) + private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, bool daylightSavingTime) { - DateTime result; - - var (hours, minutes) = GetHoursAndMinutes(timeZone); - - if (timeZone.Offset.StartsWith("-", StringComparison.InvariantCultureIgnoreCase)) - { - result = utcNow.AddHours(-hours).AddMinutes(-minutes); - } - else + foreach (var timeZoneInfo in TimeZoneInfo.GetSystemTimeZones()) { - result = utcNow.AddHours(hours).AddMinutes(minutes); + if (timeZoneInfo.BaseUtcOffset == timeZone.Offset + && timeZoneInfo.SupportsDaylightSavingTime == daylightSavingTime) + { + return TimeZoneInfo.ConvertTime(utcNow, timeZoneInfo); + } } + // Fall-back + var result = utcNow + timeZone.Offset; return result; } - private static string GetTitle(OneTimeZone timeZone, string search, DateTime utcNow) + private static string GetTitle(OneTimeZone timeZone, string search, DateTime utcNow, bool daylightSavingTime) { - var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow); + var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow, daylightSavingTime); var timeZoneNames = GetNames(timeZone, search, maxLength: 50); return $"{timeInZoneTime:HH:mm:ss} - {timeZoneNames}"; @@ -176,13 +175,12 @@ private static string GetTitle(OneTimeZone timeZone, string search, DateTime utc private static string GetToolTip(OneTimeZone timeZone) { - var fullTimeOffset = GetFullOffset(timeZone); var countries = GetCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); var names = GetNames(timeZone, search: string.Empty, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(fullTimeOffset); + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.OffsetString); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.No); stringBuilder.AppendLine(string.Empty); stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); @@ -194,13 +192,12 @@ private static string GetToolTip(OneTimeZone timeZone) private static string GetDstToolTip(OneTimeZone timeZone) { - var fullTimeOffset = GetFullOffset(timeZone); var dstCountries = GetDstCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); var names = GetNames(timeZone, search: string.Empty, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(fullTimeOffset); + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.OffsetString); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.Yes); stringBuilder.AppendLine(string.Empty); stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); @@ -210,29 +207,6 @@ private static string GetDstToolTip(OneTimeZone timeZone) return stringBuilder.ToString(); } - private static (byte hours, byte minutes) GetHoursAndMinutes(OneTimeZone timeZone) - { - string offset; - - if (timeZone.Offset.StartsWith("-", StringComparison.InvariantCultureIgnoreCase)) - { - offset = timeZone.Offset[1..]; - } - else - { - offset = timeZone.Offset; - } - - var offsetSplit = offset.Split(':'); - - if (byte.TryParse(offsetSplit.FirstOrDefault(), out var hours) && byte.TryParse(offsetSplit.LastOrDefault(), out var minutes)) - { - return (hours, minutes); - } - - return (0, 0); - } - private static string GetNames(OneTimeZone timeZone, string search, int maxLength) { IEnumerable names; @@ -446,23 +420,5 @@ private static string GetDstCountries(OneTimeZone timeZone, string search, int m return stringBuilder.ToString(); } - - private static string GetFullOffset(OneTimeZone timeZone) - { - var (hours, minutes) = GetHoursAndMinutes(timeZone); - - string result; - - if (timeZone.Offset.StartsWith('-')) - { - result = $"-{hours}:{minutes:00}"; - } - else - { - result = $"+{hours}:{minutes:00}"; - } - - return result; - } } } From fb69ce996e7027c52da2f68513c24c8a4b0bb6a4 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 28 Oct 2021 09:50:50 +0200 Subject: [PATCH 20/67] add descriptions for JSON schema --- .../timeZones.schema.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json index 9c9ca8ec507..93b5f0e3c24 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json @@ -10,20 +10,28 @@ "required": [ "Offset" ], "properties": { "Offset": { - "type": "string" + "type": "string", + "description": "The time offset of this timezone (the gap from the UTC timezone, must convertible to a C# TimeSpan)" }, "Names": { "type": "array", + "description": "A list with names of this time zone.", "uniqueItems": true, "items": { "type": "string" } }, "Shortcut": { - "type": "string" + "type": "array", + "description": "A list with shortcuts of the names this time zone.", + "uniqueItems": true, + "items": { + "type": "string" + } }, "Countries": { "type": "array", + "description": "A list with all countries in this time zone that don't use a daylight saving time.", "uniqueItems": true, "items": { "type": "string" @@ -31,6 +39,7 @@ }, "DstCountries": { "type": "array", + "description": "A list with all countries in this time zone that use a daylight saving time.", "uniqueItems": true, "items": { "type": "string" From f9a4463c21d10e7dc69595721979b5d72751701c Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 28 Oct 2021 10:04:23 +0200 Subject: [PATCH 21/67] Fix typos --- .../Classes/OneTimeZone.cs | 2 +- .../Helper/ResultHelper.cs | 12 ++++++------ .../Properties/Resources.Designer.cs | 2 +- .../Properties/Resources.resx | 2 +- .../timeZones.schema.json | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index 09810e8bb3d..4127f4ff88d 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -20,7 +20,7 @@ public OneTimeZone() } /// - /// Gets or sets the time offset of this timezone (the gap from the UTC timezone) + /// Gets or sets the time offset of this time zone (the gap from the UTC time zone) /// public TimeSpan Offset { get; set; } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 95f985a14f4..376a963850c 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -116,8 +116,8 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc // TODO: add shortcuts var results = new Collection(); - var countires = GetCountries(timeZone, search, maxLength: 100); - if (countires.Length > 0) + var countries = GetCountries(timeZone, search, maxLength: 100); + if (countries.Length > 0) { var title = GetTitle(timeZone, search, utcNow, false); @@ -125,14 +125,14 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc { ContextData = timeZone, IcoPath = iconPath, - SubTitle = countires, + SubTitle = countries, Title = title, ToolTipData = new ToolTipData(title, GetToolTip(timeZone)), }); } - var dstCountires = GetDstCountries(timeZone, search, maxLength: 100); - if (dstCountires.Length > 0) + var dstCountries = GetDstCountries(timeZone, search, maxLength: 100); + if (dstCountries.Length > 0) { var title = GetTitle(timeZone, search, utcNow, true); @@ -140,7 +140,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc { ContextData = timeZone, IcoPath = iconPath, - SubTitle = dstCountires, + SubTitle = dstCountries, Title = title, ToolTipData = new ToolTipData(title, GetDstToolTip(timeZone)), }); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 668fd64214b..98c2feefcc0 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -79,7 +79,7 @@ internal static string Countries { } /// - /// Looks up a localized string similar to Countires with daylight saving time. + /// Looks up a localized string similar to Countries with daylight saving time. /// internal static string CountriesWithDst { get { diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index a2469e8747e..d7d12310828 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -124,7 +124,7 @@ Countries - Countires with daylight saving time + Countries with daylight saving time Names diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json index 93b5f0e3c24..e127acacf5a 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json @@ -11,7 +11,7 @@ "properties": { "Offset": { "type": "string", - "description": "The time offset of this timezone (the gap from the UTC timezone, must convertible to a C# TimeSpan)" + "description": "The time offset of this time zone (the gap from the UTC time zone, must convertible to a C# TimeSpan)" }, "Names": { "type": "array", From 08cadbd5e7cd2ed7469a5f4d83813dd238236941 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 29 Oct 2021 08:45:23 +0200 Subject: [PATCH 22/67] Split out names in separate properties --- .../Classes/OneTimeZone.cs | 39 ++- .../Helper/ResultHelper.cs | 87 ++++--- .../timeZones.schema.json | 26 +- .../timezones.json | 237 +++++++++++------- 4 files changed, 243 insertions(+), 146 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index 4127f4ff88d..4cb05f4d1ac 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -13,10 +13,14 @@ public sealed class OneTimeZone { public OneTimeZone() { - Shortcuts = Enumerable.Empty(); - Names = Enumerable.Empty(); - Countries = Enumerable.Empty(); - DstCountries = Enumerable.Empty(); + Name = string.Empty; + MilitaryName = string.Empty; + Shortcut = string.Empty; + + TimeNamesStandard = Enumerable.Empty(); + TimeNamesDaylight = Enumerable.Empty(); + CountriesStandard = Enumerable.Empty(); + CountriesDaylight = Enumerable.Empty(); } /// @@ -25,24 +29,39 @@ public OneTimeZone() public TimeSpan Offset { get; set; } /// - /// Gets or sets a list with names of this time zone. + /// Gets or sets the name of this time zone. + /// + public string Name { get; set; } + + /// + /// Gets or sets the military name of this time zone. + /// + public string MilitaryName { get; set; } + + /// + /// Gets or sets the shortcuts of the name this time zone. + /// + public string Shortcut { get; set; } + + /// + /// Gets or sets a list with names for the standard time. /// - public IEnumerable Names { get; set; } + public IEnumerable TimeNamesStandard { get; set; } /// - /// Gets or sets a list with shortcuts of the names this time zone. + /// Gets or sets a list with names for the daylight saving time. /// - public IEnumerable Shortcuts { get; set; } + public IEnumerable TimeNamesDaylight { get; set; } /// /// Gets or sets a list with all countries in this time zone that don't use a daylight saving time. /// - public IEnumerable Countries { get; set; } + public IEnumerable CountriesStandard { get; set; } /// /// Gets or sets a list with all countries in this time zone that use a daylight saving time. /// - public IEnumerable DstCountries { get; set; } + public IEnumerable CountriesDaylight { get; set; } internal string OffsetString => Offset.ToString("-hh:mm", CultureInfo.InvariantCulture); } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 376a963850c..a3ddc6c21ac 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -73,26 +73,41 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) return true; } - if (timeZone.Names != null - & timeZone.Names.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + if (timeZone.Name.Contains(search, StringComparison.CurrentCultureIgnoreCase)) { return true; } - if (timeZone.Shortcuts != null - && timeZone.Shortcuts.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + if (timeZone.MilitaryName.Contains(search, StringComparison.CurrentCultureIgnoreCase)) { return true; } - if (timeZone.Countries != null - && timeZone.Countries.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + if (timeZone.Shortcut.Contains(search, StringComparison.CurrentCultureIgnoreCase)) { return true; } - if (timeZone.DstCountries != null - && timeZone.DstCountries.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + if (timeZone.TimeNamesDaylight != null + && timeZone.TimeNamesDaylight.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + { + return true; + } + + if (timeZone.TimeNamesStandard != null + && timeZone.TimeNamesStandard.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + { + return true; + } + + if (timeZone.CountriesStandard != null + && timeZone.CountriesStandard.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + { + return true; + } + + if (timeZone.CountriesDaylight != null + && timeZone.CountriesDaylight.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) { return true; } @@ -109,17 +124,15 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utcNow, string search, string iconPath) { // TODO: revisit time zone names - // TODO: add time names - // TODO: don't mix time names with time zone names - // TODO: respect DST and none DST time names - // TODO: add standard and DST time zone names - // TODO: add shortcuts + // TODO: revisit standard time names + // TODO: revisit DST time names + // TODO: add time zone shortcuts var results = new Collection(); var countries = GetCountries(timeZone, search, maxLength: 100); if (countries.Length > 0) { - var title = GetTitle(timeZone, search, utcNow, false); + var title = GetTitle(timeZone, utcNow, false); results.Add(new Result { @@ -134,7 +147,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc var dstCountries = GetDstCountries(timeZone, search, maxLength: 100); if (dstCountries.Length > 0) { - var title = GetTitle(timeZone, search, utcNow, true); + var title = GetTitle(timeZone, utcNow, true); results.Add(new Result { @@ -165,10 +178,10 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, return result; } - private static string GetTitle(OneTimeZone timeZone, string search, DateTime utcNow, bool daylightSavingTime) + private static string GetTitle(OneTimeZone timeZone, DateTime utcNow, bool daylightSavingTime) { var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow, daylightSavingTime); - var timeZoneNames = GetNames(timeZone, search, maxLength: 50); + var timeZoneNames = GetNames(timeZone, maxLength: 50); return $"{timeInZoneTime:HH:mm:ss} - {timeZoneNames}"; } @@ -176,7 +189,7 @@ private static string GetTitle(OneTimeZone timeZone, string search, DateTime utc private static string GetToolTip(OneTimeZone timeZone) { var countries = GetCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); - var names = GetNames(timeZone, search: string.Empty, maxLength: int.MaxValue); + var names = GetNames(timeZone, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); @@ -193,7 +206,7 @@ private static string GetToolTip(OneTimeZone timeZone) private static string GetDstToolTip(OneTimeZone timeZone) { var dstCountries = GetDstCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); - var names = GetNames(timeZone, search: string.Empty, maxLength: int.MaxValue); + var names = GetNames(timeZone, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); @@ -207,22 +220,28 @@ private static string GetDstToolTip(OneTimeZone timeZone) return stringBuilder.ToString(); } - private static string GetNames(OneTimeZone timeZone, string search, int maxLength) + private static string GetNames(OneTimeZone timeZone, int maxLength) { - IEnumerable names; + var names = new List(); - // TODO: translate country names - if (string.IsNullOrWhiteSpace(search)) + if (!string.IsNullOrWhiteSpace(timeZone.Name)) { - names = timeZone.Names; + names.Add(timeZone.Name); } - else + + if (!string.IsNullOrWhiteSpace(timeZone.MilitaryName)) { - names = timeZone.Names.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); - if (!names.Any()) - { - names = timeZone.Names; - } + names.Add(timeZone.MilitaryName); + } + + if (timeZone.TimeNamesStandard != null) + { + names.AddRange(timeZone.TimeNamesStandard); + } + + if (timeZone.TimeNamesDaylight != null) + { + names.AddRange(timeZone.TimeNamesDaylight); } var stringBuilder = new StringBuilder(); @@ -266,11 +285,11 @@ private static string GetCountries(OneTimeZone timeZone, string search, int maxL // TODO: translate country names if (string.IsNullOrWhiteSpace(search)) { - countries = timeZone.Countries; + countries = timeZone.CountriesStandard; } else { - countries = timeZone.Countries.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); + countries = timeZone.CountriesStandard.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); } var stringBuilder = new StringBuilder(); @@ -347,11 +366,11 @@ private static string GetDstCountries(OneTimeZone timeZone, string search, int m // TODO: translate country names if (string.IsNullOrWhiteSpace(search)) { - countries = timeZone.DstCountries; + countries = timeZone.CountriesDaylight; } else { - countries = timeZone.DstCountries.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); + countries = timeZone.CountriesDaylight.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); } var stringBuilder = new StringBuilder(); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json index e127acacf5a..6ba5b635fbc 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json @@ -13,31 +13,43 @@ "type": "string", "description": "The time offset of this time zone (the gap from the UTC time zone, must convertible to a C# TimeSpan)" }, - "Names": { + "Name": { + "type": "string", + "description": "The name of this time zone." + }, + "MilitaryName": { + "type": "string", + "description": "The military name of this time zone." + }, + "Shortcut": { + "type": "string", + "description": "A shortcut for the names this time zone." + }, + "TimeNamesStandard": { "type": "array", - "description": "A list with names of this time zone.", + "description": "A list with names for the standard time.", "uniqueItems": true, "items": { "type": "string" } }, - "Shortcut": { + "TimeNamesDaylight": { "type": "array", - "description": "A list with shortcuts of the names this time zone.", + "description": "A list with names for the daylight saving time.", "uniqueItems": true, "items": { "type": "string" } }, - "Countries": { + "CountriesStandard": { "type": "array", - "description": "A list with all countries in this time zone that don't use a daylight saving time.", + "description": "A list with all countries in this time zone that use a standard time.", "uniqueItems": true, "items": { "type": "string" } }, - "DstCountries": { + "CountriesDaylight": { "type": "array", "description": "A list with all countries in this time zone that use a daylight saving time.", "uniqueItems": true, diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 90a006027fd..18f3676ed6f 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -4,16 +4,18 @@ [ { "Offset": "-12:00", - "Names": [ "International Date Line", "Yankee Time Zone" ], - "Countries": [ + "Name": "International Date Line", + "MilitaryName": "Yankee Time Zone", + "CountriesStandard": [ "Baker Island", "Howland Island" ] }, { "Offset": "-11:00", - "Names": [ "Samoa Time Zone", "X-ray Time Zone" ], - "Countries": + "Name": "Samoa Time Zone", + "MilitaryName": "X-ray Time Zone", + "CountriesStandard": [ "American Samoa", "Jarvis Island", @@ -25,14 +27,15 @@ }, { "Offset": "-10:00", - "Names": [ "Hawaii–Aleutian Time Zone", "Whiskey Time Zone" ], - "Countries": [ + "Name": "Hawaii–Aleutian Time Zone", + "MilitaryName": "Whiskey Time Zone", + "CountriesStandard": [ "Cook Islands", "French Polynesia (most)", "Johnston Atoll", "Hawaii (United States)" ], - "DstCountries": [ + "CountriesDaylight": [ "Andreanof Islands (United States)", "Islands of Four Mountains (United States)", "Near Islands (United States)", @@ -41,28 +44,30 @@ }, { "Offset": "-09:30", - "Countries": [ + "CountriesStandard": [ "Marquesas Islands (French Polynesia)" ] }, { "Offset": "-09:00", - "Names": [ "Alaska Time Zone", "Victor Time Zone" ], - "Countries": [ + "Name": "Alaska Time Zone", + "MilitaryName": "Victor Time Zone", + "CountriesStandard": [ "Gambier Islands (French Polynesia)" ], - "DstCountries": [ + "CountriesDaylight": [ "Alaska (most, United States)" ] }, { "Offset": "-08:00", - "Names": [ "Pacific Time Zone", "Uniform Time Zone" ], - "Countries": [ + "Name": "Pacific Time Zone", + "MilitaryName": "Uniform Time Zone", + "CountriesStandard": [ "Clipperton Island", "Pitcairn Islands" ], - "DstCountries": [ + "CountriesDaylight": [ "British Columbia (most, Canada)", "Baja California (Mexico)", "California (United States)", @@ -74,14 +79,15 @@ }, { "Offset": "-07:00", - "Names": [ "Mountain Time Zone", "Tango Time Zone" ], - "Countries": [ + "Name": "Mountain Time Zone", + "MilitaryName": "Tango Time Zone", + "CountriesStandard": [ "British Columbia (northeast, Canada)", "Yukon (Canada)", "Sonora (Mexico)", "Arizona (most, United States)" ], - "DstCountries": [ + "CountriesDaylight": [ "Alberta (Canada)", "British Columbia (southeast, Canada)", "Northwest Territories (Canada)", @@ -100,8 +106,9 @@ }, { "Offset": "-06:00", - "Names": [ "Central Time Zone", "Sierra Time Zone" ], - "Countries": [ + "Name": "Central Time Zone", + "MilitaryName": "Sierra Time Zone", + "CountriesStandard": [ "Belize", "Saskatchewan (most, Canada)", "Costa Rica", @@ -111,7 +118,7 @@ "Honduras", "Nicaragua" ], - "DstCountries": [ + "CountriesDaylight": [ "Manitoba (Canada)", "Nunavut (central, Canada)", "Ontario (west, Canada)", @@ -137,8 +144,9 @@ }, { "Offset": "-05:00", - "Names": [ "Eastern Time Zone", "Romeo Time Zone" ], - "Countries": [ + "Name": "Eastern Time Zone", + "MilitaryName": "Romeo Time Zone", + "CountriesStandard": [ "Acre (Brazil)", "Atikokan (Canada)", "Mishkeegogamang (Canada)", @@ -152,7 +160,7 @@ "Panama", "Peru" ], - "DstCountries": [ + "CountriesDaylight": [ "Bahamas", "Nunavut (east, Canada)", "Ontario (most, Canada)", @@ -186,8 +194,9 @@ }, { "Offset": "-04:00", - "Names": [ "Atlantic Time Zone", "Quebec Time Zone" ], - "Countries": [ + "Name": "Atlantic Time Zone", + "MilitaryName": "Quebec Time Zone", + "CountriesStandard": [ "Anguilla", "Antigua and Barbuda", "Aruba", @@ -220,7 +229,7 @@ "U.S. Virgin Islands", "Venezuela" ], - "DstCountries": [ + "CountriesDaylight": [ "Bermuda", "Labrador (most, Canada)", "New Brunswick (Canada)", @@ -233,52 +242,53 @@ }, { "Offset": "-03:30", - "Names": [ "Newfoundland Time Zone" ], - "Countries": [ + "Name": "Newfoundland Time Zone", + "CountriesStandard": [ "Newfoundland (Canada)", "Labrador (southeast, Canada)" ] }, { "Offset": "-03:00", - "Names": [ "Papa Time Zone"], - "Countries": [ + "MilitaryName": "Papa Time Zone", + "CountriesStandard": [ "Argentina", "Brazil (most)", "Magallanes (Chile)", "Falkland Islands", "French Guiana", - "SuriNames", + "SuriName", "Uruguay" ], - "DstCountries": [ + "CountriesDaylight": [ "Greenland (most)", "Saint Pierre and Miquelon" ] }, { "Offset": "-02:00", - "Names": [ "Oscar Time Zone" ], - "Countries": [ + "MilitaryName": "Oscar Time Zone", + "CountriesStandard": [ "Fernando de Noronha (Brazil)", "South Georgia and the South Sandwich Islands" ] }, { "Offset": "-01:00", - "Names": [ "November Time Zone" ], - "Countries": [ + "MilitaryName": "November Time Zone", + "CountriesStandard": [ "Cape Verde" ], - "DstCountries": [ + "CountriesDaylight": [ "Ittoqqortoormiit (Greenland)", "Azores (Portugal)" ] }, { "Offset": "00:00", - "Names": [ "Western European Time", "Zulu Time Zone" ], - "Countries": [ + "Name": "Western European Time", + "MilitaryName": "Zulu Time Zone", + "CountriesStandard": [ "Ascension and Tristan da Cunha", "Burkina Faso", "Danmarkshavn", @@ -297,7 +307,7 @@ "Sierra Leone", "Togo" ], - "DstCountries": [ + "CountriesDaylight": [ "Canary Islands", "Faroe Islands", "Guernsey", @@ -310,8 +320,9 @@ }, { "Offset": "01:00", - "Names": [ "Central European Time", "Alpha Time Zone" ], - "Countries": [ + "Name": "Central European Time", + "MilitaryName": "Alpha Time Zone", + "CountriesStandard": [ "Algeria", "Angola", "Benin", @@ -337,7 +348,7 @@ "Tunisia", "Weste" ], - "DstCountries": [ + "CountriesDaylight": [ "Albania", "Andorra", "Austria", @@ -373,8 +384,9 @@ }, { "Offset": "02:00", - "Names": [ "Eastern European Time", "Bravo Time Zone" ], - "Countries": [ + "Name": "Eastern European Time", + "MilitaryName": "Bravo Time Zone", + "CountriesStandard": [ "Botswana", "Burundi", "Democratic Republic of the Congo (most)", @@ -393,7 +405,7 @@ "Zambia", "Zimbabwe" ], - "DstCountries": [ + "CountriesDaylight": [ "Akrotiri and Dhekelia", "Bulgaria", "Cyprus", @@ -415,8 +427,9 @@ }, { "Offset": "03:00", - "Names": [ "Further-eastern European Time", "Charlie Time Zone" ], - "Countries": [ + "Name": "Further-eastern European Time", + "MilitaryName": "Charlie Time Zone", + "CountriesStandard": [ "Abkhazia", "Bahrain", "Belarus", @@ -448,15 +461,20 @@ }, { "Offset": "03:30", - "Names": [ "Iran Standard Time" ], - "DstCountries": [ + "TimeNamesStandard": [ + "Iran Standard Time" + ], + "CountriesDaylight": [ "Iran" ] }, { "Offset": "04:00", - "Names": [ "Samara Time", "Delta Time Zone" ], - "DstCountries": [ + "MilitaryName": "Delta Time Zone", + "TimeNamesDaylight": [ + "Samara Time" + ], + "CountriesDaylight": [ "Armenia", "Artsakh", "Azerbaijan", @@ -476,15 +494,20 @@ }, { "Offset": "04:30", - "Names": [ "Afghanistan Time" ], - "Countries": [ + "TimeNamesStandard": [ + "Afghanistan Time" + ], + "CountriesStandard": [ "Afghanistan" ] }, { "Offset": "05:00", - "Names": [ "Pakistan Standard Time", "Echo Time Zone" ], - "Countries": [ + "MilitaryName": "Echo Time Zone", + "TimeNamesStandard": [ + "Pakistan Standard Time" + ], + "CountriesStandard": [ "Amsterdam Island (French Southern and Antarctic Lands)", "Kerguelen Islands (French Southern and Antarctic Lands)", "Saint Paul Island (French Southern and Antarctic Lands)", @@ -513,23 +536,30 @@ }, { "Offset": "05:30", - "Names": [ "Indian Standard Time" ], - "Countries": [ + "TimeNamesStandard": [ + "Indian Standard Time" + ], + "CountriesStandard": [ "India", "Sri Lanka" ] }, { "Offset": "05:45", - "Names": [ "Nepal Standard Time" ], - "Countries": [ + "TimeNamesStandard": [ + "Nepal Standard Time" + ], + "CountriesStandard": [ "Nepal" ] }, { "Offset": "06:00", - "Names": [ "Bangladesh Standard Time", "Foxtrot Time Zone" ], - "Countries": [ + "MilitaryName": "Foxtrot Time Zone", + "TimeNamesStandard": [ + "Bangladesh Standard Time" + ], + "CountriesStandard": [ "Bangladesh", "Bhutan", "British Indian Ocean Territory", @@ -540,16 +570,21 @@ }, { "Offset": "06:30", - "Names": [ "Myanmar Standard Time" ], - "Countries": [ + "TimeNamesStandard": [ + "Myanmar Standard Time" + ], + "CountriesStandard": [ "Cocos Islands", "Myanmar" ] }, { "Offset": "07:00", - "Names": [ "Western Indonesian Time", "Golf Time Zone" ], - "Countries": [ + "MilitaryName": "Golf Time Zone", + "TimeNamesStandard": [ + "Western Indonesian Time" + ], + "CountriesStandard": [ "Cambodia", "Christmas Island", "Central Kalimantan (Indonesia)", @@ -574,8 +609,11 @@ }, { "Offset": "08:00", - "Names": [ "Central Indonesian Time", "Hotel Time Zone" ], - "Countries": [ + "MilitaryName": "Hotel Time Zone", + "TimeNamesStandard": [ + "Central Indonesian Time" + ], + "CountriesStandard": [ "Australia: Western Australia (most)", "Brunei", "China", @@ -599,15 +637,20 @@ }, { "Offset": "08:45", - "Names": [ "Central Western Standard Time" ], - "Countries": [ + "TimeNamesStandard": [ + "Central Western Standard Time" + ], + "CountriesStandard": [ "Eucla" ] }, { "Offset": "09:00", - "Names": [ "Eastern Indonesian Time", "India Time Zone" ], - "Countries": [ + "MilitaryName": "India Time Zone", + "TimeNamesStandard": [ + "Eastern Indonesian Time" + ], + "CountriesStandard": [ "East Timor", "Maluku (Indonesia)", "North Maluku (Indonesia)", @@ -624,22 +667,18 @@ }, { "Offset": "09:30", - "Names": [ "Central Standard Time" ], - "Countries": [ - "Northern Territory" - ] - }, - { - "Offset": "09:30", - "Names": [ "Central Standard Time" ], - "Countries": [ + "TimeNamesStandard": [ + "Central Standard Time" + ], + "CountriesStandard": [ + "Northern Territory", "South Australia (Australia)" ] }, { "Offset": "10:00", - "Names": [ "Kilo Time Zone" ], - "Countries": [ + "MilitaryName": "Kilo Time Zone", + "CountriesStandard": [ "Queensland (Australia)", "Guam", "Chuuk (Micronesia)", @@ -651,7 +690,7 @@ "Primorsky (Russia)", "Sakha (central-east, Russia)" ], - "DstCountries": [ + "CountriesDaylight": [ "Australian Capital Territory (Australia)", "Jervis Bay Territory (Australia)", "New South Wales (most, Australia)", @@ -661,14 +700,17 @@ }, { "Offset": "10:30", - "DstCountries": [ + "CountriesDaylight": [ "Lord Howe Island (Australia)" ] }, { "Offset": "11:00", - "Names": [ "Magadan Time", "Lima Time Zone" ], - "Countries": [ + "MilitaryName": "Lima Time Zone", + "TimeNamesStandard": [ + "Magadan Time" + ], + "CountriesStandard": [ "Kosrae (Micronesia)", "Pohnpei (Micronesia)", "New Caledonia", @@ -679,14 +721,17 @@ "Solomon Islands", "Vanuatu" ], - "DstCountries": [ + "CountriesDaylight": [ "Norfolk Island" ] }, { "Offset": "12:00", - "Names": [ "Kamchatka Time", "Mike Time Zone" ], - "Countries": [ + "MilitaryName": "Mike Time Zone", + "TimeNamesStandard": [ + "Kamchatka Time" + ], + "CountriesStandard": [ "Fiji", "Gilbert Islands (Kiribati)", "Marshall Islands", @@ -697,20 +742,22 @@ "Wake Island", "Wallis and Futuna" ], - "DstCountries": [ + "CountriesDaylight": [ "New Zealand" ] }, { "Offset": "12:45", - "Names": [ "Chatham Standard Time" ], - "Countries": [ + "TimeNamesStandard": [ + "Chatham Standard Time" + ], + "CountriesStandard": [ "Chatham Islands (New Zealand)" ] }, { "Offset": "13:00", - "Countries": [ + "CountriesStandard": [ "Phoenix Islands (Kiribati)", "Samoa", "Tokelau", @@ -719,7 +766,7 @@ }, { "Offset": "14:00", - "Countries": [ + "CountriesStandard": [ "Line Islands (Kiribati)" ] } From af503f88c1d9ffc30724613b746f9b5a30749716 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 29 Oct 2021 09:38:11 +0200 Subject: [PATCH 23/67] Add many time names, time zone names and shortcuts --- .../timezones.json | 142 ++++++++++++++++-- 1 file changed, 128 insertions(+), 14 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 18f3676ed6f..88b8a33a7c3 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -4,7 +4,8 @@ [ { "Offset": "-12:00", - "Name": "International Date Line", + "Name": "International Date Line West time zone", + "Shortcut": "IDLW", "MilitaryName": "Yankee Time Zone", "CountriesStandard": [ "Baker Island", @@ -15,6 +16,9 @@ "Offset": "-11:00", "Name": "Samoa Time Zone", "MilitaryName": "X-ray Time Zone", + "TimeNamesStandard": [ + "Samoa Standard Time" + ], "CountriesStandard": [ "American Samoa", @@ -29,6 +33,12 @@ "Offset": "-10:00", "Name": "Hawaii–Aleutian Time Zone", "MilitaryName": "Whiskey Time Zone", + "TimeNamesStandard": [ + "Hawaii–Aleutian Standard Time" + ], + "TimeNamesDaylight": [ + "Hawaii–Aleutian Daylight Time" + ], "CountriesStandard": [ "Cook Islands", "French Polynesia (most)", @@ -62,7 +72,14 @@ { "Offset": "-08:00", "Name": "Pacific Time Zone", + "Shortcut": "PT", "MilitaryName": "Uniform Time Zone", + "TimeNamesStandard": [ + "Pacific Standard Time" + ], + "TimeNamesDaylight": [ + "Pacific Daylight Time" + ], "CountriesStandard": [ "Clipperton Island", "Pitcairn Islands" @@ -81,6 +98,12 @@ "Offset": "-07:00", "Name": "Mountain Time Zone", "MilitaryName": "Tango Time Zone", + "TimeNamesStandard": [ + "Mountain Standard Time" + ], + "TimeNamesDaylight": [ + "Mountain Daylight Time" + ], "CountriesStandard": [ "British Columbia (northeast, Canada)", "Yukon (Canada)", @@ -107,7 +130,14 @@ { "Offset": "-06:00", "Name": "Central Time Zone", + "Shortcut": "CT", "MilitaryName": "Sierra Time Zone", + "TimeNamesStandard": [ + "Central Standard Time" + ], + "TimeNamesDaylight": [ + "Central Daylight Time" + ], "CountriesStandard": [ "Belize", "Saskatchewan (most, Canada)", @@ -145,7 +175,14 @@ { "Offset": "-05:00", "Name": "Eastern Time Zone", + "Shortcut": "ET", "MilitaryName": "Romeo Time Zone", + "TimeNamesStandard": [ + "Eastern Standard Time" + ], + "TimeNamesDaylight": [ + "Eastern Daylight Time" + ], "CountriesStandard": [ "Acre (Brazil)", "Atikokan (Canada)", @@ -196,6 +233,12 @@ "Offset": "-04:00", "Name": "Atlantic Time Zone", "MilitaryName": "Quebec Time Zone", + "TimeNamesStandard": [ + "Atlantic Standard Time" + ], + "TimeNamesDaylight": [ + "Atlantic Daylight Time" + ], "CountriesStandard": [ "Anguilla", "Antigua and Barbuda", @@ -243,6 +286,7 @@ { "Offset": "-03:30", "Name": "Newfoundland Time Zone", + "Shortcut": "NT", "CountriesStandard": [ "Newfoundland (Canada)", "Labrador (southeast, Canada)" @@ -286,8 +330,17 @@ }, { "Offset": "00:00", - "Name": "Western European Time", + "Name": "Coordinated Universal Time", + "Shortcut": "UTC", "MilitaryName": "Zulu Time Zone", + "TimeNamesDaylight": [ + "Western European Summer Time", + "British Summer Time", + "Irish Standard Time" + ], + "TimeNamesStandard": [ + "Western European Time" + ], "CountriesStandard": [ "Ascension and Tristan da Cunha", "Burkina Faso", @@ -320,8 +373,14 @@ }, { "Offset": "01:00", - "Name": "Central European Time", "MilitaryName": "Alpha Time Zone", + "TimeNamesStandard": [ + "Central European Time" + ], + "TimeNamesDaylight": [ + "Central European Summer Time", + "Central European Daylight Time" + ], "CountriesStandard": [ "Algeria", "Angola", @@ -384,8 +443,14 @@ }, { "Offset": "02:00", - "Name": "Eastern European Time", "MilitaryName": "Bravo Time Zone", + "TimeNamesStandard": [ + "Eastern European Time", + "Kaliningrad Time" + ], + "TimeNamesDaylight": [ + "Eastern European Summer Time" + ], "CountriesStandard": [ "Botswana", "Burundi", @@ -427,8 +492,13 @@ }, { "Offset": "03:00", - "Name": "Further-eastern European Time", "MilitaryName": "Charlie Time Zone", + "TimeNamesStandard": [ + "Further-eastern European Time", + "Moscow Time", + "Turkey Time", + "East Africa Time" + ], "CountriesStandard": [ "Abkhazia", "Bahrain", @@ -472,7 +542,13 @@ "Offset": "04:00", "MilitaryName": "Delta Time Zone", "TimeNamesDaylight": [ - "Samara Time" + "Samara Time", + "Armenia Time", + "Azerbaijan Time", + "Georgia Time", + "United Arab Emirates Standard Time", + "Mauritius Time", + "Seychelles Time" ], "CountriesDaylight": [ "Armenia", @@ -505,7 +581,8 @@ "Offset": "05:00", "MilitaryName": "Echo Time Zone", "TimeNamesStandard": [ - "Pakistan Standard Time" + "Pakistan Standard Time", + "Yekaterinburg Time", ], "CountriesStandard": [ "Amsterdam Island (French Southern and Antarctic Lands)", @@ -537,7 +614,8 @@ { "Offset": "05:30", "TimeNamesStandard": [ - "Indian Standard Time" + "Indian Standard Time", + "Sri Lanka Standard Time" ], "CountriesStandard": [ "India", @@ -557,7 +635,10 @@ "Offset": "06:00", "MilitaryName": "Foxtrot Time Zone", "TimeNamesStandard": [ - "Bangladesh Standard Time" + "Bangladesh Standard Time", + "Bhutan Time", + "Kyrgyzstan Time", + "Omsk Time" ], "CountriesStandard": [ "Bangladesh", @@ -582,7 +663,10 @@ "Offset": "07:00", "MilitaryName": "Golf Time Zone", "TimeNamesStandard": [ - "Western Indonesian Time" + "Western Indonesian Time", + "Christmas Island Time", + "Krasnoyarsk Time", + "Western Indonesia Time", ], "CountriesStandard": [ "Cambodia", @@ -611,7 +695,13 @@ "Offset": "08:00", "MilitaryName": "Hotel Time Zone", "TimeNamesStandard": [ - "Central Indonesian Time" + "Central Indonesian Time", + "Western Australia Standard Time", + "China Standard Time", + "Hong Kong Standard Time", + "Macau Standard Time", + "National Standard Time", + "Irkutsk Time" ], "CountriesStandard": [ "Australia: Western Australia (most)", @@ -641,14 +731,21 @@ "Central Western Standard Time" ], "CountriesStandard": [ - "Eucla" + "Caiguna (Australia)", + "Cocklebiddy (Australia)", + "Eucla (Australia)", + "Madura (Australia)", + "Mundrabilla (Australia)", + "Border Village (Australia)" ] }, { "Offset": "09:00", "MilitaryName": "India Time Zone", "TimeNamesStandard": [ - "Eastern Indonesian Time" + "Eastern Indonesian Time", + "Yakutsk Time", + "Japan Standard Time" ], "CountriesStandard": [ "East Timor", @@ -677,7 +774,17 @@ }, { "Offset": "10:00", + "Name": "Chamorro Time Zone", "MilitaryName": "Kilo Time Zone", + "TimeNamesStandard": [ + "Vladivostok Time", + "Eastern Standard Time", + "Chamorro Standard Time" + ], + "TimeNamesDaylight": [ + "Central Daylight Time", + "Eastern Daylight Time" + ], "CountriesStandard": [ "Queensland (Australia)", "Guam", @@ -752,7 +859,14 @@ "Chatham Standard Time" ], "CountriesStandard": [ - "Chatham Islands (New Zealand)" + "Chatham Islands (New Zealand)", + "Pitt Islands (New Zealand)", + "South East Island (New Zealand)", + "The Fort (New Zealand)", + "Little Mangere Island (New Zealand)", + "Star Keys (New Zealand)", + "The Sisters (New Zealand)", + "Forty-Fours (New Zealand)" ] }, { From 7d64e1352de167cfc030036a3b6a5e9c6162a020 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 2 Nov 2021 09:38:12 +0100 Subject: [PATCH 24/67] Add additional options and most code documentation --- .../Classes/TimeZoneSettings.cs | 93 +++++++++++ .../Helper/ResultHelper.cs | 148 ++++++++++++------ .../Main.cs | 50 +++++- .../Properties/Resources.Designer.cs | 27 ++++ .../Properties/Resources.resx | 12 ++ 5 files changed, 278 insertions(+), 52 deletions(-) create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs new file mode 100644 index 00000000000..060fce52238 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Linq; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; +using Microsoft.PowerToys.Settings.UI.Library; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Classes +{ + /// + /// Additional settings for the time zone plugin. + /// + internal sealed class TimeZoneSettings + { + /// + /// Gets or sets a value indicating whether the time zone name of a time zone is shown in the results. + /// + internal bool ShowTimeZoneNames { get; set; } + + /// + /// Gets or sets a value indicating whether the time name of a time zone is shown in the results. + /// + internal bool ShowTimeNames { get; set; } + + /// + /// Gets or sets a value indicating whether the military name of a time zone is shown in the results. + /// + internal bool ShowMilitaryTimeZoneNames { get; set; } + + /// + /// Return a list with all settings. + /// + /// A list with all settings. + internal List GetAddtionalOptions() + { + var optionList = new List + { + new PluginAdditionalOption + { + Key = nameof(ShowTimeZoneNames), + DisplayLabel = Resources.ShowTimeZoneNames, + Value = true, + }, + new PluginAdditionalOption + { + Key = nameof(ShowTimeNames), + DisplayLabel = Resources.ShowTimeNames, + Value = true, + }, + new PluginAdditionalOption + { + Key = nameof(ShowMilitaryTimeZoneNames), + DisplayLabel = Resources.ShowMilitaryTimeZoneNames, + Value = false, + }, + }; + + return optionList; + } + + /// + /// Update this settings. + /// + /// The settings for all power launcher plugins. + internal void UpdateSettings(PowerLauncherPluginSettings settings) + { + if (settings is null || settings.AdditionalOptions is null) + { + return; + } + + ShowTimeZoneNames = GetOneBoolSetting(settings, nameof(ShowTimeZoneNames), true); + ShowTimeNames = GetOneBoolSetting(settings, nameof(ShowTimeNames), true); + ShowMilitaryTimeZoneNames = GetOneBoolSetting(settings, nameof(ShowMilitaryTimeZoneNames), false); + } + + /// + /// Return one setting of the given settings list with the given name. + /// + /// The object that contain all settings. + /// The name of the setting. + /// The fall-back value that is used when the setting si not found. + /// A settings value. + private static bool GetOneBoolSetting(PowerLauncherPluginSettings settings, string name, bool fallbackValue) + { + var option = settings.AdditionalOptions.FirstOrDefault(x => x.Key == name); + var command = option?.Value ?? fallbackValue; + return command; + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index a3ddc6c21ac..c4f441e0572 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -22,18 +22,21 @@ internal static class ResultHelper /// /// Return a list of s based on the given . /// - /// The to filter the . + /// A list with all possible time zones. + /// Additional options to limit the results. + /// The to filter the . + /// The path to the icon that is used for each result. /// A list with s. - internal static IEnumerable GetResults(IEnumerable timeZones, string search, string iconPath) + internal static IEnumerable GetResults(IEnumerable timeZones, TimeZoneSettings options, Query query, string iconPath) { var results = new List(); var utcNow = DateTime.UtcNow; foreach (var timeZone in timeZones) { - if (TimeZoneInfoMatchQuery(timeZone, search)) + if (TimeZoneInfoMatchQuery(timeZone, query)) { - results.AddRange(GetResults(timeZone, utcNow, search, iconPath)); + results.AddRange(GetResults(timeZone, options, query, iconPath, utcNow)); } } @@ -42,19 +45,19 @@ internal static IEnumerable GetResults(IEnumerable timeZone } /// - /// Check if the given contains a value that match the given . + /// Check if the given time zone contains a value that match the given . /// - /// The to check. - /// The that should match. + /// The time zone to check. + /// The that should match. /// if it's match, otherwise . - private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) + private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, Query query) { // allow search for "-x:xx" - if (search.StartsWith('-') && timeZone.OffsetString.StartsWith('-')) + if (query.Search.StartsWith('-') && timeZone.OffsetString.StartsWith('-')) { if (timeZone.OffsetString.ElementAtOrDefault(1) == '0') { - if (timeZone.OffsetString[2..].StartsWith(search[1..], StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.OffsetString[2..].StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -62,52 +65,52 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) } // allow search for "+xx:xx" - if (search.StartsWith('+') && timeZone.OffsetString.StartsWith(search[1..], StringComparison.InvariantCultureIgnoreCase)) + if (query.Search.StartsWith('+') && timeZone.OffsetString.StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) { return true; } // "-1x:xx" match here - if (timeZone.OffsetString.Contains(search, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.OffsetString.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) { return true; } - if (timeZone.Name.Contains(search, StringComparison.CurrentCultureIgnoreCase)) + if (timeZone.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) { return true; } - if (timeZone.MilitaryName.Contains(search, StringComparison.CurrentCultureIgnoreCase)) + if (timeZone.MilitaryName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) { return true; } - if (timeZone.Shortcut.Contains(search, StringComparison.CurrentCultureIgnoreCase)) + if (timeZone.Shortcut.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) { return true; } if (timeZone.TimeNamesDaylight != null - && timeZone.TimeNamesDaylight.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + && timeZone.TimeNamesDaylight.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))) { return true; } if (timeZone.TimeNamesStandard != null - && timeZone.TimeNamesStandard.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + && timeZone.TimeNamesStandard.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))) { return true; } if (timeZone.CountriesStandard != null - && timeZone.CountriesStandard.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + && timeZone.CountriesStandard.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))) { return true; } if (timeZone.CountriesDaylight != null - && timeZone.CountriesDaylight.Any(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase))) + && timeZone.CountriesDaylight.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))) { return true; } @@ -116,12 +119,15 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, string search) } /// - /// Return a list with based on the given . + /// Return a list with based on the given time zone. /// - /// The that contain the information for the . + /// The time zone that contain the information for the . + /// Additional options to limit the results. + /// The that should match. + /// The path to the icon that is used for each result. /// The current time in UTC for the . /// A list with . - private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utcNow, string search, string iconPath) + private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSettings options, Query query, string iconPath, DateTime utcNow) { // TODO: revisit time zone names // TODO: revisit standard time names @@ -129,10 +135,10 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc // TODO: add time zone shortcuts var results = new Collection(); - var countries = GetCountries(timeZone, search, maxLength: 100); + var countries = GetStandardCountries(timeZone, query, maxLength: 100); if (countries.Length > 0) { - var title = GetTitle(timeZone, utcNow, false); + var title = GetTitle(timeZone, options, utcNow, false); results.Add(new Result { @@ -140,14 +146,14 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc IcoPath = iconPath, SubTitle = countries, Title = title, - ToolTipData = new ToolTipData(title, GetToolTip(timeZone)), + ToolTipData = new ToolTipData(title, GetToolTip(timeZone, options)), }); } - var dstCountries = GetDstCountries(timeZone, search, maxLength: 100); + var dstCountries = GetDstCountries(timeZone, query, maxLength: 100); if (dstCountries.Length > 0) { - var title = GetTitle(timeZone, utcNow, true); + var title = GetTitle(timeZone, options, utcNow, true); results.Add(new Result { @@ -155,13 +161,20 @@ private static IEnumerable GetResults(OneTimeZone timeZone, DateTime utc IcoPath = iconPath, SubTitle = dstCountries, Title = title, - ToolTipData = new ToolTipData(title, GetDstToolTip(timeZone)), + ToolTipData = new ToolTipData(title, GetDstToolTip(timeZone, options)), }); } return results; } + /// + /// Return the current local time of the given time zone. + /// + /// The time zone that contain all information. + /// The current time in UTC. + /// indicate that the result is for a timezone that use a daylight saving time. + /// The current local time in a time zone. private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, bool daylightSavingTime) { foreach (var timeZoneInfo in TimeZoneInfo.GetSystemTimeZones()) @@ -178,18 +191,32 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, return result; } - private static string GetTitle(OneTimeZone timeZone, DateTime utcNow, bool daylightSavingTime) + /// + /// Return the title for the given time zone. + /// + /// The time zone that contain all information. + /// Additional options to limit the results. + /// The current time in UTC. + /// indicate that the result is for a timezone that use a daylight saving time. + /// A title for a time zone. + private static string GetTitle(OneTimeZone timeZone, TimeZoneSettings options, DateTime utcNow, bool daylightSavingTime) { var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow, daylightSavingTime); - var timeZoneNames = GetNames(timeZone, maxLength: 50); + var timeZoneNames = GetNames(timeZone, options, maxLength: 50); return $"{timeInZoneTime:HH:mm:ss} - {timeZoneNames}"; } - private static string GetToolTip(OneTimeZone timeZone) + /// + /// Return a tool-tip for the given time zone with countries that use the standard time. + /// + /// The time zone that contain all information. + /// Additional options to limit the results. + /// A tool-tip with countries that use the standard time. + private static string GetToolTip(OneTimeZone timeZone, TimeZoneSettings options) { - var countries = GetCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); - var names = GetNames(timeZone, maxLength: int.MaxValue); + var countries = GetStandardCountries(timeZone, null, maxLength: int.MaxValue); + var names = GetNames(timeZone, options, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); @@ -203,10 +230,16 @@ private static string GetToolTip(OneTimeZone timeZone) return stringBuilder.ToString(); } - private static string GetDstToolTip(OneTimeZone timeZone) + /// + /// Return a tool-tip for the given time zone with countries that use the daylight saving time. + /// + /// The time zone that contain all information. + /// Additional options to limit the type of the names. + /// A tool-tip with countries that use the daylight saving time. + private static string GetDstToolTip(OneTimeZone timeZone, TimeZoneSettings options) { - var dstCountries = GetDstCountries(timeZone, search: string.Empty, maxLength: int.MaxValue); - var names = GetNames(timeZone, maxLength: int.MaxValue); + var dstCountries = GetDstCountries(timeZone, null, maxLength: int.MaxValue); + var names = GetNames(timeZone, options, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); @@ -220,26 +253,33 @@ private static string GetDstToolTip(OneTimeZone timeZone) return stringBuilder.ToString(); } - private static string GetNames(OneTimeZone timeZone, int maxLength) + /// + /// Return a that contain all know names of the given time zone. + /// + /// The time zone that contain a hand of names. + /// Additional options to limit the type of the names. + /// The maximum length of the result . + /// A that contain names of a given time zone. + private static string GetNames(OneTimeZone timeZone, TimeZoneSettings options, int maxLength) { var names = new List(); - if (!string.IsNullOrWhiteSpace(timeZone.Name)) + if (!string.IsNullOrWhiteSpace(timeZone.Name) && options.ShowTimeZoneNames) { names.Add(timeZone.Name); } - if (!string.IsNullOrWhiteSpace(timeZone.MilitaryName)) + if (!string.IsNullOrWhiteSpace(timeZone.MilitaryName) && options.ShowMilitaryTimeZoneNames) { names.Add(timeZone.MilitaryName); } - if (timeZone.TimeNamesStandard != null) + if (timeZone.TimeNamesStandard != null && options.ShowTimeZoneNames) { names.AddRange(timeZone.TimeNamesStandard); } - if (timeZone.TimeNamesDaylight != null) + if (timeZone.TimeNamesDaylight != null && options.ShowTimeZoneNames) { names.AddRange(timeZone.TimeNamesDaylight); } @@ -278,18 +318,25 @@ private static string GetNames(OneTimeZone timeZone, int maxLength) return stringBuilder.ToString(); } - private static string GetCountries(OneTimeZone timeZone, string search, int maxLength) + /// + /// Return a that contain all countries that use the standard time of the given time zone. + /// + /// The time zone that contain the countries. + /// The that should match a country that use standard time. + /// The maximum length of the result . + /// A with countries that use the standard time. + private static string GetStandardCountries(OneTimeZone timeZone, Query? query, int maxLength) { IEnumerable countries; // TODO: translate country names - if (string.IsNullOrWhiteSpace(search)) + if (query is null || string.IsNullOrWhiteSpace(query.Search)) { countries = timeZone.CountriesStandard; } else { - countries = timeZone.CountriesStandard.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); + countries = timeZone.CountriesStandard.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)); } var stringBuilder = new StringBuilder(); @@ -359,18 +406,25 @@ private static string GetCountries(OneTimeZone timeZone, string search, int maxL return stringBuilder.ToString(); } - private static string GetDstCountries(OneTimeZone timeZone, string search, int maxLength) + /// + /// Return a that contain all countries that use the daylight saving time of the given time zone. + /// + /// The time zone that contain the countries. + /// The v + /// The maximum length of the result . + /// A with countries that use the daylight saving time. + private static string GetDstCountries(OneTimeZone timeZone, Query? query, int maxLength) { IEnumerable countries; // TODO: translate country names - if (string.IsNullOrWhiteSpace(search)) + if (query is null || string.IsNullOrWhiteSpace(query.Search)) { countries = timeZone.CountriesDaylight; } else { - countries = timeZone.CountriesDaylight.Where(x => x.Contains(search, StringComparison.CurrentCultureIgnoreCase)); + countries = timeZone.CountriesDaylight.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)); } var stringBuilder = new StringBuilder(); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index 5c47a1d655e..5ad5e27a49e 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -6,21 +6,31 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Windows.Controls; using ManagedCommon; using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; using Microsoft.PowerToys.Run.Plugin.TimeZone.Helper; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; +using Microsoft.PowerToys.Settings.UI.Library; using Wox.Plugin; namespace Microsoft.PowerToys.Run.Plugin.TimeZone { - public class Main : IPlugin, IContextMenu, IPluginI18n, IDisposable + /// + /// A power launcher plugin to search across time zones. + /// + public class Main : IPlugin, IContextMenu, IPluginI18n, ISettingProvider, IDisposable { /// /// The name of this assembly /// private readonly string _assemblyName; + /// + /// The settings for this plugin. + /// + private readonly TimeZoneSettings _timeZoneSettings; + /// /// The initial context for this plugin (contains API and meta-data) /// @@ -48,6 +58,7 @@ public Main() { _assemblyName = Assembly.GetExecutingAssembly().GetName().Name ?? GetTranslatedPluginTitle(); _defaultIconPath = "Images/reg.light.png"; + _timeZoneSettings = new TimeZoneSettings(); } /// @@ -60,6 +71,11 @@ public Main() /// public string Description => Resources.PluginDescription; + /// + /// Gets the additional options for this plugin. + /// + public IEnumerable AdditionalOptions => _timeZoneSettings.GetAddtionalOptions(); + /// /// Initialize the plugin with the given /// @@ -90,8 +106,8 @@ public List Query(Query query) return new List(0); } - var results = ResultHelper.GetResults(_timeZoneList.TimeZones, query.Search, _defaultIconPath).ToList(); - return results; + var results = ResultHelper.GetResults(_timeZoneList.TimeZones, _timeZoneSettings, query, _defaultIconPath); + return results.ToList(); } /// @@ -151,16 +167,40 @@ protected virtual void Dispose(bool disposing) _disposed = true; } - /// + /// + /// Return the translated plugin title. + /// + /// A translated plugin title. public string GetTranslatedPluginTitle() { return Resources.PluginTitle; } - /// + /// + /// Return the translated plugin description. + /// + /// A translated plugin description. public string GetTranslatedPluginDescription() { return Resources.PluginDescription; } + + /// + /// Return a additional setting panel for this plugin. + /// + /// A additional setting panel. + public Control CreateSettingPanel() + { + throw new NotImplementedException(); + } + + /// + /// Update the plugin settings + /// + /// The settings for all power launcher plugins. + public void UpdateSettings(PowerLauncherPluginSettings settings) + { + _timeZoneSettings.UpdateSettings(settings); + } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 98c2feefcc0..37054dc52ee 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -132,6 +132,33 @@ internal static string PluginTitle { } } + /// + /// Looks up a localized string similar to Show military time zone names. + /// + internal static string ShowMilitaryTimeZoneNames { + get { + return ResourceManager.GetString("ShowMilitaryTimeZoneNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show time names. + /// + internal static string ShowTimeNames { + get { + return ResourceManager.GetString("ShowTimeNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show time zone names. + /// + internal static string ShowTimeZoneNames { + get { + return ResourceManager.GetString("ShowTimeZoneNames", resourceCulture); + } + } + /// /// Looks up a localized string similar to Use daylight saving time. /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index d7d12310828..adf0f267483 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -141,6 +141,18 @@ Time zone + + Show military time zone names + PowerToysRun Option + + + Show time names + PowerToysRun Option + + + Show time zone names + PowerToysRun Option + Use daylight saving time From 97e0df95d4e012a15c004ade55d60671ca28fe56 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 12 Nov 2021 08:29:28 +0100 Subject: [PATCH 25/67] Fix unreadable TimeSpans in JSON and rename helper class --- .../Classes/OneTimeZone.cs | 9 +++++--- ...sonSettingsListHelper.cs => JsonHelper.cs} | 22 +++++++++---------- .../Helper/ResultHelper.cs | 18 +++++++-------- .../Main.cs | 2 +- 4 files changed, 26 insertions(+), 25 deletions(-) rename src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/{JsonSettingsListHelper.cs => JsonHelper.cs} (73%) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index 4cb05f4d1ac..2ce66fa4ac9 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.Linq; namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Classes @@ -13,6 +12,7 @@ public sealed class OneTimeZone { public OneTimeZone() { + Offset = "00:00"; Name = string.Empty; MilitaryName = string.Empty; Shortcut = string.Empty; @@ -26,7 +26,7 @@ public OneTimeZone() /// /// Gets or sets the time offset of this time zone (the gap from the UTC time zone) /// - public TimeSpan Offset { get; set; } + public string Offset { get; set; } /// /// Gets or sets the name of this time zone. @@ -63,6 +63,9 @@ public OneTimeZone() /// public IEnumerable CountriesDaylight { get; set; } - internal string OffsetString => Offset.ToString("-hh:mm", CultureInfo.InvariantCulture); + /// + /// Gets a compatible of the . + /// + internal TimeSpan OffsetAsTimeSpan => TimeSpan.TryParse(Offset, out var result) ? result : new TimeSpan(0, 0, 0); } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs similarity index 73% rename from src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs rename to src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs index 922b5e69de7..7518fcb0a61 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonSettingsListHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs @@ -3,29 +3,30 @@ // See the LICENSE file in the project root for more information. using System; +using System.Collections.Generic; +using System.ComponentModel; using System.IO; using System.Reflection; using System.Text.Json; -using System.Text.Json.Serialization; using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; using Wox.Plugin.Logger; namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { /// - /// Helper class to easier work with the JSON file that contains all Windows settings + /// Helper class to easier work with the JSON files /// - internal static class JsonSettingsListHelper + internal static class JsonHelper { /// - /// The name of the file that contains all settings for the query + /// The name of the file that contains all time zones. /// private const string _settingsFile = "timeZones.json"; /// - /// Read all possible Windows settings. + /// Read all possible time zones. /// - /// A list with all possible windows settings. + /// A object that contain a list with time zones. internal static TimeZoneList ReadAllPossibleTimezones() { var assembly = Assembly.GetExecutingAssembly(); @@ -42,21 +43,18 @@ internal static TimeZoneList ReadAllPossibleTimezones() throw new Exception("stream is null"); } - var options = new JsonSerializerOptions(); - options.Converters.Add(new JsonStringEnumConverter()); - using var reader = new StreamReader(stream); var text = reader.ReadToEnd(); - settings = JsonSerializer.Deserialize(text, options); + settings = JsonSerializer.Deserialize(text); } catch (JsonException exception) { - Log.Exception("Error loading settings JSON file", exception, typeof(JsonSettingsListHelper)); + Log.Exception("Error loading settings JSON file", exception, typeof(JsonHelper)); } catch (Exception exception) { - Log.Exception("Error loading settings JSON file", exception, typeof(JsonSettingsListHelper)); + Log.Exception("Error loading settings JSON file", exception, typeof(JsonHelper)); throw; } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index c4f441e0572..33377c2bd5d 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -53,11 +53,11 @@ internal static IEnumerable GetResults(IEnumerable timeZone private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, Query query) { // allow search for "-x:xx" - if (query.Search.StartsWith('-') && timeZone.OffsetString.StartsWith('-')) + if (query.Search.StartsWith('-') && timeZone.Offset.StartsWith('-')) { - if (timeZone.OffsetString.ElementAtOrDefault(1) == '0') + if (timeZone.Offset.ElementAtOrDefault(1) == '0') { - if (timeZone.OffsetString[2..].StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.Offset[2..].StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -65,13 +65,13 @@ private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, Query query) } // allow search for "+xx:xx" - if (query.Search.StartsWith('+') && timeZone.OffsetString.StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) + if (query.Search.StartsWith('+') && timeZone.Offset.StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) { return true; } // "-1x:xx" match here - if (timeZone.OffsetString.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) + if (timeZone.Offset.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -179,7 +179,7 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, { foreach (var timeZoneInfo in TimeZoneInfo.GetSystemTimeZones()) { - if (timeZoneInfo.BaseUtcOffset == timeZone.Offset + if (timeZoneInfo.BaseUtcOffset == timeZone.OffsetAsTimeSpan && timeZoneInfo.SupportsDaylightSavingTime == daylightSavingTime) { return TimeZoneInfo.ConvertTime(utcNow, timeZoneInfo); @@ -187,7 +187,7 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, } // Fall-back - var result = utcNow + timeZone.Offset; + var result = utcNow + timeZone.OffsetAsTimeSpan; return result; } @@ -220,7 +220,7 @@ private static string GetToolTip(OneTimeZone timeZone, TimeZoneSettings options) var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.OffsetString); + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.Offset); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.No); stringBuilder.AppendLine(string.Empty); stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); @@ -243,7 +243,7 @@ private static string GetDstToolTip(OneTimeZone timeZone, TimeZoneSettings optio var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.OffsetString); + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.Offset); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.Yes); stringBuilder.AppendLine(string.Empty); stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index 5ad5e27a49e..0f1f258dace 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -86,7 +86,7 @@ public void Init(PluginInitContext context) _context.API.ThemeChanged += OnThemeChanged; UpdateIconPath(_context.API.GetCurrentTheme()); - _timeZoneList = JsonSettingsListHelper.ReadAllPossibleTimezones(); + _timeZoneList = JsonHelper.ReadAllPossibleTimezones(); } /// From b090785ffb250743197501f85baf50aa40f99a76 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 12 Nov 2021 08:29:51 +0100 Subject: [PATCH 26/67] Fix not allowed commas in JSON file --- .../Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 88b8a33a7c3..d4b1f972978 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -582,7 +582,7 @@ "MilitaryName": "Echo Time Zone", "TimeNamesStandard": [ "Pakistan Standard Time", - "Yekaterinburg Time", + "Yekaterinburg Time" ], "CountriesStandard": [ "Amsterdam Island (French Southern and Antarctic Lands)", @@ -666,7 +666,7 @@ "Western Indonesian Time", "Christmas Island Time", "Krasnoyarsk Time", - "Western Indonesia Time", + "Western Indonesia Time" ], "CountriesStandard": [ "Cambodia", From 7e3e016b4526127f0ff1d806a1efe488b42c902c Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 12 Nov 2021 08:38:37 +0100 Subject: [PATCH 27/67] Cut to long time and time zone names in title --- .../Helper/ResultHelper.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 33377c2bd5d..b9482013fb0 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -298,7 +298,15 @@ private static string GetNames(OneTimeZone timeZone, TimeZoneSettings options, i } } - // To many names (first pass) => cut name length + // To many names (first pass) => use shortcut for "time" and "time zone" + if (stringBuilder.Length > maxLength) + { + stringBuilder.Replace("Time Zone", "TZ"); + stringBuilder.Replace("Standard Time", "ST"); + stringBuilder.Replace("Daylight Time", "DT"); + } + + // To many names (second pass) => cut name length if (stringBuilder.Length > maxLength) { foreach (var country in names) From d9b5ac916d554daf00764bc908c8ce27793feab2 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 12 Nov 2021 09:06:57 +0100 Subject: [PATCH 28/67] Fix missing results for names and offsets --- .../Helper/ResultHelper.cs | 132 +++++++----------- 1 file changed, 49 insertions(+), 83 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index b9482013fb0..df671405741 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -34,90 +34,13 @@ internal static IEnumerable GetResults(IEnumerable timeZone foreach (var timeZone in timeZones) { - if (TimeZoneInfoMatchQuery(timeZone, query)) - { - results.AddRange(GetResults(timeZone, options, query, iconPath, utcNow)); - } + results.AddRange(GetResults(timeZone, options, query, iconPath, utcNow)); } var orderResults = results.OrderBy(result => result.Title); return orderResults; } - /// - /// Check if the given time zone contains a value that match the given . - /// - /// The time zone to check. - /// The that should match. - /// if it's match, otherwise . - private static bool TimeZoneInfoMatchQuery(OneTimeZone timeZone, Query query) - { - // allow search for "-x:xx" - if (query.Search.StartsWith('-') && timeZone.Offset.StartsWith('-')) - { - if (timeZone.Offset.ElementAtOrDefault(1) == '0') - { - if (timeZone.Offset[2..].StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) - { - return true; - } - } - } - - // allow search for "+xx:xx" - if (query.Search.StartsWith('+') && timeZone.Offset.StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) - { - return true; - } - - // "-1x:xx" match here - if (timeZone.Offset.Contains(query.Search, StringComparison.InvariantCultureIgnoreCase)) - { - return true; - } - - if (timeZone.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) - { - return true; - } - - if (timeZone.MilitaryName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) - { - return true; - } - - if (timeZone.Shortcut.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) - { - return true; - } - - if (timeZone.TimeNamesDaylight != null - && timeZone.TimeNamesDaylight.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))) - { - return true; - } - - if (timeZone.TimeNamesStandard != null - && timeZone.TimeNamesStandard.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))) - { - return true; - } - - if (timeZone.CountriesStandard != null - && timeZone.CountriesStandard.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))) - { - return true; - } - - if (timeZone.CountriesDaylight != null - && timeZone.CountriesDaylight.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))) - { - return true; - } - - return false; - } - /// /// Return a list with based on the given time zone. /// @@ -135,8 +58,8 @@ private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSett // TODO: add time zone shortcuts var results = new Collection(); - var countries = GetStandardCountries(timeZone, query, maxLength: 100); - if (countries.Length > 0) + var standardCountires = GetStandardCountries(timeZone, query, maxLength: 100); + if (standardCountires.Length > 0 || MatchStandardNames(timeZone, query) || MatchNames(timeZone, query) || MatchOffset(timeZone, query)) { var title = GetTitle(timeZone, options, utcNow, false); @@ -144,14 +67,14 @@ private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSett { ContextData = timeZone, IcoPath = iconPath, - SubTitle = countries, + SubTitle = standardCountires, Title = title, ToolTipData = new ToolTipData(title, GetToolTip(timeZone, options)), }); } var dstCountries = GetDstCountries(timeZone, query, maxLength: 100); - if (dstCountries.Length > 0) + if (dstCountries.Length > 0 || MatchDaylightNames(timeZone, query) || MatchNames(timeZone, query) || MatchOffset(timeZone, query)) { var title = GetTitle(timeZone, options, utcNow, true); @@ -298,7 +221,7 @@ private static string GetNames(OneTimeZone timeZone, TimeZoneSettings options, i } } - // To many names (first pass) => use shortcut for "time" and "time zone" + // To many names (first pass) => use shortcuts if (stringBuilder.Length > maxLength) { stringBuilder.Replace("Time Zone", "TZ"); @@ -501,5 +424,48 @@ private static string GetDstCountries(OneTimeZone timeZone, Query? query, int ma return stringBuilder.ToString(); } + + private static bool MatchNames(OneTimeZone timeZone, Query query) + { + var result = timeZone.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase) + || timeZone.MilitaryName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); + + return result; + } + + private static bool MatchDaylightNames(OneTimeZone timeZone, Query query) + { + var result = timeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + return result; + } + + private static bool MatchStandardNames(OneTimeZone timeZone, Query query) + { + var result = timeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + return result; + } + + private static bool MatchOffset(OneTimeZone timeZone, Query query) + { + // allow search for "-x:xx" + if (query.Search.StartsWith('-') && timeZone.Offset.StartsWith('-')) + { + if (timeZone.Offset.ElementAtOrDefault(1) == '0') + { + if (timeZone.Offset[2..].StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) + { + return true; + } + } + } + + // allow search for "+xx:xx" + if (query.Search.StartsWith('+') && timeZone.Offset.StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) + { + return true; + } + + return false; + } } } From 98deef5bb5a9fad8e0455ad978865aac25f362c4 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 12 Nov 2021 09:47:55 +0100 Subject: [PATCH 29/67] Better result and show only one result when offset are identical (respect daylight saving time) --- .../Helper/ResultHelper.cs | 190 ++++++++++++++++-- 1 file changed, 168 insertions(+), 22 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index df671405741..c1ae30ff49c 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -12,6 +12,10 @@ using Mono.Collections.Generic; using Wox.Plugin; +// TODO: revisit time zone names +// TODO: revisit standard time names +// TODO: revisit DST time names +// TODO: add time zone shortcuts namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { /// @@ -34,7 +38,15 @@ internal static IEnumerable GetResults(IEnumerable timeZone foreach (var timeZone in timeZones) { - results.AddRange(GetResults(timeZone, options, query, iconPath, utcNow)); + if (MatchNames(timeZone, query) + || MatchStandardNames(timeZone, query) + || MatchDaylightNames(timeZone, query) + || MatchStandardCountries(timeZone, query) + || MatchDaylightCountries(timeZone, query) + || MatchOffset(timeZone, query)) + { + results.AddRange(GetResults(timeZone, options, query, iconPath, utcNow)); + } } var orderResults = results.OrderBy(result => result.Title); @@ -52,39 +64,46 @@ internal static IEnumerable GetResults(IEnumerable timeZone /// A list with . private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSettings options, Query query, string iconPath, DateTime utcNow) { - // TODO: revisit time zone names - // TODO: revisit standard time names - // TODO: revisit DST time names - // TODO: add time zone shortcuts var results = new Collection(); - var standardCountires = GetStandardCountries(timeZone, query, maxLength: 100); - if (standardCountires.Length > 0 || MatchStandardNames(timeZone, query) || MatchNames(timeZone, query) || MatchOffset(timeZone, query)) - { - var title = GetTitle(timeZone, options, utcNow, false); + var standardTitle = GetTitle(timeZone, options, utcNow, false); + var daylightTitle = GetTitle(timeZone, options, utcNow, true); + if (standardTitle == daylightTitle) + { results.Add(new Result { ContextData = timeZone, IcoPath = iconPath, - SubTitle = standardCountires, - Title = title, - ToolTipData = new ToolTipData(title, GetToolTip(timeZone, options)), + Title = standardTitle, + SubTitle = GetAllCountries(timeZone, query, maxLength: 100), + ToolTipData = new ToolTipData(standardTitle, GetAllToolTip(timeZone, options)), }); + + return results; } - var dstCountries = GetDstCountries(timeZone, query, maxLength: 100); - if (dstCountries.Length > 0 || MatchDaylightNames(timeZone, query) || MatchNames(timeZone, query) || MatchOffset(timeZone, query)) + if (MatchStandardCountries(timeZone, query) || MatchStandardNames(timeZone, query) || MatchNames(timeZone, query) || MatchOffset(timeZone, query)) { - var title = GetTitle(timeZone, options, utcNow, true); + results.Add(new Result + { + ContextData = timeZone, + IcoPath = iconPath, + SubTitle = GetStandardCountries(timeZone, query, maxLength: 100), + Title = standardTitle, + ToolTipData = new ToolTipData(standardTitle, GetStandardToolTip(timeZone, options)), + }); + } + if (MatchDaylightCountries(timeZone, query) || MatchDaylightNames(timeZone, query) || MatchNames(timeZone, query) || MatchOffset(timeZone, query)) + { results.Add(new Result { ContextData = timeZone, IcoPath = iconPath, - SubTitle = dstCountries, - Title = title, - ToolTipData = new ToolTipData(title, GetDstToolTip(timeZone, options)), + SubTitle = GetDaylightCountries(timeZone, query, maxLength: 100), + Title = daylightTitle, + ToolTipData = new ToolTipData(daylightTitle, GetDaylightToolTip(timeZone, options)), }); } @@ -136,7 +155,7 @@ private static string GetTitle(OneTimeZone timeZone, TimeZoneSettings options, D /// The time zone that contain all information. /// Additional options to limit the results. /// A tool-tip with countries that use the standard time. - private static string GetToolTip(OneTimeZone timeZone, TimeZoneSettings options) + private static string GetStandardToolTip(OneTimeZone timeZone, TimeZoneSettings options) { var countries = GetStandardCountries(timeZone, null, maxLength: int.MaxValue); var names = GetNames(timeZone, options, maxLength: int.MaxValue); @@ -159,9 +178,9 @@ private static string GetToolTip(OneTimeZone timeZone, TimeZoneSettings options) /// The time zone that contain all information. /// Additional options to limit the type of the names. /// A tool-tip with countries that use the daylight saving time. - private static string GetDstToolTip(OneTimeZone timeZone, TimeZoneSettings options) + private static string GetDaylightToolTip(OneTimeZone timeZone, TimeZoneSettings options) { - var dstCountries = GetDstCountries(timeZone, null, maxLength: int.MaxValue); + var dstCountries = GetDaylightCountries(timeZone, null, maxLength: int.MaxValue); var names = GetNames(timeZone, options, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); @@ -176,6 +195,32 @@ private static string GetDstToolTip(OneTimeZone timeZone, TimeZoneSettings optio return stringBuilder.ToString(); } + /// + /// Return a tool-tip for the given time zone with countries. + /// + /// The time zone that contain all information. + /// Additional options to limit the type of the names. + /// A tool-tip with countries. + private static string GetAllToolTip(OneTimeZone timeZone, TimeZoneSettings options) + { + var countries = GetStandardCountries(timeZone, null, maxLength: int.MaxValue); + var dstCountries = GetDaylightCountries(timeZone, null, maxLength: int.MaxValue); + var names = GetNames(timeZone, options, maxLength: int.MaxValue); + + var stringBuilder = new StringBuilder(); + + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.Offset); + stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.Yes); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Countries).Append(':').Append(' ').AppendLine(countries); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.CountriesWithDst).Append(':').Append(' ').AppendLine(dstCountries); + + return stringBuilder.ToString(); + } + /// /// Return a that contain all know names of the given time zone. /// @@ -344,7 +389,7 @@ private static string GetStandardCountries(OneTimeZone timeZone, Query? query, i /// The v /// The maximum length of the result . /// A with countries that use the daylight saving time. - private static string GetDstCountries(OneTimeZone timeZone, Query? query, int maxLength) + private static string GetDaylightCountries(OneTimeZone timeZone, Query? query, int maxLength) { IEnumerable countries; @@ -425,6 +470,95 @@ private static string GetDstCountries(OneTimeZone timeZone, Query? query, int ma return stringBuilder.ToString(); } + /// + /// Return a that contain all countries of the given time zone. + /// + /// The time zone that contain the countries. + /// The v + /// The maximum length of the result . + /// A with countries. + private static string GetAllCountries(OneTimeZone timeZone, Query? query, int maxLength) + { + IEnumerable countries; + + // TODO: translate country names + if (query is null || string.IsNullOrWhiteSpace(query.Search)) + { + countries = timeZone.CountriesDaylight.Concat(timeZone.CountriesStandard); + } + else + { + countries = timeZone.CountriesDaylight.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) + .Concat(timeZone.CountriesStandard.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))); + } + + var stringBuilder = new StringBuilder(); + var lastEntry = countries.LastOrDefault(); + + foreach (var country in countries) + { + stringBuilder.Append(country); + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + + // To many countries (first pass) => remove extra info + if (stringBuilder.Length > maxLength) + { + stringBuilder.Clear(); + + foreach (var country in countries) + { + var extraInfoStart = country.IndexOf('(', StringComparison.InvariantCultureIgnoreCase); + if (extraInfoStart > 0) + { + stringBuilder.Append(country[..extraInfoStart]); + } + else + { + stringBuilder.Append(country); + } + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + } + + // To many countries (second pass) => remove extra info and cut country length + if (stringBuilder.Length > maxLength) + { + foreach (var country in countries) + { + var extraInfoStart = country.IndexOf('(', StringComparison.InvariantCultureIgnoreCase); + if (extraInfoStart > 0) + { + stringBuilder.SaveAppend(country[..extraInfoStart], maxLength: 5); + } + else + { + stringBuilder.SaveAppend(country, maxLength: 5); + } + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + } + + stringBuilder.CutTooLong(maxLength); + + return stringBuilder.ToString(); + } + private static bool MatchNames(OneTimeZone timeZone, Query query) { var result = timeZone.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase) @@ -467,5 +601,17 @@ private static bool MatchOffset(OneTimeZone timeZone, Query query) return false; } + + private static bool MatchStandardCountries(OneTimeZone timeZone, Query query) + { + var result = timeZone.CountriesStandard?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + return result; + } + + private static bool MatchDaylightCountries(OneTimeZone timeZone, Query query) + { + var result = timeZone.CountriesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + return result; + } } } From 6d78ceaee5a8bdfdd71341404659d3bddba4889b Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 28 Dec 2021 09:56:42 +0100 Subject: [PATCH 30/67] Show generic name fot time zones without names --- .../Helper/ResultHelper.cs | 71 +++++++++++-------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index c1ae30ff49c..afbcc72b213 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -252,46 +252,61 @@ private static string GetNames(OneTimeZone timeZone, TimeZoneSettings options, i names.AddRange(timeZone.TimeNamesDaylight); } - var stringBuilder = new StringBuilder(); - var lastEntry = names.LastOrDefault(); - - foreach (var name in names) + if (names.Any()) { - stringBuilder.Append(name); + var stringBuilder = new StringBuilder(); + var lastEntry = names.LastOrDefault(); - if (name != lastEntry) + foreach (var name in names) { - stringBuilder.Append(','); - stringBuilder.Append(' '); - } - } + stringBuilder.Append(name); - // To many names (first pass) => use shortcuts - if (stringBuilder.Length > maxLength) - { - stringBuilder.Replace("Time Zone", "TZ"); - stringBuilder.Replace("Standard Time", "ST"); - stringBuilder.Replace("Daylight Time", "DT"); - } + if (name != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } - // To many names (second pass) => cut name length - if (stringBuilder.Length > maxLength) - { - foreach (var country in names) + // To many names (first pass) => use shortcuts + if (stringBuilder.Length > maxLength) { - stringBuilder.SaveAppend(country, maxLength: 5); + stringBuilder.Replace("Time Zone", "TZ"); + stringBuilder.Replace("Standard Time", "ST"); + stringBuilder.Replace("Daylight Time", "DT"); + } - if (country != lastEntry) + // To many names (second pass) => cut name length + if (stringBuilder.Length > maxLength) + { + foreach (var country in names) { - stringBuilder.Append(','); - stringBuilder.Append(' '); + stringBuilder.SaveAppend(country, maxLength: 5); + + if (country != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } } } - } - stringBuilder.CutTooLong(maxLength); + stringBuilder.CutTooLong(maxLength); - return stringBuilder.ToString(); + return stringBuilder.ToString(); + } + else + { + // fall-back + if (timeZone.Offset.StartsWith('-')) + { + return $"UTC{timeZone.Offset}"; + } + else + { + return $"UTC+{timeZone.Offset}"; + } + } } /// From c54be3a74b5d40c0b7d90fad6c5799f1b2f82dc6 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 28 Dec 2021 10:28:21 +0100 Subject: [PATCH 31/67] Typo fixes --- .github/actions/spell-check/expect.txt | 1 + .../Classes/TimeZoneSettings.cs | 4 +- .../Helper/ResultHelper.cs | 20 ++- .../Main.cs | 2 +- .../Properties/Resources.Designer.cs | 133 ++++++++++++++---- .../Properties/Resources.resx | 32 +++++ 6 files changed, 156 insertions(+), 36 deletions(-) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 073a291b7f4..900299a43dc 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -2163,6 +2163,7 @@ USESTDHANDLES ushort USRDLL Utc +utc utf utils uuidof diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs index 060fce52238..8cfbffbea55 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs @@ -30,10 +30,10 @@ internal sealed class TimeZoneSettings internal bool ShowMilitaryTimeZoneNames { get; set; } /// - /// Return a list with all settings. + /// Return a list with all settings. Additional /// /// A list with all settings. - internal List GetAddtionalOptions() + internal List GetAdditionalOptions() { var optionList = new List { diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index afbcc72b213..07cb43d7665 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -115,7 +115,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSett /// /// The time zone that contain all information. /// The current time in UTC. - /// indicate that the result is for a timezone that use a daylight saving time. + /// indicate that the result is for a time zone that use a daylight saving time. /// The current local time in a time zone. private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, bool daylightSavingTime) { @@ -139,7 +139,7 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, /// The time zone that contain all information. /// Additional options to limit the results. /// The current time in UTC. - /// indicate that the result is for a timezone that use a daylight saving time. + /// indicate that the result is for a time zone that use a daylight saving time. /// A title for a time zone. private static string GetTitle(OneTimeZone timeZone, TimeZoneSettings options, DateTime utcNow, bool daylightSavingTime) { @@ -271,9 +271,10 @@ private static string GetNames(OneTimeZone timeZone, TimeZoneSettings options, i // To many names (first pass) => use shortcuts if (stringBuilder.Length > maxLength) { - stringBuilder.Replace("Time Zone", "TZ"); - stringBuilder.Replace("Standard Time", "ST"); - stringBuilder.Replace("Daylight Time", "DT"); + stringBuilder.Replace(Resources.TimeZone, Resources.TimeZoneShortcut); + stringBuilder.Replace(Resources.StandardTime, Resources.TimeZoneShortcut); + stringBuilder.Replace(Resources.DaylightTime, Resources.DaylightTimeShortcut); + stringBuilder.Replace(Resources.Time, Resources.TimeShortcut); } // To many names (second pass) => cut name length @@ -298,14 +299,19 @@ private static string GetNames(OneTimeZone timeZone, TimeZoneSettings options, i else { // fall-back - if (timeZone.Offset.StartsWith('-')) + var totalMinutes = timeZone.OffsetAsTimeSpan.TotalMinutes; + if (totalMinutes < 0) { return $"UTC{timeZone.Offset}"; } - else + else if (totalMinutes > 0) { return $"UTC+{timeZone.Offset}"; } + else + { + return "UTC±00:00"; + } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index 0f1f258dace..616be958124 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -74,7 +74,7 @@ public Main() /// /// Gets the additional options for this plugin. /// - public IEnumerable AdditionalOptions => _timeZoneSettings.GetAddtionalOptions(); + public IEnumerable AdditionalOptions => _timeZoneSettings.GetAdditionalOptions(); /// /// Initialize the plugin with the given diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 37054dc52ee..bbfcfee491d 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Properties { /// - /// A strongly-typed resource class, for looking up localized strings, etc. + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -33,7 +33,7 @@ internal Resources() { } /// - /// Returns the cached ResourceManager instance used by this class. + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Resources() { } /// - /// Looks up a localized string similar to Copy time. + /// Sucht eine lokalisierte Zeichenfolge, die Copy time ähnelt. /// internal static string CopyTime { get { @@ -70,7 +70,7 @@ internal static string CopyTime { } /// - /// Looks up a localized string similar to Countries. + /// Sucht eine lokalisierte Zeichenfolge, die Countries ähnelt. /// internal static string Countries { get { @@ -79,7 +79,7 @@ internal static string Countries { } /// - /// Looks up a localized string similar to Countries with daylight saving time. + /// Sucht eine lokalisierte Zeichenfolge, die Countries with daylight saving time ähnelt. /// internal static string CountriesWithDst { get { @@ -88,7 +88,25 @@ internal static string CountriesWithDst { } /// - /// Looks up a localized string similar to Names. + /// Sucht eine lokalisierte Zeichenfolge, die Daylight Time ähnelt. + /// + internal static string DaylightTime { + get { + return ResourceManager.GetString("DaylightTime", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die DT ähnelt. + /// + internal static string DaylightTimeShortcut { + get { + return ResourceManager.GetString("DaylightTimeShortcut", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Names ähnelt. /// internal static string Names { get { @@ -97,7 +115,7 @@ internal static string Names { } /// - /// Looks up a localized string similar to No. + /// Sucht eine lokalisierte Zeichenfolge, die No ähnelt. /// internal static string No { get { @@ -106,7 +124,7 @@ internal static string No { } /// - /// Looks up a localized string similar to Offset. + /// Sucht eine lokalisierte Zeichenfolge, die Offset ähnelt. /// internal static string Offset { get { @@ -115,7 +133,7 @@ internal static string Offset { } /// - /// Looks up a localized string similar to Gets the the current time of a time zone. + /// Sucht eine lokalisierte Zeichenfolge, die Gets the the current time of a time zone ähnelt. /// internal static string PluginDescription { get { @@ -124,7 +142,7 @@ internal static string PluginDescription { } /// - /// Looks up a localized string similar to Time zone. + /// Sucht eine lokalisierte Zeichenfolge, die Time zone ähnelt. /// internal static string PluginTitle { get { @@ -133,7 +151,7 @@ internal static string PluginTitle { } /// - /// Looks up a localized string similar to Show military time zone names. + /// Sucht eine lokalisierte Zeichenfolge, die Show military time zone names ähnelt. /// internal static string ShowMilitaryTimeZoneNames { get { @@ -142,7 +160,7 @@ internal static string ShowMilitaryTimeZoneNames { } /// - /// Looks up a localized string similar to Show time names. + /// Sucht eine lokalisierte Zeichenfolge, die Show time names ähnelt. /// internal static string ShowTimeNames { get { @@ -151,7 +169,7 @@ internal static string ShowTimeNames { } /// - /// Looks up a localized string similar to Show time zone names. + /// Sucht eine lokalisierte Zeichenfolge, die Show time zone names ähnelt. /// internal static string ShowTimeZoneNames { get { @@ -160,7 +178,61 @@ internal static string ShowTimeZoneNames { } /// - /// Looks up a localized string similar to Use daylight saving time. + /// Sucht eine lokalisierte Zeichenfolge, die Standard Time ähnelt. + /// + internal static string StandardTime { + get { + return ResourceManager.GetString("StandardTime", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die ST ähnelt. + /// + internal static string StandardTimeShortcut { + get { + return ResourceManager.GetString("StandardTimeShortcut", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Time ähnelt. + /// + internal static string Time { + get { + return ResourceManager.GetString("Time", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die T ähnelt. + /// + internal static string TimeShortcut { + get { + return ResourceManager.GetString("TimeShortcut", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Time Zone ähnelt. + /// + internal static string TimeZone { + get { + return ResourceManager.GetString("TimeZone", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die TZ ähnelt. + /// + internal static string TimeZoneShortcut { + get { + return ResourceManager.GetString("TimeZoneShortcut", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Use daylight saving time ähnelt. /// internal static string UseDst { get { @@ -169,7 +241,16 @@ internal static string UseDst { } /// - /// Looks up a localized string similar to Yes. + /// Sucht eine lokalisierte Zeichenfolge, die UTC ähnelt. + /// + internal static string UTC { + get { + return ResourceManager.GetString("UTC", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Yes ähnelt. /// internal static string Yes { get { diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index adf0f267483..f75cf84b756 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -126,6 +126,13 @@ Countries with daylight saving time + + Daylight Time + + + DT + Short for "Daylight Time" + Names @@ -153,9 +160,34 @@ Show time zone names PowerToysRun Option + + Standard Time + + + ST + Short for "Standard Time" + + + Time + + + T + Short for "Time" + + + Time Zone + + + TZ + Short for "Time Zone" + Use daylight saving time + + UTC + Short for "Coordinated Universal Time" + Yes From b8bb367a2611f2ee32c0f1d1b99f2d7b9fcbda61 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 30 Dec 2021 18:48:48 +0100 Subject: [PATCH 32/67] Fix not working serach by shortcuts --- .../Helper/ResultHelper.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 07cb43d7665..acaeb6739f3 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -38,7 +38,8 @@ internal static IEnumerable GetResults(IEnumerable timeZone foreach (var timeZone in timeZones) { - if (MatchNames(timeZone, query) + if (MatchShortcuts(timeZone, query) + || MatchNames(timeZone, query) || MatchStandardNames(timeZone, query) || MatchDaylightNames(timeZone, query) || MatchStandardCountries(timeZone, query) @@ -580,6 +581,12 @@ private static string GetAllCountries(OneTimeZone timeZone, Query? query, int ma return stringBuilder.ToString(); } + private static bool MatchShortcuts(OneTimeZone timeZone, Query query) + { + var result = timeZone.Shortcut.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); + return result; + } + private static bool MatchNames(OneTimeZone timeZone, Query query) { var result = timeZone.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase) From 26b48443ed592532908aea18fe1aa6692eb6437e Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 30 Dec 2021 18:49:29 +0100 Subject: [PATCH 33/67] Fix german resx file -> english resx file --- .../Properties/Resources.Designer.cs | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index bbfcfee491d..02bba3bd5a7 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Properties { /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ internal Resources() { } /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Resources() { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Copy time ähnelt. + /// Looks up a localized string similar to Copy time. /// internal static string CopyTime { get { @@ -70,7 +70,7 @@ internal static string CopyTime { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Countries ähnelt. + /// Looks up a localized string similar to Countries. /// internal static string Countries { get { @@ -79,7 +79,7 @@ internal static string Countries { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Countries with daylight saving time ähnelt. + /// Looks up a localized string similar to Countries with daylight saving time. /// internal static string CountriesWithDst { get { @@ -88,7 +88,7 @@ internal static string CountriesWithDst { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Daylight Time ähnelt. + /// Looks up a localized string similar to Daylight Time. /// internal static string DaylightTime { get { @@ -97,7 +97,7 @@ internal static string DaylightTime { } /// - /// Sucht eine lokalisierte Zeichenfolge, die DT ähnelt. + /// Looks up a localized string similar to DT. /// internal static string DaylightTimeShortcut { get { @@ -106,7 +106,7 @@ internal static string DaylightTimeShortcut { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Names ähnelt. + /// Looks up a localized string similar to Names. /// internal static string Names { get { @@ -115,7 +115,7 @@ internal static string Names { } /// - /// Sucht eine lokalisierte Zeichenfolge, die No ähnelt. + /// Looks up a localized string similar to No. /// internal static string No { get { @@ -124,7 +124,7 @@ internal static string No { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Offset ähnelt. + /// Looks up a localized string similar to Offset. /// internal static string Offset { get { @@ -133,7 +133,7 @@ internal static string Offset { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Gets the the current time of a time zone ähnelt. + /// Looks up a localized string similar to Gets the the current time of a time zone. /// internal static string PluginDescription { get { @@ -142,7 +142,7 @@ internal static string PluginDescription { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Time zone ähnelt. + /// Looks up a localized string similar to Time zone. /// internal static string PluginTitle { get { @@ -151,7 +151,7 @@ internal static string PluginTitle { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Show military time zone names ähnelt. + /// Looks up a localized string similar to Show military time zone names. /// internal static string ShowMilitaryTimeZoneNames { get { @@ -160,7 +160,7 @@ internal static string ShowMilitaryTimeZoneNames { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Show time names ähnelt. + /// Looks up a localized string similar to Show time names. /// internal static string ShowTimeNames { get { @@ -169,7 +169,7 @@ internal static string ShowTimeNames { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Show time zone names ähnelt. + /// Looks up a localized string similar to Show time zone names. /// internal static string ShowTimeZoneNames { get { @@ -178,7 +178,7 @@ internal static string ShowTimeZoneNames { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Standard Time ähnelt. + /// Looks up a localized string similar to Standard Time. /// internal static string StandardTime { get { @@ -187,7 +187,7 @@ internal static string StandardTime { } /// - /// Sucht eine lokalisierte Zeichenfolge, die ST ähnelt. + /// Looks up a localized string similar to ST. /// internal static string StandardTimeShortcut { get { @@ -196,7 +196,7 @@ internal static string StandardTimeShortcut { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Time ähnelt. + /// Looks up a localized string similar to Time. /// internal static string Time { get { @@ -205,7 +205,7 @@ internal static string Time { } /// - /// Sucht eine lokalisierte Zeichenfolge, die T ähnelt. + /// Looks up a localized string similar to T. /// internal static string TimeShortcut { get { @@ -214,7 +214,7 @@ internal static string TimeShortcut { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Time Zone ähnelt. + /// Looks up a localized string similar to Time Zone. /// internal static string TimeZone { get { @@ -223,7 +223,7 @@ internal static string TimeZone { } /// - /// Sucht eine lokalisierte Zeichenfolge, die TZ ähnelt. + /// Looks up a localized string similar to TZ. /// internal static string TimeZoneShortcut { get { @@ -232,7 +232,7 @@ internal static string TimeZoneShortcut { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Use daylight saving time ähnelt. + /// Looks up a localized string similar to Use daylight saving time. /// internal static string UseDst { get { @@ -241,7 +241,7 @@ internal static string UseDst { } /// - /// Sucht eine lokalisierte Zeichenfolge, die UTC ähnelt. + /// Looks up a localized string similar to UTC. /// internal static string UTC { get { @@ -250,7 +250,7 @@ internal static string UTC { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Yes ähnelt. + /// Looks up a localized string similar to Yes. /// internal static string Yes { get { From 3fe4821422c60fefe9e998b8140d369a15b1ad1a Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 30 Dec 2021 19:18:27 +0100 Subject: [PATCH 34/67] Translate all names and countires --- .../Helper/ResultHelper.cs | 5 +- .../Helper/TranslationHelper.cs | 133 ++++++++++++++++++ .../Main.cs | 2 + 3 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/TranslationHelper.cs diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index acaeb6739f3..3291ad23611 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -15,7 +15,7 @@ // TODO: revisit time zone names // TODO: revisit standard time names // TODO: revisit DST time names -// TODO: add time zone shortcuts +// TODO: add more time zone shortcuts namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { /// @@ -327,7 +327,6 @@ private static string GetStandardCountries(OneTimeZone timeZone, Query? query, i { IEnumerable countries; - // TODO: translate country names if (query is null || string.IsNullOrWhiteSpace(query.Search)) { countries = timeZone.CountriesStandard; @@ -415,7 +414,6 @@ private static string GetDaylightCountries(OneTimeZone timeZone, Query? query, i { IEnumerable countries; - // TODO: translate country names if (query is null || string.IsNullOrWhiteSpace(query.Search)) { countries = timeZone.CountriesDaylight; @@ -503,7 +501,6 @@ private static string GetAllCountries(OneTimeZone timeZone, Query? query, int ma { IEnumerable countries; - // TODO: translate country names if (query is null || string.IsNullOrWhiteSpace(query.Search)) { countries = timeZone.CountriesDaylight.Concat(timeZone.CountriesStandard); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/TranslationHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/TranslationHelper.cs new file mode 100644 index 00000000000..e5a395ec4f8 --- /dev/null +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/TranslationHelper.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Globalization; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; +using Wox.Plugin.Logger; + +namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper +{ + /// + /// Helper class to easier work with translations. + /// + internal static class TranslationHelper + { + /// + /// Translate all names and countries of the class. + /// + /// A class that contain all possible time zones. + internal static void TranslateAllSettings(in TimeZoneList timeZoneList) + { + if (timeZoneList?.TimeZones is null) + { + return; + } + + foreach (var timeZone in timeZoneList.TimeZones) + { + // Translate Name + if (!string.IsNullOrWhiteSpace(timeZone.Name)) + { + var name = Resources.ResourceManager.GetString(timeZone.Name, CultureInfo.InvariantCulture); + if (string.IsNullOrEmpty(name)) + { + Log.Warn($"Resource string for [{timeZone.Name}] not found", typeof(TranslationHelper)); + } + + timeZone.Name = name ?? timeZone.Name ?? string.Empty; + } + + // Translate MilitaryName + if (!string.IsNullOrWhiteSpace(timeZone.MilitaryName)) + { + var militaryName = Resources.ResourceManager.GetString(timeZone.MilitaryName, CultureInfo.CurrentCulture); + if (string.IsNullOrEmpty(militaryName)) + { + Log.Warn($"Resource string for [{timeZone.MilitaryName}] not found", typeof(TranslationHelper)); + } + + timeZone.MilitaryName = militaryName ?? timeZone.MilitaryName ?? string.Empty; + } + + // Translate TimeNamesDaylight + if (!(timeZone.TimeNamesDaylight is null)) + { + var timeNamesDaylight = new List(); + + foreach (var nameDaylight in timeZone.TimeNamesDaylight) + { + var nameDaylightT = Resources.ResourceManager.GetString(nameDaylight, CultureInfo.CurrentCulture); + if (string.IsNullOrEmpty(nameDaylightT)) + { + Log.Warn($"Resource string for [{nameDaylight}] not found", typeof(TranslationHelper)); + } + + timeNamesDaylight.Add(nameDaylightT ?? nameDaylight ?? string.Empty); + } + + timeZone.TimeNamesDaylight = timeNamesDaylight; + } + + // Translate TimeNamesStandard + if (!(timeZone.TimeNamesStandard is null)) + { + var timeNamesStandard = new List(); + + foreach (var nameStandard in timeZone.TimeNamesStandard) + { + var nameStandardT = Resources.ResourceManager.GetString(nameStandard, CultureInfo.CurrentCulture); + if (string.IsNullOrEmpty(nameStandardT)) + { + Log.Warn($"Resource string for [{nameStandard}] not found", typeof(TranslationHelper)); + } + + timeNamesStandard.Add(nameStandardT ?? nameStandard ?? string.Empty); + } + + timeZone.TimeNamesStandard = timeNamesStandard; + } + + // Translate CountriesDaylight + if (!(timeZone.CountriesDaylight is null)) + { + var countriesDaylight = new List(); + + foreach (var countryDaylight in timeZone.CountriesDaylight) + { + var countryDaylightT = Resources.ResourceManager.GetString(countryDaylight, CultureInfo.CurrentCulture); + if (string.IsNullOrEmpty(countryDaylightT)) + { + Log.Warn($"Resource string for [{countryDaylight}] not found", typeof(TranslationHelper)); + } + + countriesDaylight.Add(countryDaylightT ?? countryDaylight ?? string.Empty); + } + + timeZone.CountriesDaylight = countriesDaylight; + } + + // Translate CountriesStandard + if (!(timeZone.CountriesStandard is null)) + { + var countriesStandard = new List(); + + foreach (var countryStandard in timeZone.CountriesStandard) + { + var countryStandardT = Resources.ResourceManager.GetString(countryStandard, CultureInfo.CurrentCulture); + if (string.IsNullOrEmpty(countryStandardT)) + { + Log.Warn($"Resource string for [{countryStandard}] not found", typeof(TranslationHelper)); + } + + countriesStandard.Add(countryStandardT ?? countryStandard ?? string.Empty); + } + + timeZone.CountriesStandard = countriesStandard; + } + } + } + } +} diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index 616be958124..8f42b5ea527 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -87,6 +87,8 @@ public void Init(PluginInitContext context) UpdateIconPath(_context.API.GetCurrentTheme()); _timeZoneList = JsonHelper.ReadAllPossibleTimezones(); + + TranslationHelper.TranslateAllSettings(_timeZoneList); } /// From e06c6b52e48a00ee30dae2a3c1495b0ca718ac0a Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 30 Dec 2021 19:31:36 +0100 Subject: [PATCH 35/67] Fix not working context menu --- .../Helper/ContextMenuHelper.cs | 22 +++------- .../Helper/ResultHelper.cs | 42 +++++++++---------- 2 files changed, 27 insertions(+), 37 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ContextMenuHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ContextMenuHelper.cs index 6d2444cf6f5..a0afe258e26 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ContextMenuHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ContextMenuHelper.cs @@ -6,6 +6,8 @@ using System.Collections.Generic; using System.Windows; using System.Windows.Input; +using System.Windows.Media.Animation; +using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Wox.Plugin; using Wox.Plugin.Logger; @@ -24,9 +26,9 @@ internal static class ContextMenuHelper /// The result for the context menu entires /// The name of the this assembly /// A list with context menu entries - internal static List GetContextMenu(Result result, string assemblyName) + internal static List GetContextMenu(in Result result, in string assemblyName) { - if (!(result?.ContextData is TimeZoneInfo timeZoneInfo)) + if (!(result?.ContextData is DateTime dateTime)) { return new List(0); } @@ -37,7 +39,7 @@ internal static List GetContextMenu(Result result, string ass { AcceleratorKey = Key.C, AcceleratorModifiers = ModifierKeys.Control, - Action = _ => TryToCopyToClipBoard(GetTimeInTimeZone(timeZoneInfo)), + Action = _ => TryToCopyToClipBoard($"{dateTime:HH:mm:ss}"), FontFamily = "Segoe MDL2 Assets", Glyph = "\xE8C8", // E8C8 => Symbol: Copy PluginName = assemblyName, @@ -48,19 +50,7 @@ internal static List GetContextMenu(Result result, string ass return list; } - /// - /// Return a human readable time of the current time in the given . - /// - /// The to calculate the current time in it. - /// A human readable time. - private static string GetTimeInTimeZone(TimeZoneInfo timeZoneInfo) - { - var timeInTimeZone = TimeZoneInfo.ConvertTime(DateTime.UtcNow, timeZoneInfo); - var stringToCopy = $"{timeInTimeZone:HH:mm:ss}"; - return stringToCopy; - } - - #pragma warning disable CA1031 // Do not catch general exception types +#pragma warning disable CA1031 // Do not catch general exception types /// /// Copy the given text to the clipboard diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 3291ad23611..3c60103c384 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -31,7 +31,7 @@ internal static class ResultHelper /// The to filter the . /// The path to the icon that is used for each result. /// A list with s. - internal static IEnumerable GetResults(IEnumerable timeZones, TimeZoneSettings options, Query query, string iconPath) + internal static IEnumerable GetResults(in IEnumerable timeZones, in TimeZoneSettings options, in Query query, in string iconPath) { var results = new List(); var utcNow = DateTime.UtcNow; @@ -63,7 +63,7 @@ internal static IEnumerable GetResults(IEnumerable timeZone /// The path to the icon that is used for each result. /// The current time in UTC for the . /// A list with . - private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSettings options, Query query, string iconPath, DateTime utcNow) + private static IEnumerable GetResults(in OneTimeZone timeZone, in TimeZoneSettings options, in Query query, in string iconPath, in DateTime utcNow) { var results = new Collection(); @@ -74,7 +74,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSett { results.Add(new Result { - ContextData = timeZone, + ContextData = GetTimeInTimeZone(timeZone, utcNow, false), IcoPath = iconPath, Title = standardTitle, SubTitle = GetAllCountries(timeZone, query, maxLength: 100), @@ -88,7 +88,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSett { results.Add(new Result { - ContextData = timeZone, + ContextData = GetTimeInTimeZone(timeZone, utcNow, false), IcoPath = iconPath, SubTitle = GetStandardCountries(timeZone, query, maxLength: 100), Title = standardTitle, @@ -100,7 +100,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSett { results.Add(new Result { - ContextData = timeZone, + ContextData = GetTimeInTimeZone(timeZone, utcNow, true), IcoPath = iconPath, SubTitle = GetDaylightCountries(timeZone, query, maxLength: 100), Title = daylightTitle, @@ -118,7 +118,7 @@ private static IEnumerable GetResults(OneTimeZone timeZone, TimeZoneSett /// The current time in UTC. /// indicate that the result is for a time zone that use a daylight saving time. /// The current local time in a time zone. - private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, bool daylightSavingTime) + private static DateTime GetTimeInTimeZone(in OneTimeZone timeZone, in DateTime utcNow, in bool daylightSavingTime) { foreach (var timeZoneInfo in TimeZoneInfo.GetSystemTimeZones()) { @@ -142,7 +142,7 @@ private static DateTime GetTimeInTimeZone(OneTimeZone timeZone, DateTime utcNow, /// The current time in UTC. /// indicate that the result is for a time zone that use a daylight saving time. /// A title for a time zone. - private static string GetTitle(OneTimeZone timeZone, TimeZoneSettings options, DateTime utcNow, bool daylightSavingTime) + private static string GetTitle(in OneTimeZone timeZone, in TimeZoneSettings options, in DateTime utcNow, in bool daylightSavingTime) { var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow, daylightSavingTime); var timeZoneNames = GetNames(timeZone, options, maxLength: 50); @@ -156,7 +156,7 @@ private static string GetTitle(OneTimeZone timeZone, TimeZoneSettings options, D /// The time zone that contain all information. /// Additional options to limit the results. /// A tool-tip with countries that use the standard time. - private static string GetStandardToolTip(OneTimeZone timeZone, TimeZoneSettings options) + private static string GetStandardToolTip(in OneTimeZone timeZone, in TimeZoneSettings options) { var countries = GetStandardCountries(timeZone, null, maxLength: int.MaxValue); var names = GetNames(timeZone, options, maxLength: int.MaxValue); @@ -179,7 +179,7 @@ private static string GetStandardToolTip(OneTimeZone timeZone, TimeZoneSettings /// The time zone that contain all information. /// Additional options to limit the type of the names. /// A tool-tip with countries that use the daylight saving time. - private static string GetDaylightToolTip(OneTimeZone timeZone, TimeZoneSettings options) + private static string GetDaylightToolTip(in OneTimeZone timeZone, in TimeZoneSettings options) { var dstCountries = GetDaylightCountries(timeZone, null, maxLength: int.MaxValue); var names = GetNames(timeZone, options, maxLength: int.MaxValue); @@ -202,7 +202,7 @@ private static string GetDaylightToolTip(OneTimeZone timeZone, TimeZoneSettings /// The time zone that contain all information. /// Additional options to limit the type of the names. /// A tool-tip with countries. - private static string GetAllToolTip(OneTimeZone timeZone, TimeZoneSettings options) + private static string GetAllToolTip(in OneTimeZone timeZone, in TimeZoneSettings options) { var countries = GetStandardCountries(timeZone, null, maxLength: int.MaxValue); var dstCountries = GetDaylightCountries(timeZone, null, maxLength: int.MaxValue); @@ -229,7 +229,7 @@ private static string GetAllToolTip(OneTimeZone timeZone, TimeZoneSettings optio /// Additional options to limit the type of the names. /// The maximum length of the result . /// A that contain names of a given time zone. - private static string GetNames(OneTimeZone timeZone, TimeZoneSettings options, int maxLength) + private static string GetNames(in OneTimeZone timeZone, in TimeZoneSettings options, in int maxLength) { var names = new List(); @@ -323,7 +323,7 @@ private static string GetNames(OneTimeZone timeZone, TimeZoneSettings options, i /// The that should match a country that use standard time. /// The maximum length of the result . /// A with countries that use the standard time. - private static string GetStandardCountries(OneTimeZone timeZone, Query? query, int maxLength) + private static string GetStandardCountries(in OneTimeZone timeZone, Query? query, in int maxLength) { IEnumerable countries; @@ -410,7 +410,7 @@ private static string GetStandardCountries(OneTimeZone timeZone, Query? query, i /// The v /// The maximum length of the result . /// A with countries that use the daylight saving time. - private static string GetDaylightCountries(OneTimeZone timeZone, Query? query, int maxLength) + private static string GetDaylightCountries(in OneTimeZone timeZone, Query? query, in int maxLength) { IEnumerable countries; @@ -497,7 +497,7 @@ private static string GetDaylightCountries(OneTimeZone timeZone, Query? query, i /// The v /// The maximum length of the result . /// A with countries. - private static string GetAllCountries(OneTimeZone timeZone, Query? query, int maxLength) + private static string GetAllCountries(in OneTimeZone timeZone, Query? query, int maxLength) { IEnumerable countries; @@ -578,13 +578,13 @@ private static string GetAllCountries(OneTimeZone timeZone, Query? query, int ma return stringBuilder.ToString(); } - private static bool MatchShortcuts(OneTimeZone timeZone, Query query) + private static bool MatchShortcuts(in OneTimeZone timeZone, Query query) { var result = timeZone.Shortcut.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); return result; } - private static bool MatchNames(OneTimeZone timeZone, Query query) + private static bool MatchNames(in OneTimeZone timeZone, Query query) { var result = timeZone.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase) || timeZone.MilitaryName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); @@ -592,19 +592,19 @@ private static bool MatchNames(OneTimeZone timeZone, Query query) return result; } - private static bool MatchDaylightNames(OneTimeZone timeZone, Query query) + private static bool MatchDaylightNames(in OneTimeZone timeZone, Query query) { var result = timeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; } - private static bool MatchStandardNames(OneTimeZone timeZone, Query query) + private static bool MatchStandardNames(in OneTimeZone timeZone, Query query) { var result = timeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; } - private static bool MatchOffset(OneTimeZone timeZone, Query query) + private static bool MatchOffset(in OneTimeZone timeZone, Query query) { // allow search for "-x:xx" if (query.Search.StartsWith('-') && timeZone.Offset.StartsWith('-')) @@ -627,13 +627,13 @@ private static bool MatchOffset(OneTimeZone timeZone, Query query) return false; } - private static bool MatchStandardCountries(OneTimeZone timeZone, Query query) + private static bool MatchStandardCountries(in OneTimeZone timeZone, Query query) { var result = timeZone.CountriesStandard?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; } - private static bool MatchDaylightCountries(OneTimeZone timeZone, Query query) + private static bool MatchDaylightCountries(in OneTimeZone timeZone, Query query) { var result = timeZone.CountriesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; From 2a27086b0fd24dd885f09481d3ebc755d270f76b Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 4 Jan 2022 10:08:50 +0100 Subject: [PATCH 36/67] Typo fixes, fix wrong shortcut in names, comments, few better variable names --- .../Classes/OneTimeZone.cs | 5 +- .../Classes/TimeZoneSettings.cs | 4 +- .../Helper/JsonHelper.cs | 2 +- .../Helper/ResultHelper.cs | 238 ++++++++++-------- 4 files changed, 147 insertions(+), 102 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index 2ce66fa4ac9..50f7d07e7a7 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -66,6 +66,9 @@ public OneTimeZone() /// /// Gets a compatible of the . /// - internal TimeSpan OffsetAsTimeSpan => TimeSpan.TryParse(Offset, out var result) ? result : new TimeSpan(0, 0, 0); + internal TimeSpan OffsetAsTimeSpan + { + get { return TimeSpan.TryParse(Offset, out var result) ? result : new TimeSpan(0, 0, 0); } + } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs index 8cfbffbea55..1ac93101aa2 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneSettings.cs @@ -63,7 +63,7 @@ internal List GetAdditionalOptions() /// /// Update this settings. /// - /// The settings for all power launcher plugins. + /// The settings for all power launcher plugin. internal void UpdateSettings(PowerLauncherPluginSettings settings) { if (settings is null || settings.AdditionalOptions is null) @@ -81,7 +81,7 @@ internal void UpdateSettings(PowerLauncherPluginSettings settings) /// /// The object that contain all settings. /// The name of the setting. - /// The fall-back value that is used when the setting si not found. + /// The fall-back value that is used when the setting is not found. /// A settings value. private static bool GetOneBoolSetting(PowerLauncherPluginSettings settings, string name, bool fallbackValue) { diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs index 7518fcb0a61..fa9a3d1f2b3 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs @@ -27,7 +27,7 @@ internal static class JsonHelper /// Read all possible time zones. /// /// A object that contain a list with time zones. - internal static TimeZoneList ReadAllPossibleTimezones() + internal static TimeZoneList ReadAllPossibleTimeZones() { var assembly = Assembly.GetExecutingAssembly(); var type = Array.Find(assembly.GetTypes(), x => x.Name == nameof(Main)); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 3c60103c384..2db52a6d450 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -34,19 +34,19 @@ internal static class ResultHelper internal static IEnumerable GetResults(in IEnumerable timeZones, in TimeZoneSettings options, in Query query, in string iconPath) { var results = new List(); - var utcNow = DateTime.UtcNow; + var dateTime = DateTime.UtcNow; foreach (var timeZone in timeZones) { if (MatchShortcuts(timeZone, query) - || MatchNames(timeZone, query) - || MatchStandardNames(timeZone, query) - || MatchDaylightNames(timeZone, query) + || MatchTimeZoneNames(timeZone, query) + || MatchStandardTimeNames(timeZone, query) + || MatchDaylightTimeNames(timeZone, query) || MatchStandardCountries(timeZone, query) || MatchDaylightCountries(timeZone, query) || MatchOffset(timeZone, query)) { - results.AddRange(GetResults(timeZone, options, query, iconPath, utcNow)); + results.AddRange(GetResults(timeZone, options, query, iconPath, dateTime)); } } @@ -57,54 +57,54 @@ internal static IEnumerable GetResults(in IEnumerable timeZ /// /// Return a list with based on the given time zone. /// - /// The time zone that contain the information for the . + /// The time zone that contain the information for the . /// Additional options to limit the results. /// The that should match. /// The path to the icon that is used for each result. - /// The current time in UTC for the . + /// The current time in UTC for the . /// A list with . - private static IEnumerable GetResults(in OneTimeZone timeZone, in TimeZoneSettings options, in Query query, in string iconPath, in DateTime utcNow) + private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in TimeZoneSettings options, in Query query, in string iconPath, in DateTime dateTime) { var results = new Collection(); - var standardTitle = GetTitle(timeZone, options, utcNow, false); - var daylightTitle = GetTitle(timeZone, options, utcNow, true); + var standardTitle = GetTitle(oneTimeZone, options, dateTime, false); + var daylightTitle = GetTitle(oneTimeZone, options, dateTime, true); if (standardTitle == daylightTitle) { results.Add(new Result { - ContextData = GetTimeInTimeZone(timeZone, utcNow, false), + ContextData = GetTimeInTimeZone(oneTimeZone, dateTime, false), IcoPath = iconPath, Title = standardTitle, - SubTitle = GetAllCountries(timeZone, query, maxLength: 100), - ToolTipData = new ToolTipData(standardTitle, GetAllToolTip(timeZone, options)), + SubTitle = GetAllCountries(oneTimeZone, query, maxLength: 100), + ToolTipData = new ToolTipData(standardTitle, GetAllToolTip(oneTimeZone, options)), }); return results; } - if (MatchStandardCountries(timeZone, query) || MatchStandardNames(timeZone, query) || MatchNames(timeZone, query) || MatchOffset(timeZone, query)) + if (MatchStandardCountries(oneTimeZone, query) || MatchStandardTimeNames(oneTimeZone, query) || MatchTimeZoneNames(oneTimeZone, query) || MatchOffset(oneTimeZone, query)) { results.Add(new Result { - ContextData = GetTimeInTimeZone(timeZone, utcNow, false), + ContextData = GetTimeInTimeZone(oneTimeZone, dateTime, false), IcoPath = iconPath, - SubTitle = GetStandardCountries(timeZone, query, maxLength: 100), + SubTitle = GetStandardCountries(oneTimeZone, query, maxLength: 100), Title = standardTitle, - ToolTipData = new ToolTipData(standardTitle, GetStandardToolTip(timeZone, options)), + ToolTipData = new ToolTipData(standardTitle, GetStandardToolTip(oneTimeZone, options)), }); } - if (MatchDaylightCountries(timeZone, query) || MatchDaylightNames(timeZone, query) || MatchNames(timeZone, query) || MatchOffset(timeZone, query)) + if (MatchDaylightCountries(oneTimeZone, query) || MatchDaylightTimeNames(oneTimeZone, query) || MatchTimeZoneNames(oneTimeZone, query) || MatchOffset(oneTimeZone, query)) { results.Add(new Result { - ContextData = GetTimeInTimeZone(timeZone, utcNow, true), + ContextData = GetTimeInTimeZone(oneTimeZone, dateTime, true), IcoPath = iconPath, - SubTitle = GetDaylightCountries(timeZone, query, maxLength: 100), + SubTitle = GetDaylightCountries(oneTimeZone, query, maxLength: 100), Title = daylightTitle, - ToolTipData = new ToolTipData(daylightTitle, GetDaylightToolTip(timeZone, options)), + ToolTipData = new ToolTipData(daylightTitle, GetDaylightToolTip(oneTimeZone, options)), }); } @@ -114,38 +114,38 @@ private static IEnumerable GetResults(in OneTimeZone timeZone, in TimeZo /// /// Return the current local time of the given time zone. /// - /// The time zone that contain all information. - /// The current time in UTC. + /// The time zone that contain all information. + /// The current time in UTC. /// indicate that the result is for a time zone that use a daylight saving time. /// The current local time in a time zone. - private static DateTime GetTimeInTimeZone(in OneTimeZone timeZone, in DateTime utcNow, in bool daylightSavingTime) + private static DateTime GetTimeInTimeZone(in OneTimeZone oneTimeZone, in DateTime dateTime, in bool daylightSavingTime) { foreach (var timeZoneInfo in TimeZoneInfo.GetSystemTimeZones()) { - if (timeZoneInfo.BaseUtcOffset == timeZone.OffsetAsTimeSpan + if (timeZoneInfo.BaseUtcOffset == oneTimeZone.OffsetAsTimeSpan && timeZoneInfo.SupportsDaylightSavingTime == daylightSavingTime) { - return TimeZoneInfo.ConvertTime(utcNow, timeZoneInfo); + return TimeZoneInfo.ConvertTime(dateTime, timeZoneInfo); } } // Fall-back - var result = utcNow + timeZone.OffsetAsTimeSpan; + var result = dateTime + oneTimeZone.OffsetAsTimeSpan; return result; } /// /// Return the title for the given time zone. /// - /// The time zone that contain all information. - /// Additional options to limit the results. - /// The current time in UTC. + /// The time zone that contain all information. + /// Additional options to limit the results. + /// The current time in UTC. /// indicate that the result is for a time zone that use a daylight saving time. /// A title for a time zone. - private static string GetTitle(in OneTimeZone timeZone, in TimeZoneSettings options, in DateTime utcNow, in bool daylightSavingTime) + private static string GetTitle(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in DateTime dateTime, in bool daylightSavingTime) { - var timeInZoneTime = GetTimeInTimeZone(timeZone, utcNow, daylightSavingTime); - var timeZoneNames = GetNames(timeZone, options, maxLength: 50); + var timeInZoneTime = GetTimeInTimeZone(oneTimeZone, dateTime, daylightSavingTime); + var timeZoneNames = GetNames(oneTimeZone, timeZoneSettings, maxLength: 50); return $"{timeInZoneTime:HH:mm:ss} - {timeZoneNames}"; } @@ -153,17 +153,17 @@ private static string GetTitle(in OneTimeZone timeZone, in TimeZoneSettings opti /// /// Return a tool-tip for the given time zone with countries that use the standard time. /// - /// The time zone that contain all information. - /// Additional options to limit the results. + /// The time zone that contain all information. + /// Additional options to limit the results. /// A tool-tip with countries that use the standard time. - private static string GetStandardToolTip(in OneTimeZone timeZone, in TimeZoneSettings options) + private static string GetStandardToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) { - var countries = GetStandardCountries(timeZone, null, maxLength: int.MaxValue); - var names = GetNames(timeZone, options, maxLength: int.MaxValue); + var countries = GetStandardCountries(oneTimeZone, null, maxLength: int.MaxValue); + var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.Offset); + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(oneTimeZone.Offset); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.No); stringBuilder.AppendLine(string.Empty); stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); @@ -176,17 +176,17 @@ private static string GetStandardToolTip(in OneTimeZone timeZone, in TimeZoneSet /// /// Return a tool-tip for the given time zone with countries that use the daylight saving time. /// - /// The time zone that contain all information. - /// Additional options to limit the type of the names. + /// The time zone that contain all information. + /// Additional options to limit the type of the names. /// A tool-tip with countries that use the daylight saving time. - private static string GetDaylightToolTip(in OneTimeZone timeZone, in TimeZoneSettings options) + private static string GetDaylightToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) { - var dstCountries = GetDaylightCountries(timeZone, null, maxLength: int.MaxValue); - var names = GetNames(timeZone, options, maxLength: int.MaxValue); + var dstCountries = GetDaylightCountries(oneTimeZone, null, maxLength: int.MaxValue); + var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.Offset); + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(oneTimeZone.Offset); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.Yes); stringBuilder.AppendLine(string.Empty); stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); @@ -199,18 +199,18 @@ private static string GetDaylightToolTip(in OneTimeZone timeZone, in TimeZoneSet /// /// Return a tool-tip for the given time zone with countries. /// - /// The time zone that contain all information. - /// Additional options to limit the type of the names. + /// The time zone that contain all information. + /// Additional options to limit the type of the names. /// A tool-tip with countries. - private static string GetAllToolTip(in OneTimeZone timeZone, in TimeZoneSettings options) + private static string GetAllToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) { - var countries = GetStandardCountries(timeZone, null, maxLength: int.MaxValue); - var dstCountries = GetDaylightCountries(timeZone, null, maxLength: int.MaxValue); - var names = GetNames(timeZone, options, maxLength: int.MaxValue); + var countries = GetStandardCountries(oneTimeZone, null, maxLength: int.MaxValue); + var dstCountries = GetDaylightCountries(oneTimeZone, null, maxLength: int.MaxValue); + var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); var stringBuilder = new StringBuilder(); - stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(timeZone.Offset); + stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(oneTimeZone.Offset); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.Yes); stringBuilder.AppendLine(string.Empty); stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); @@ -225,32 +225,32 @@ private static string GetAllToolTip(in OneTimeZone timeZone, in TimeZoneSettings /// /// Return a that contain all know names of the given time zone. /// - /// The time zone that contain a hand of names. - /// Additional options to limit the type of the names. + /// The time zone that contain a hand of names. + /// Additional options to limit the type of the names. /// The maximum length of the result . /// A that contain names of a given time zone. - private static string GetNames(in OneTimeZone timeZone, in TimeZoneSettings options, in int maxLength) + private static string GetNames(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in int maxLength) { var names = new List(); - if (!string.IsNullOrWhiteSpace(timeZone.Name) && options.ShowTimeZoneNames) + if (!string.IsNullOrWhiteSpace(oneTimeZone.Name) && timeZoneSettings.ShowTimeZoneNames) { - names.Add(timeZone.Name); + names.Add(oneTimeZone.Name); } - if (!string.IsNullOrWhiteSpace(timeZone.MilitaryName) && options.ShowMilitaryTimeZoneNames) + if (!string.IsNullOrWhiteSpace(oneTimeZone.MilitaryName) && timeZoneSettings.ShowMilitaryTimeZoneNames) { - names.Add(timeZone.MilitaryName); + names.Add(oneTimeZone.MilitaryName); } - if (timeZone.TimeNamesStandard != null && options.ShowTimeZoneNames) + if (oneTimeZone.TimeNamesStandard != null && timeZoneSettings.ShowTimeZoneNames) { - names.AddRange(timeZone.TimeNamesStandard); + names.AddRange(oneTimeZone.TimeNamesStandard); } - if (timeZone.TimeNamesDaylight != null && options.ShowTimeZoneNames) + if (oneTimeZone.TimeNamesDaylight != null && timeZoneSettings.ShowTimeZoneNames) { - names.AddRange(timeZone.TimeNamesDaylight); + names.AddRange(oneTimeZone.TimeNamesDaylight); } if (names.Any()) @@ -273,7 +273,7 @@ private static string GetNames(in OneTimeZone timeZone, in TimeZoneSettings opti if (stringBuilder.Length > maxLength) { stringBuilder.Replace(Resources.TimeZone, Resources.TimeZoneShortcut); - stringBuilder.Replace(Resources.StandardTime, Resources.TimeZoneShortcut); + stringBuilder.Replace(Resources.StandardTime, Resources.StandardTimeShortcut); stringBuilder.Replace(Resources.DaylightTime, Resources.DaylightTimeShortcut); stringBuilder.Replace(Resources.Time, Resources.TimeShortcut); } @@ -300,14 +300,14 @@ private static string GetNames(in OneTimeZone timeZone, in TimeZoneSettings opti else { // fall-back - var totalMinutes = timeZone.OffsetAsTimeSpan.TotalMinutes; + var totalMinutes = oneTimeZone.OffsetAsTimeSpan.TotalMinutes; if (totalMinutes < 0) { - return $"UTC{timeZone.Offset}"; + return $"UTC{oneTimeZone.Offset}"; } else if (totalMinutes > 0) { - return $"UTC+{timeZone.Offset}"; + return $"UTC+{oneTimeZone.Offset}"; } else { @@ -319,21 +319,21 @@ private static string GetNames(in OneTimeZone timeZone, in TimeZoneSettings opti /// /// Return a that contain all countries that use the standard time of the given time zone. /// - /// The time zone that contain the countries. + /// The time zone that contain the countries. /// The that should match a country that use standard time. /// The maximum length of the result . /// A with countries that use the standard time. - private static string GetStandardCountries(in OneTimeZone timeZone, Query? query, in int maxLength) + private static string GetStandardCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) { IEnumerable countries; if (query is null || string.IsNullOrWhiteSpace(query.Search)) { - countries = timeZone.CountriesStandard; + countries = oneTimeZone.CountriesStandard; } else { - countries = timeZone.CountriesStandard.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)); + countries = oneTimeZone.CountriesStandard.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)); } var stringBuilder = new StringBuilder(); @@ -406,21 +406,21 @@ private static string GetStandardCountries(in OneTimeZone timeZone, Query? query /// /// Return a that contain all countries that use the daylight saving time of the given time zone. /// - /// The time zone that contain the countries. + /// The time zone that contain the countries. /// The v /// The maximum length of the result . /// A with countries that use the daylight saving time. - private static string GetDaylightCountries(in OneTimeZone timeZone, Query? query, in int maxLength) + private static string GetDaylightCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) { IEnumerable countries; if (query is null || string.IsNullOrWhiteSpace(query.Search)) { - countries = timeZone.CountriesDaylight; + countries = oneTimeZone.CountriesDaylight; } else { - countries = timeZone.CountriesDaylight.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)); + countries = oneTimeZone.CountriesDaylight.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)); } var stringBuilder = new StringBuilder(); @@ -493,22 +493,22 @@ private static string GetDaylightCountries(in OneTimeZone timeZone, Query? query /// /// Return a that contain all countries of the given time zone. /// - /// The time zone that contain the countries. + /// The time zone that contain the countries. /// The v /// The maximum length of the result . /// A with countries. - private static string GetAllCountries(in OneTimeZone timeZone, Query? query, int maxLength) + private static string GetAllCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) { IEnumerable countries; if (query is null || string.IsNullOrWhiteSpace(query.Search)) { - countries = timeZone.CountriesDaylight.Concat(timeZone.CountriesStandard); + countries = oneTimeZone.CountriesDaylight.Concat(oneTimeZone.CountriesStandard); } else { - countries = timeZone.CountriesDaylight.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) - .Concat(timeZone.CountriesStandard.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))); + countries = oneTimeZone.CountriesDaylight.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) + .Concat(oneTimeZone.CountriesStandard.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase))); } var stringBuilder = new StringBuilder(); @@ -578,40 +578,70 @@ private static string GetAllCountries(in OneTimeZone timeZone, Query? query, int return stringBuilder.ToString(); } - private static bool MatchShortcuts(in OneTimeZone timeZone, Query query) + /// + /// Indicate that the given query match the shortcut of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchShortcuts(in OneTimeZone oneTimeZone, Query query) { - var result = timeZone.Shortcut.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); + var result = oneTimeZone.Shortcut.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); return result; } - private static bool MatchNames(in OneTimeZone timeZone, Query query) + /// + /// Indicate that the given query match one of the time zone names of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchTimeZoneNames(in OneTimeZone oneTimeZone, Query query) { - var result = timeZone.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase) - || timeZone.MilitaryName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); + var result = oneTimeZone.Name.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase) + || oneTimeZone.MilitaryName.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); return result; } - private static bool MatchDaylightNames(in OneTimeZone timeZone, Query query) + /// + /// Indicate that the given query match one of the daylight time names of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchDaylightTimeNames(in OneTimeZone oneTimeZone, Query query) { - var result = timeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + var result = oneTimeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; } - private static bool MatchStandardNames(in OneTimeZone timeZone, Query query) + /// + /// Indicate that the given query match one of the standard time names of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchStandardTimeNames(in OneTimeZone oneTimeZone, Query query) { - var result = timeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + var result = oneTimeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; } - private static bool MatchOffset(in OneTimeZone timeZone, Query query) + /// + /// Indicate that the given query match the offset of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchOffset(in OneTimeZone oneTimeZone, Query query) { // allow search for "-x:xx" - if (query.Search.StartsWith('-') && timeZone.Offset.StartsWith('-')) + if (query.Search.StartsWith('-') && oneTimeZone.Offset.StartsWith('-')) { - if (timeZone.Offset.ElementAtOrDefault(1) == '0') + if (oneTimeZone.Offset.ElementAtOrDefault(1) == '0') { - if (timeZone.Offset[2..].StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) + if (oneTimeZone.Offset[2..].StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -619,7 +649,7 @@ private static bool MatchOffset(in OneTimeZone timeZone, Query query) } // allow search for "+xx:xx" - if (query.Search.StartsWith('+') && timeZone.Offset.StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) + if (query.Search.StartsWith('+') && oneTimeZone.Offset.StartsWith(query.Search[1..], StringComparison.InvariantCultureIgnoreCase)) { return true; } @@ -627,15 +657,27 @@ private static bool MatchOffset(in OneTimeZone timeZone, Query query) return false; } - private static bool MatchStandardCountries(in OneTimeZone timeZone, Query query) + /// + /// Indicate that the given query match one of the countries that use the standard time of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchStandardCountries(in OneTimeZone oneTimeZone, Query query) { - var result = timeZone.CountriesStandard?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + var result = oneTimeZone.CountriesStandard?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; } - private static bool MatchDaylightCountries(in OneTimeZone timeZone, Query query) + /// + /// Indicate that the given query match one of the countries that use the daylight time of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchDaylightCountries(in OneTimeZone oneTimeZone, Query query) { - var result = timeZone.CountriesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + var result = oneTimeZone.CountriesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; } } From 9794f3eaa60b324f86f4e1d7a64dfaedfd3dddbd Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 4 Jan 2022 10:10:24 +0100 Subject: [PATCH 37/67] New symbols - thx to niels9001 --- .../Images/reg.dark.png | Bin 2313 -> 0 bytes .../Images/reg.light.png | Bin 2330 -> 0 bytes .../Images/timeZone.dark.png | Bin 0 -> 1275 bytes .../Images/timeZone.light.png | Bin 0 -> 1201 bytes .../Main.cs | 25 ++++++++++++------ ...osoft.PowerToys.Run.Plugin.TimeZone.csproj | 4 +-- .../plugin.json | 22 +++++++-------- 7 files changed, 30 insertions(+), 21 deletions(-) delete mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/reg.dark.png delete mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/reg.light.png create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/timeZone.dark.png create mode 100644 src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/timeZone.light.png diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/reg.dark.png b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/reg.dark.png deleted file mode 100644 index 562b3c188729b18e9334b680c22282fd0ed0d4fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2313 zcmcImYitx%7~K{_%cI~A3W@$;oF=9fX6M=2nW0N*cU!v1wwrdFR%1f%&b_-kba!W& znYP;oBG?i{O+`~k44Oz24GJOzi6|gQ8hMClG*QyvgQO5piwdH#QR1C_v;_eh6F0Lv zk9+R<&i8%i&fU#{`sGD4ADHQIIEs9A-bQ?8>~G<8{M(ZM$0mH5k*s^nbU5Y=+26da zi{?D&a1<=lf~{7of2E@8aVLO!2su;nBt|00eOLi+@#$#iV^VUuW-U5hMfTGPz!fY1?u-JzJzIkgo=D#H;F|#H4Q3ZMr1@66ex*T z1&VbEfRbc}r=&0n$sq`_J78KDp6}Jw4!aWe{ETg(u40byYAPbnhM~%rQ(`zIQA|j1 zQIZJDu{(K53;|XI49c-J7#dzVAU2uRRs}I5k|j}sP@-fP0u&Skh5`seigN)@=2eI! zmrN29aXorWH~c!p)#WEY_jx=4Ll0{)JYY61uO@so9+8zrk>Z>zNkCNz>qZ=4qiJyv zL3A<^v2BlK;B@OW6Zg0~yO5gDn(S3fBhv0vfNC!aH>uigK)6hq$J!mrJhg-}^Sh!5 zlitH68JMYutuA1ost9h$zq*jVn|Kp+-dnl=fGC6{o^r`hrns;mQ&NcIDFL!BH6%!` zawz3e|6inM%c@2}B7*Q6mL~suGE=krKl*Uz1vs@na873O+aNRPwq$7g#hP&#eY^Q4 zTpmOzYbEGLhM8?PZ}U%Rk*LEFaNTZ)I9 zPZnM&94&+!`#&pg+t?qdJ$Un&P`YC8r~PZ|FE&(vIJ98h^L%89Kprpo;neW5Hy>Gl zV1*;PA@B0wV9n6AXbs%5Um4X0;L@3c^RAybw{oEEgX>Q;5vXMNrD zao?A`XZD%b=FhuSRj}n+!Haa~yUMrIDtC46FK#{l`cmI}+rB8nac@$^ovD4X^Nmpoh3%l5@ZCTr@0eW}l?(WF$&U9wV zZmU1Ap=pH%Ll6=Jilo0FK*TgOKEM(P4`0EkC?HZ3d_x6XoXi>J=9 z*(NSk0!?Okm>tM!5ZaS54WVte@+CB3XIB6_x(NgPW-%(X7O!U~8r z`D-z^szZ#kQ-nlO4CWN?$|2W1_3`J5-lBNiT5h+eAb6}Ytj-u&uNUZlP%fv!& zE<9qInn;p~M8ckM*i}7D(t;q66hkr$fe?hz7B@kXh#T{=3?67mx}uqi8pkX~5L8=D z7mk#srx4R}v~eSoCX_HT2{e+nQ`VHSK)?U~&{!;oHq5GZC`v}}U5SlAn+C~xXsE5a z1gqA;xH&HyOpBkuVBlh}%F|I;Bq&-8uxOss~gx znk`gqHX_C#9Ja7giOXujSY#>641gYBLKkjTji5Mm1ZY-tI7LQSOri2oX{aChKn5nr z1Jg7?2?11Mbd+(6DS8B~%1WqhG*G`^^u-Mm#3ktSxNs!Ot|+p|J1A$6=VSuVAwW0) zD-eL_;ld@$4N%52&B|TUJh};`X%i8MNblp4 zG|W&#W&-H2B8*D%uP!9-CEft*?k}AMfMbKagK!G6fP8@*!Uq`#!OFB#3bMSjOy;vw z|6inM(kewjJPgqnmc;-2WJYKAf7Idb3vhIGVC+=>*C0LUj>(YLhc)dm@=o)OxI6%p zW;JMox{)bnB?ym{bp)5f)PNW={jab0b3 zu^w}q8hXiXi!hEVrK3%6Qpa?(;})#tm#)6{o&OkBylhSJWV7?YnHkO7%ni(# zp5lh)aSai4VLFB%oKxNX(5|sZ#tm=XcjD@*8;8F+*LvZ^tYdGq_Qsm`m#%-ehdx^8 zoj6$3x2Nz@dFfbw=)~qnyZ76wKUv_87BoNqXUCh<&)aq%^2HYv4s`B%?9-Abe^|Mu zalH5Nu}v*UPF@(;@$t_U#gnygm*Ym!&MSXBP(Jbcgu!n&UAr))v(*pPO}ZqV?)B`8Rq9v2xX^a;^88oFB*(61j4t1SqJb?fbq_Q8bAz9)zS%Ql zIBBgYX8Y{k!nb5<&x-T5 zxxJ@}?Jvx{<$q^d-{uyurlkMbZsO|_pY8066-^(y+P_*bcyWjG;PH!pmDc^jAD-_l zEgaZ-W`pBx&bjwuf9?1)4SC1ehRvU!yLEHMPg@@8+_ZPm@9O1Uk()%IpzrB|z8eLz XPnN&GW7S6;*1s2DRgLFBWpl^hc0d-E diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/timeZone.dark.png b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/timeZone.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..6ef56bb01de318a82a720c47de0a7d0c58e4481a GIT binary patch literal 1275 zcmVM^sGhQ z>&sgP0L5QopQDg{i3$%J2_O%O z04W3j%74OP$BhH2>~Ev*6%;yeDkPpdCw;T{-C=>6#hMeTAd&z;i9sAdOQ|(!y?c$SUM4WH00nMCmt=wS6fdQUO$r!x|QYV$8K0x08r}GFP_bBLzxDrV<3z>(*#-!rU9V|puKkxfNVA+i(H|Rmr}q_yb|`+X~qO*$rWMwOjCRc>&n; z!LCeJcGD7J83R*!P=YQuee;A`ECkt@44GTHu*R!r2mouH8=(!1h!KtdE~T-)2mLG1 zk9nl2VZ0`tk9@#G0F?hrSj>Z52UO9?G9VWK=))4^0))T)#)jO7^;8A&LIGj^B%Vhg zZ|vGi*M>sGZ?WBYuRD1UvmILlec1Zo<9e9M~g$L zij31Elcg1iRd<>tDkIl5rYqL5rzmLY6SmNdqjfC+8Xa}@v>@OiD>dEkdu zqlOjd(AV#H@>R-3u2QH%fGu1srqfLu2-F+HX^fJ!rWIB6KA zkhoD_SaQD)KsmlDvRGr=?};>=Ls~RmD`oyT=F{>_VhUgyeZ$EfkWI`N@z5JtCfwri zD%P{iU{co|8fU^21+SV6!`pJV_6!t{jsWlq0b zn4#26M!cM(F&>HX&oPf{7qEuE-WL5T;c;*1+o*k+%h*H9XnKT6sU9XBmRH(wh*7UM zR0kFEfF3G!IzNrOKC5S5#D&iUqNOqcR3QqaUo5U6bpg-AG38qVU;y#`e<1T3=qQza zv6>bx(67+H3#-002ovPDHLkV1n-YJcj@P literal 0 HcmV?d00001 diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/timeZone.light.png b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Images/timeZone.light.png new file mode 100644 index 0000000000000000000000000000000000000000..d5348b6b7eecce7339317d253724d12c473ee06c GIT binary patch literal 1201 zcmV;i1Wx;jP)vEMGHZRT3IM+sw7P`5V47R zeRK*wKrmHqLSD-$rNBz+E8gd{~GXj=Wh%Pd%DnAx-UK3nC&8Ti>}&z{Hs zueD}o?R{p>nC4~XH0M8KB;aFvaO8oJ2ZppjmmxG?T-FPp3X6n&5x0xFeo(TU8 z$$hGO7XmhGoX>@C8WKX#b>WwW{RWy3BVf5kI-IbyO~AAJ;byC@XEH<)a!%;C5za8KAR%o4sAEc`IU*(M^I3b^1V^A=+b+!lTnHVSVtBrw2ZVXd%3xD(oWk2Vs~ zM8J2>@^OgV4c4y{21XVyYF9sFO&qBrAiikpU*2jTM}U5 z(KSKNkCy_6A0AjLY!KL9<5Ib{sszO0^H*YUOA(kPmny{Fey^|wp@ksI5`nXYlI2+? zfL!Od!T`3w>+Jt2-VpvTAocuhs9d3IQh1dBi+|jGFk>}4nd=Hzt#R0DxsJOr`}+M{ z=m~@^qA2TxOTrN$&aI{zR0*&Xvnv4;n(uhV5WX5QyMiF<$Ap!Fr5yu9dj+@CA{SyenrI`SZ8qxNKTi|e!Q?rZ0Ak%g$79q{Ak8L_3&UavF^Ije zG-U}cn+S$ef^r`zs7H_wG_2mm4r>YT3aj2^6=^^W= zbqLwuEJFOKY|nYvh48R_n6QwD-U}NYxoYpM{?? P00000NkvXXu0mjfx5E;! literal 0 HcmV?d00001 diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs index 8f42b5ea527..1124c2c84f9 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Main.cs @@ -57,24 +57,33 @@ public class Main : IPlugin, IContextMenu, IPluginI18n, ISettingProvider, IDispo public Main() { _assemblyName = Assembly.GetExecutingAssembly().GetName().Name ?? GetTranslatedPluginTitle(); - _defaultIconPath = "Images/reg.light.png"; + _defaultIconPath = "Images/timeZone.light.png"; _timeZoneSettings = new TimeZoneSettings(); } /// /// Gets the localized name. /// - public string Name => Resources.PluginTitle; + public string Name + { + get { return Resources.PluginTitle; } + } /// /// Gets the localized description. /// - public string Description => Resources.PluginDescription; + public string Description + { + get { return Resources.PluginDescription; } + } /// /// Gets the additional options for this plugin. /// - public IEnumerable AdditionalOptions => _timeZoneSettings.GetAdditionalOptions(); + public IEnumerable AdditionalOptions + { + get { return _timeZoneSettings.GetAdditionalOptions(); } + } /// /// Initialize the plugin with the given @@ -86,7 +95,7 @@ public void Init(PluginInitContext context) _context.API.ThemeChanged += OnThemeChanged; UpdateIconPath(_context.API.GetCurrentTheme()); - _timeZoneList = JsonHelper.ReadAllPossibleTimezones(); + _timeZoneList = JsonHelper.ReadAllPossibleTimeZones(); TranslationHelper.TranslateAllSettings(_timeZoneList); } @@ -139,8 +148,8 @@ private void OnThemeChanged(Theme oldtheme, Theme newTheme) private void UpdateIconPath(Theme theme) { _defaultIconPath = theme == Theme.Light || theme == Theme.HighContrastWhite - ? "Images/reg.light.png" - : "Images/reg.dark.png"; + ? "Images/timeZone.light.png" + : "Images/timeZone.dark.png"; } /// @@ -199,7 +208,7 @@ public Control CreateSettingPanel() /// /// Update the plugin settings /// - /// The settings for all power launcher plugins. + /// The settings for all power launcher plugin. public void UpdateSettings(PowerLauncherPluginSettings settings) { _timeZoneSettings.UpdateSettings(settings); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj index 8f687ba30b1..f3bc9ea643b 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj @@ -108,10 +108,10 @@ - + PreserveNewest - + PreserveNewest diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json index 3c3fdaec5ea..2e417990883 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json @@ -1,13 +1,13 @@ { - "ID": "BADD1B06EF0A4B61AD95395F24241D69", - "ActionKeyword": "&", - "IsGlobal": false, - "Name": "TimeZone", - "Author": "TobiasSekan", - "Version": "1.0.0", - "Language": "csharp", - "Website": "https://aka.ms/powertoys", - "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.TimeZone.dll", - "IcoPathDark": "Images\\reg.dark.png", - "IcoPathLight": "Images\\reg.light.png" + "ID": "BADD1B06EF0A4B61AD95395F24241D69", + "ActionKeyword": "&", + "IsGlobal": false, + "Name": "TimeZone", + "Author": "TobiasSekan", + "Version": "1.0.0", + "Language": "csharp", + "Website": "https://aka.ms/powertoys", + "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.TimeZone.dll", + "IcoPathDark": "Images\\timeZone.dark.png", + "IcoPathLight": "Images\\timeZone.light.png" } From da6294cbdf455c57640e8866cb7425127a94ef68 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 4 Jan 2022 11:23:42 +0100 Subject: [PATCH 38/67] Search by shortcuts for time names --- .../Classes/OneTimeZone.cs | 12 + .../Helper/ResultHelper.cs | 94 +++++--- .../timezones.json | 222 +++++++++++++++++- 3 files changed, 287 insertions(+), 41 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index 50f7d07e7a7..983e4f9dcb3 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -21,6 +21,8 @@ public OneTimeZone() TimeNamesDaylight = Enumerable.Empty(); CountriesStandard = Enumerable.Empty(); CountriesDaylight = Enumerable.Empty(); + ShortcutsStandard = Enumerable.Empty(); + ShortcutsDaylight = Enumerable.Empty(); } /// @@ -63,6 +65,16 @@ public OneTimeZone() /// public IEnumerable CountriesDaylight { get; set; } + /// + /// Gets or sets a list with shortcuts for the names for the standard time. + /// + public IEnumerable ShortcutsStandard { get; set; } + + /// + /// Gets or sets a list with shortcuts for the names for the daylight saving time. + /// + public IEnumerable ShortcutsDaylight { get; set; } + /// /// Gets a compatible of the . /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 2db52a6d450..5431cf30128 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -38,7 +38,9 @@ internal static IEnumerable GetResults(in IEnumerable timeZ foreach (var timeZone in timeZones) { - if (MatchShortcuts(timeZone, query) + if (MatchTimeZoneShortcut(timeZone, query) + || MatchStandardTimeShortcuts(timeZone, query) + || MatchDaylightTimeShortcuts(timeZone, query) || MatchTimeZoneNames(timeZone, query) || MatchStandardTimeNames(timeZone, query) || MatchDaylightTimeNames(timeZone, query) @@ -84,7 +86,12 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim return results; } - if (MatchStandardCountries(oneTimeZone, query) || MatchStandardTimeNames(oneTimeZone, query) || MatchTimeZoneNames(oneTimeZone, query) || MatchOffset(oneTimeZone, query)) + if (MatchStandardTimeShortcuts(oneTimeZone, query) + || MatchStandardTimeNames(oneTimeZone, query) + || MatchStandardCountries(oneTimeZone, query) + || MatchTimeZoneShortcut(oneTimeZone, query) + || MatchTimeZoneNames(oneTimeZone, query) + || MatchOffset(oneTimeZone, query)) { results.Add(new Result { @@ -96,7 +103,12 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim }); } - if (MatchDaylightCountries(oneTimeZone, query) || MatchDaylightTimeNames(oneTimeZone, query) || MatchTimeZoneNames(oneTimeZone, query) || MatchOffset(oneTimeZone, query)) + if (MatchDaylightTimeShortcuts(oneTimeZone, query) + || MatchDaylightTimeNames(oneTimeZone, query) + || MatchDaylightCountries(oneTimeZone, query) + || MatchTimeZoneShortcut(oneTimeZone, query) + || MatchTimeZoneNames(oneTimeZone, query) + || MatchOffset(oneTimeZone, query)) { results.Add(new Result { @@ -579,12 +591,12 @@ private static string GetAllCountries(in OneTimeZone oneTimeZone, Query? query, } /// - /// Indicate that the given query match the shortcut of the given time zone. + /// Indicate that the given query match the time zone shortcut of the given time zone. /// /// The time zone to check. /// The query that should match. /// if the query match, otherwise . - private static bool MatchShortcuts(in OneTimeZone oneTimeZone, Query query) + private static bool MatchTimeZoneShortcut(in OneTimeZone oneTimeZone, Query query) { var result = oneTimeZone.Shortcut.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase); return result; @@ -604,30 +616,6 @@ private static bool MatchTimeZoneNames(in OneTimeZone oneTimeZone, Query query) return result; } - /// - /// Indicate that the given query match one of the daylight time names of the given time zone. - /// - /// The time zone to check. - /// The query that should match. - /// if the query match, otherwise . - private static bool MatchDaylightTimeNames(in OneTimeZone oneTimeZone, Query query) - { - var result = oneTimeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; - return result; - } - - /// - /// Indicate that the given query match one of the standard time names of the given time zone. - /// - /// The time zone to check. - /// The query that should match. - /// if the query match, otherwise . - private static bool MatchStandardTimeNames(in OneTimeZone oneTimeZone, Query query) - { - var result = oneTimeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; - return result; - } - /// /// Indicate that the given query match the offset of the given time zone. /// @@ -657,6 +645,30 @@ private static bool MatchOffset(in OneTimeZone oneTimeZone, Query query) return false; } + /// + /// Indicate that the given query match one of the standard time names of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchStandardTimeNames(in OneTimeZone oneTimeZone, Query query) + { + var result = oneTimeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + return result; + } + + /// + /// Indicate that the given query match one of the daylight time names of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchDaylightTimeNames(in OneTimeZone oneTimeZone, Query query) + { + var result = oneTimeZone.TimeNamesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + return result; + } + /// /// Indicate that the given query match one of the countries that use the standard time of the given time zone. /// @@ -680,5 +692,29 @@ private static bool MatchDaylightCountries(in OneTimeZone oneTimeZone, Query que var result = oneTimeZone.CountriesDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; return result; } + + /// + /// Indicate that the given query match the time zone shortcut of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchStandardTimeShortcuts(in OneTimeZone oneTimeZone, Query query) + { + var result = oneTimeZone.ShortcutsStandard?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + return result; + } + + /// + /// Indicate that the given query match the time zone shortcut of the given time zone. + /// + /// The time zone to check. + /// The query that should match. + /// if the query match, otherwise . + private static bool MatchDaylightTimeShortcuts(in OneTimeZone oneTimeZone, Query query) + { + var result = oneTimeZone.ShortcutsDaylight?.Any(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)) == true; + return result; + } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index d4b1f972978..0515c8e5181 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -7,6 +7,12 @@ "Name": "International Date Line West time zone", "Shortcut": "IDLW", "MilitaryName": "Yankee Time Zone", + "TimeNamesStandard": [ + "Baker Island Time" + ], + "ShortcutsStandard": [ + "BIT" + ], "CountriesStandard": [ "Baker Island", "Howland Island" @@ -17,16 +23,29 @@ "Name": "Samoa Time Zone", "MilitaryName": "X-ray Time Zone", "TimeNamesStandard": [ + "Niue Time", "Samoa Standard Time" ], - "CountriesStandard": - [ + "ShortcutsStandard": [ + "NUT", + "SST" + ], + "TimeNamesDaylight": [ + "Samoa Daylight Time" + ], + "ShortcutsDaylight": [ + "SDT" + ], + "CountriesStandard": [ "American Samoa", "Jarvis Island", "Kingman Reef", "Midway Atoll", "Niue", "Palmyra Atoll" + ], + "CountriesDaylight": [ + "American Samoa" ] }, { @@ -34,11 +53,19 @@ "Name": "Hawaii–Aleutian Time Zone", "MilitaryName": "Whiskey Time Zone", "TimeNamesStandard": [ - "Hawaii–Aleutian Standard Time" + "Hawaii–Aleutian Standard Time", + "Tahiti Time" + ], + "ShortcutsStandard": [ + "HST", + "TAHT" ], "TimeNamesDaylight": [ "Hawaii–Aleutian Daylight Time" ], + "ShortcutsDaylight": [ + "HDT" + ], "CountriesStandard": [ "Cook Islands", "French Polynesia (most)", @@ -54,6 +81,13 @@ }, { "Offset": "-09:30", + "TimeNamesStandard": [ + "Marquesas Islands Time" + ], + "ShortcutsStandard": [ + "MART", + "MIT" + ], "CountriesStandard": [ "Marquesas Islands (French Polynesia)" ] @@ -62,6 +96,21 @@ "Offset": "-09:00", "Name": "Alaska Time Zone", "MilitaryName": "Victor Time Zone", + "TimeNamesStandard": [ + "Alaska Standard Time", + "Gambier Islands Time" + ], + "ShortcutsStandard": [ + "AKST", + "GAMT", + "GIT" + ], + "TimeNamesDaylight": [ + "Alaska Daylight Time" + ], + "ShortcutsDaylight": [ + "AKDT" + ], "CountriesStandard": [ "Gambier Islands (French Polynesia)" ], @@ -77,9 +126,15 @@ "TimeNamesStandard": [ "Pacific Standard Time" ], + "ShortcutsStandard": [ + "PST" + ], "TimeNamesDaylight": [ "Pacific Daylight Time" ], + "ShortcutsDaylight": [ + "PDT" + ], "CountriesStandard": [ "Clipperton Island", "Pitcairn Islands" @@ -101,9 +156,15 @@ "TimeNamesStandard": [ "Mountain Standard Time" ], + "ShortcutsStandard": [ + "MST" + ], "TimeNamesDaylight": [ "Mountain Daylight Time" ], + "ShortcutsDaylight": [ + "MDT" + ], "CountriesStandard": [ "British Columbia (northeast, Canada)", "Yukon (Canada)", @@ -133,10 +194,22 @@ "Shortcut": "CT", "MilitaryName": "Sierra Time Zone", "TimeNamesStandard": [ - "Central Standard Time" + "Central Standard Time", + "Easter Island Standard Time", + "Galápagos Time" + ], + "ShortcutsStandard": [ + "CST", + "EAST", + "GALT" ], "TimeNamesDaylight": [ - "Central Daylight Time" + "Central Daylight Time", + "Easter Island Summer Time" + ], + "ShortcutsDaylight": [ + "CDT", + "EASST" ], "CountriesStandard": [ "Belize", @@ -178,11 +251,31 @@ "Shortcut": "ET", "MilitaryName": "Romeo Time Zone", "TimeNamesStandard": [ - "Eastern Standard Time" + "Acre Time", + "Colombia Time", + "Cuba Standard Time", + "Ecuador Time", + "Eastern Standard Time", + "Peru Time" + ], + "ShortcutsStandard": [ + "ACT", + "COT", + "CST", + "ECT", + "EST", + "PET" ], "TimeNamesDaylight": [ + "Cuba Daylight Time", + "Colombia Summer Time", "Eastern Daylight Time" ], + "ShortcutsDaylight": [ + "CDT", + "COST", + "EDT" + ], "CountriesStandard": [ "Acre (Brazil)", "Atikokan (Canada)", @@ -234,10 +327,38 @@ "Name": "Atlantic Time Zone", "MilitaryName": "Quebec Time Zone", "TimeNamesStandard": [ - "Atlantic Standard Time" + "Amazon Time", + "Atlantic Standard Time", + "Bolivia Time", + "Eastern Caribbean Time", + "Falkland Islands Time", + "Guyana Time", + "Paraguay Time", + "Venezuelan Standard Time" + ], + "ShortcutsStandard": [ + "AMT", + "AST", + "BOT", + "ECT", + "FKT", + "GYT", + "PYT", + "VET" ], "TimeNamesDaylight": [ - "Atlantic Daylight Time" + "Atlantic Daylight Time", + "Amazon Summer Time", + "Chile Summer Time", + "Falkland Islands Summer Time", + "Paraguay Summer Time" + ], + "ShortcutsDaylight": [ + "AMST", + "ADT", + "CLST", + "FKST", + "PYST" ], "CountriesStandard": [ "Anguilla", @@ -287,14 +408,60 @@ "Offset": "-03:30", "Name": "Newfoundland Time Zone", "Shortcut": "NT", + "TimeNamesStandard": [ + "Newfoundland Standard Time" + ], + "ShortcutsStandard": [ + "NST" + ], + "TimeNamesDaylight": [ + "Newfoundland Daylight Time" + ], + "ShortcutsDaylight": [ + "NDT" + ], "CountriesStandard": [ - "Newfoundland (Canada)", "Labrador (southeast, Canada)" + ], + "CountriesDaylight": [ + "Newfoundland (Canada)" ] }, { "Offset": "-03:00", "MilitaryName": "Papa Time Zone", + "TimeNamesStandard": [ + "Argentina Time", + "Brasília Time", + "French Guiana Time", + "Saint Pierre and Miquelon Standard Time", + "Rothera Research Station Time", + "Suriname Time", + "Uruguay Standard Time", + "West Greenland Time" + ], + "ShortcutsStandard": [ + "ART", + "BRT", + "GFT", + "PMST", + "ROTT", + "SRT", + "UYT", + "WGT" + ], + "TimeNamesDaylight": [ + "Brasília Summer Time", + "Saint Pierre and Miquelon Daylight Time", + "Uruguay Summer Time", + "West Greenland Summer Time" + ], + "ShortcutsDaylight": [ + "BRST", + "PMDT", + "WGST", + "UYST" + ], "CountriesStandard": [ "Argentina", "Brazil (most)", @@ -312,6 +479,14 @@ { "Offset": "-02:00", "MilitaryName": "Oscar Time Zone", + "TimeNamesStandard": [ + "Fernando de Noronha Time", + "South Georgia and the South Sandwich Islands Time" + ], + "ShortcutsStandard": [ + "FNT", + "GST" + ], "CountriesStandard": [ "Fernando de Noronha (Brazil)", "South Georgia and the South Sandwich Islands" @@ -320,6 +495,24 @@ { "Offset": "-01:00", "MilitaryName": "November Time Zone", + "TimeNamesStandard": [ + "Azores Standard Time", + "Cape Verde Time", + "Eastern Greenland Time" + ], + "ShortcutsStandard": [ + "AZOT", + "CVT", + "EGT" + ], + "TimeNamesDaylight": [ + "Azores Summer Time", + "Eastern Greenland Summer Time" + ], + "ShortcutsDaylight": [ + "AZOST", + "EGST" + ], "CountriesStandard": [ "Cape Verde" ], @@ -333,14 +526,19 @@ "Name": "Coordinated Universal Time", "Shortcut": "UTC", "MilitaryName": "Zulu Time Zone", + "TimeNamesStandard": [ + "Greenwich Mean Time", + "Western European Time" + ], + "ShortcutsStandard": [ + "GMT", + "WET" + ], "TimeNamesDaylight": [ "Western European Summer Time", "British Summer Time", "Irish Standard Time" ], - "TimeNamesStandard": [ - "Western European Time" - ], "CountriesStandard": [ "Ascension and Tristan da Cunha", "Burkina Faso", From 1ae4bde93d51782fa90e4b36ecb42d85918a8f97 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 4 Jan 2022 11:24:54 +0100 Subject: [PATCH 39/67] update schema --- .../timeZones.schema.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json index 6ba5b635fbc..c74e1d96cbb 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timeZones.schema.json @@ -41,6 +41,22 @@ "type": "string" } }, + "ShortcutsStandard": { + "type": "array", + "description": "A list with shortcuts for the names for the standard time.", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "ShortcutsDaylight": { + "type": "array", + "description": "A list with shortcuts for the names for the daylight saving time.", + "uniqueItems": true, + "items": { + "type": "string" + } + }, "CountriesStandard": { "type": "array", "description": "A list with all countries in this time zone that use a standard time.", From 75f9ad0ccc19c6a9a35423ac78ebed5ff6187266 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 5 Jan 2022 08:40:45 +0100 Subject: [PATCH 40/67] Add more time zone names and shortcuts (second pass), make spell checker happy --- .github/actions/spell-check/expect.txt | 13 +- .../Helper/ResultHelper.cs | 7 +- .../timezones.json | 351 ++++++++++++++++-- 3 files changed, 331 insertions(+), 40 deletions(-) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 900299a43dc..a255f24927c 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -133,8 +133,7 @@ AZCLI azurecr backend backtracer -BAEC -BAF +BADD bak bbwe bck @@ -235,8 +234,8 @@ CHILDWINDOW chrdavis chromaticities chrono -Chrzan chrzan +Chrzan CHT cielab ciexyz @@ -1068,6 +1067,7 @@ Lastdevice LASTEXITCODE Laute laute +Laute laviusmotileng LAYOUTRTL LBUTTON @@ -1479,6 +1479,7 @@ pcb pch PCIDLIST PCWSTR +pdb Pdb pdb pdbonly @@ -2009,6 +2010,7 @@ SYSTEMTIME systemverilog Tadele tadele +Tadele talynone TApp TApplication @@ -2064,6 +2066,7 @@ toggleswitch Toolchain toolkitcontrols toolkitconverters +toolset Toolset toolset toolstrip @@ -2162,8 +2165,8 @@ USESHOWWINDOW USESTDHANDLES ushort USRDLL -Utc utc +Utc utf utils uuidof @@ -2399,4 +2402,4 @@ ZONEHIGHLIGHTCOLOR zoneset ZONESETCHANGE Zoneszonabletester -zzz +zzz \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 5431cf30128..58c3e94a2be 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -12,10 +12,9 @@ using Mono.Collections.Generic; using Wox.Plugin; -// TODO: revisit time zone names -// TODO: revisit standard time names -// TODO: revisit DST time names -// TODO: add more time zone shortcuts +// TODO: Show shortcuts in tool tips +// TODO: revisited time zone names +// TODO: revisited countries namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 0515c8e5181..400995b34b0 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -535,9 +535,14 @@ "WET" ], "TimeNamesDaylight": [ - "Western European Summer Time", "British Summer Time", - "Irish Standard Time" + "Irish Standard Time", + "Western European Summer Time" + ], + "ShortcutsDaylight": [ + "BST", + "IST", + "WEST" ], "CountriesStandard": [ "Ascension and Tristan da Cunha", @@ -573,11 +578,26 @@ "Offset": "01:00", "MilitaryName": "Alpha Time Zone", "TimeNamesStandard": [ - "Central European Time" + "Central European Time", + "Middle European Time", + "West Africa Time" + ], + "ShortcutsStandard": [ + "CET", + "MET", + "WAT" ], "TimeNamesDaylight": [ "Central European Summer Time", - "Central European Daylight Time" + "Heure Avancée d'Europe Centrale", + "Middle European Summer Time", + "West Africa Summer Time" + ], + "ShortcutsDaylight": [ + "CEST", + "HAEC", + "MEST", + "WAST" ], "CountriesStandard": [ "Algeria", @@ -643,11 +663,26 @@ "Offset": "02:00", "MilitaryName": "Bravo Time Zone", "TimeNamesStandard": [ + "Central Africa Time", "Eastern European Time", - "Kaliningrad Time" + "Israel Standard Time", + "Kaliningrad Time", + "South African Standard Time" + ], + "ShortcutsStandard": [ + "CAT", + "EET", + "IST", + "KALT", + "SAST" ], "TimeNamesDaylight": [ - "Eastern European Summer Time" + "Eastern European Summer Time", + "Israel Daylight Time" + ], + "ShortcutsDaylight": [ + "EEST", + "IDT" ], "CountriesStandard": [ "Botswana", @@ -692,10 +727,22 @@ "Offset": "03:00", "MilitaryName": "Charlie Time Zone", "TimeNamesStandard": [ + "Arabia Standard Time", + "East Africa Time", "Further-eastern European Time", + "Indian Ocean Time", "Moscow Time", - "Turkey Time", - "East Africa Time" + "Showa Station Time", + "Turkey Time" + ], + "ShortcutsStandard": [ + "AST", + "EAT", + "FET", + "IOT", + "MSK", + "SYOT", + "TRT" ], "CountriesStandard": [ "Abkhazia", @@ -732,6 +779,15 @@ "TimeNamesStandard": [ "Iran Standard Time" ], + "ShortcutsStandard": [ + "IRST" + ], + "TimeNamesDaylight": [ + "Iran Daylight Time" + ], + "ShortcutsDaylight": [ + "IRDT" + ], "CountriesDaylight": [ "Iran" ] @@ -740,13 +796,27 @@ "Offset": "04:00", "MilitaryName": "Delta Time Zone", "TimeNamesDaylight": [ - "Samara Time", "Armenia Time", "Azerbaijan Time", - "Georgia Time", - "United Arab Emirates Standard Time", + "Georgia Standard Time", + "Gulf Standard Time", "Mauritius Time", - "Seychelles Time" + "Réunion Time", + "Samara Time", + "Seychelles Time", + "Volgograd Time", + "United Arab Emirates Standard Time" + ], + "ShortcutsStandard": [ + "AMT", + "AZT", + "GET", + "GST", + "MUT", + "RET", + "SAMT", + "SCT", + "VOLT" ], "CountriesDaylight": [ "Armenia", @@ -771,6 +841,9 @@ "TimeNamesStandard": [ "Afghanistan Time" ], + "ShortcutsStandard": [ + "AFT" + ], "CountriesStandard": [ "Afghanistan" ] @@ -779,9 +852,31 @@ "Offset": "05:00", "MilitaryName": "Echo Time Zone", "TimeNamesStandard": [ + "Aqtobe Time", + "Heard and McDonald Islands Time", + "Mawson Station Time", + "Maldives Time", + "Oral Time", "Pakistan Standard Time", + "French Southern and Antarctic Time", + "Tajikistan Time", + "Turkmenistan Time", + "Uzbekistan Time", "Yekaterinburg Time" ], + "ShortcutsStandard": [ + "AQTT", + "HMT", + "MAWT", + "MVT", + "ORAT", + "PKT", + "TFT", + "TJT", + "TMT", + "UZT", + "YEKT" + ], "CountriesStandard": [ "Amsterdam Island (French Southern and Antarctic Lands)", "Kerguelen Islands (French Southern and Antarctic Lands)", @@ -815,6 +910,10 @@ "Indian Standard Time", "Sri Lanka Standard Time" ], + "ShortcutsStandard": [ + "IST", + "SLST" + ], "CountriesStandard": [ "India", "Sri Lanka" @@ -825,6 +924,9 @@ "TimeNamesStandard": [ "Nepal Standard Time" ], + "ShortcutsStandard": [ + "NPT" + ], "CountriesStandard": [ "Nepal" ] @@ -833,10 +935,22 @@ "Offset": "06:00", "MilitaryName": "Foxtrot Time Zone", "TimeNamesStandard": [ + "Alma-Ata Time", + "British Indian Ocean Time", "Bangladesh Standard Time", "Bhutan Time", "Kyrgyzstan Time", - "Omsk Time" + "Omsk Time", + "Vostok Station Time" + ], + "ShortcutsStandard": [ + "ALMT", + "BIOT", + "BST", + "BTT", + "KGT", + "OMST", + "VOST" ], "CountriesStandard": [ "Bangladesh", @@ -850,8 +964,15 @@ { "Offset": "06:30", "TimeNamesStandard": [ + "ASEAN Common Time", + "Cocos Islands Time", "Myanmar Standard Time" ], + "ShortcutsStandard": [ + "ACT", + "CCT", + "MMT" + ], "CountriesStandard": [ "Cocos Islands", "Myanmar" @@ -861,10 +982,24 @@ "Offset": "07:00", "MilitaryName": "Golf Time Zone", "TimeNamesStandard": [ - "Western Indonesian Time", "Christmas Island Time", + "Davis Time", + "Hovd Time", + "Indochina Time", "Krasnoyarsk Time", - "Western Indonesia Time" + "Novosibirsk Time", + "Thailand Standard Time", + "Western Indonesian Time" + ], + "ShortcutsStandard": [ + "CXT", + "DAVT", + "HOVT", + "ICT", + "KRAT", + "NOVT", + "THA", + "WIB" ], "CountriesStandard": [ "Cambodia", @@ -893,13 +1028,46 @@ "Offset": "08:00", "MilitaryName": "Hotel Time Zone", "TimeNamesStandard": [ - "Central Indonesian Time", - "Western Australia Standard Time", + "Australian Western Standard Time", + "Brunei Time", + "Choibalsan Standard Time", + "Clipperton Island Standard Time", "China Standard Time", - "Hong Kong Standard Time", - "Macau Standard Time", - "National Standard Time", - "Irkutsk Time" + "Hong Kong Time", + "Irkutsk Time", + "Malaysia Standard Time", + "Malaysia Time", + "Philippine Time", + "Philippine Standard Time", + "Singapore Time", + "Singapore Standard Time", + "Ulaanbaatar Standard Time", + "Central Indonesian Time", + "Western Standard Time", + "Western Australia Standard Time" + ], + "ShortcutsStandard": [ + "AWST", + "BNT", + "CHOT", + "CIST", + "CST", + "HKT", + "IRKT", + "MST", + "MYT", + "PHT", + "PHST", + "SST", + "ULAT", + "WITA", + "WST" + ], + "TimeNamesDaylight": [ + "Ulaanbaatar Summer Time" + ], + "ShortcutsDaylight": [ + "ULAST" ], "CountriesStandard": [ "Australia: Western Australia (most)", @@ -926,8 +1094,13 @@ { "Offset": "08:45", "TimeNamesStandard": [ + "Australian Central Western Standard Time", "Central Western Standard Time" ], + "ShortcutsStandard": [ + "ACWST", + "CWST" + ], "CountriesStandard": [ "Caiguna (Australia)", "Cocklebiddy (Australia)", @@ -941,9 +1114,22 @@ "Offset": "09:00", "MilitaryName": "India Time Zone", "TimeNamesStandard": [ + "Choibalsan Summer Time", + "Japan Standard Time", + "Korea Standard Time", + "Palau Time", + "Timor Leste Time", "Eastern Indonesian Time", - "Yakutsk Time", - "Japan Standard Time" + "Yakutsk Time" + ], + "ShortcutsStandard": [ + "CHOST", + "JST", + "KST", + "PWT", + "TLT", + "WIT", + "YAKT" ], "CountriesStandard": [ "East Timor", @@ -963,7 +1149,16 @@ { "Offset": "09:30", "TimeNamesStandard": [ - "Central Standard Time" + "Australian Central Standard Time" + ], + "ShortcutsStandard": [ + "ACST" + ], + "TimeNamesDaylight": [ + "Australian Central Daylight Saving Time" + ], + "ShortcutsDaylight": [ + "ACDT" ], "CountriesStandard": [ "Northern Territory", @@ -975,13 +1170,30 @@ "Name": "Chamorro Time Zone", "MilitaryName": "Kilo Time Zone", "TimeNamesStandard": [ - "Vladivostok Time", - "Eastern Standard Time", - "Chamorro Standard Time" + "Australian Eastern Standard Time", + "Australian Eastern Time", + "Chamorro Standard Time", + "Chuuk Time", + "Dumont d'Urville Time", + "Papua New Guinea Time", + "Vladivostok Time" + ], + "ShortcutsStandard": [ + "AEST", + "AET", + "CHST", + "CHUT", + "DDUT", + "PGT", + "VLAT" ], "TimeNamesDaylight": [ - "Central Daylight Time", - "Eastern Daylight Time" + "Australian Eastern Daylight Saving Time", + "Lord Howe Summer Time" + ], + "ShortcutsDaylight": [ + "AEDT", + "LHST" ], "CountriesStandard": [ "Queensland (Australia)", @@ -1005,6 +1217,12 @@ }, { "Offset": "10:30", + "TimeNamesStandard": [ + "Lord Howe Standard Time" + ], + "ShortcutsStandard": [ + "LHST" + ], "CountriesDaylight": [ "Lord Howe Island (Australia)" ] @@ -1013,7 +1231,28 @@ "Offset": "11:00", "MilitaryName": "Lima Time Zone", "TimeNamesStandard": [ - "Magadan Time" + "Bougainville Standard Time", + "Kosrae Time", + "Macquarie Island Station Time", + "New Caledonia Time", + "Norfolk Island Time", + "Pohnpei Standard Time", + "Sakhalin Island Time", + "Solomon Islands Time", + "Srednekolymsk Time", + "Vanuatu Time" + ], + "ShortcutsStandard": [ + "BST", + "KOST", + "MIST", + "NCT", + "NFT", + "PONT", + "SAKT", + "SBT", + "SRET", + "VUT" ], "CountriesStandard": [ "Kosrae (Micronesia)", @@ -1034,7 +1273,26 @@ "Offset": "12:00", "MilitaryName": "Mike Time Zone", "TimeNamesStandard": [ - "Kamchatka Time" + "Anadyr Time", + "Fiji Time", + "Gilbert Island Time", + "Magadan Time", + "Marshall Islands Time", + "New Zealand Standard Time", + "Kamchatka Time", + "Tuvalu Time", + "Wake Island Time" + ], + "ShortcutsStandard": [ + "ANAT", + "FJT", + "GILT", + "MAGT", + "MHT", + "NZST", + "PETT", + "TVT", + "WAKT" ], "CountriesStandard": [ "Fiji", @@ -1047,6 +1305,12 @@ "Wake Island", "Wallis and Futuna" ], + "TimeNamesDaylight": [ + "New Zealand Daylight Time" + ], + "ShortcutsDaylight": [ + "NZDT" + ], "CountriesDaylight": [ "New Zealand" ] @@ -1056,6 +1320,15 @@ "TimeNamesStandard": [ "Chatham Standard Time" ], + "ShortcutsStandard": [ + "CHAST" + ], + "TimeNamesDaylight": [ + "Chatham Daylight Time" + ], + "ShortcutsDaylight": [ + "CHADT" + ], "CountriesStandard": [ "Chatham Islands (New Zealand)", "Pitt Islands (New Zealand)", @@ -1069,6 +1342,16 @@ }, { "Offset": "13:00", + "TimeNamesStandard": [ + "Phoenix Island Time", + "Tokelau Time", + "Tonga Time" + ], + "ShortcutsStandard": [ + "PHOT", + "TKT", + "TOT" + ], "CountriesStandard": [ "Phoenix Islands (Kiribati)", "Samoa", @@ -1078,6 +1361,12 @@ }, { "Offset": "14:00", + "TimeNamesStandard": [ + "Line Islands Time" + ], + "ShortcutsStandard": [ + "LINT" + ], "CountriesStandard": [ "Line Islands (Kiribati)" ] From ac01b25ee1fe3cf1d37434d9352e9fe52e6ba35c Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 6 Jan 2022 08:17:31 +0100 Subject: [PATCH 41/67] Reduce matching checks --- .../Helper/ResultHelper.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 58c3e94a2be..f9614d56d3c 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -85,12 +85,16 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim return results; } + if (!MatchTimeZoneShortcut(oneTimeZone, query) + && !MatchTimeZoneNames(oneTimeZone, query) + && !MatchOffset(oneTimeZone, query)) + { + return results; + } + if (MatchStandardTimeShortcuts(oneTimeZone, query) || MatchStandardTimeNames(oneTimeZone, query) - || MatchStandardCountries(oneTimeZone, query) - || MatchTimeZoneShortcut(oneTimeZone, query) - || MatchTimeZoneNames(oneTimeZone, query) - || MatchOffset(oneTimeZone, query)) + || MatchStandardCountries(oneTimeZone, query)) { results.Add(new Result { @@ -104,10 +108,7 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim if (MatchDaylightTimeShortcuts(oneTimeZone, query) || MatchDaylightTimeNames(oneTimeZone, query) - || MatchDaylightCountries(oneTimeZone, query) - || MatchTimeZoneShortcut(oneTimeZone, query) - || MatchTimeZoneNames(oneTimeZone, query) - || MatchOffset(oneTimeZone, query)) + || MatchDaylightCountries(oneTimeZone, query)) { results.Add(new Result { From 2b8a28b5fb162cf9c9ba7803fb2193b5d8f68100 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 6 Jan 2022 09:13:11 +0100 Subject: [PATCH 42/67] Show shortcuts in tool-tips, avoid string converting --- .../Helper/ResultHelper.cs | 211 +++++++++++++----- .../Properties/Resources.Designer.cs | 9 + .../Properties/Resources.resx | 3 + 3 files changed, 171 insertions(+), 52 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index f9614d56d3c..f578e740da1 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -4,17 +4,20 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; +using Microsoft.Extensions.Primitives; using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; using Microsoft.PowerToys.Run.Plugin.TimeZone.Extensions; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Mono.Collections.Generic; using Wox.Plugin; -// TODO: Show shortcuts in tool tips // TODO: revisited time zone names // TODO: revisited countries +// TODO: translate all countries +// FIXME: sometimes daylight countries in tool tips are empty namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { /// @@ -71,15 +74,15 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim var standardTitle = GetTitle(oneTimeZone, options, dateTime, false); var daylightTitle = GetTitle(oneTimeZone, options, dateTime, true); - if (standardTitle == daylightTitle) + if (standardTitle.Equals(daylightTitle)) { results.Add(new Result { ContextData = GetTimeInTimeZone(oneTimeZone, dateTime, false), IcoPath = iconPath, - Title = standardTitle, - SubTitle = GetAllCountries(oneTimeZone, query, maxLength: 100), - ToolTipData = new ToolTipData(standardTitle, GetAllToolTip(oneTimeZone, options)), + Title = standardTitle.ToString(), + SubTitle = GetAllCountries(oneTimeZone, query, maxLength: 100).ToString(), + ToolTipData = new ToolTipData(standardTitle.ToString(), GetAllToolTip(oneTimeZone, options).ToString()), }); return results; @@ -100,9 +103,9 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim { ContextData = GetTimeInTimeZone(oneTimeZone, dateTime, false), IcoPath = iconPath, - SubTitle = GetStandardCountries(oneTimeZone, query, maxLength: 100), - Title = standardTitle, - ToolTipData = new ToolTipData(standardTitle, GetStandardToolTip(oneTimeZone, options)), + SubTitle = GetStandardCountries(oneTimeZone, query, maxLength: 100).ToString(), + Title = standardTitle.ToString(), + ToolTipData = new ToolTipData(standardTitle.ToString(), GetStandardToolTip(oneTimeZone, options).ToString()), }); } @@ -114,9 +117,9 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim { ContextData = GetTimeInTimeZone(oneTimeZone, dateTime, true), IcoPath = iconPath, - SubTitle = GetDaylightCountries(oneTimeZone, query, maxLength: 100), - Title = daylightTitle, - ToolTipData = new ToolTipData(daylightTitle, GetDaylightToolTip(oneTimeZone, options)), + SubTitle = GetDaylightCountries(oneTimeZone, query, maxLength: 100).ToString(), + Title = daylightTitle.ToString(), + ToolTipData = new ToolTipData(daylightTitle.ToString(), GetDaylightToolTip(oneTimeZone, options).ToString()), }); } @@ -154,12 +157,20 @@ private static DateTime GetTimeInTimeZone(in OneTimeZone oneTimeZone, in DateTim /// The current time in UTC. /// indicate that the result is for a time zone that use a daylight saving time. /// A title for a time zone. - private static string GetTitle(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in DateTime dateTime, in bool daylightSavingTime) + private static StringBuilder GetTitle(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in DateTime dateTime, in bool daylightSavingTime) { + var stringBuilder = new StringBuilder(); + var timeInZoneTime = GetTimeInTimeZone(oneTimeZone, dateTime, daylightSavingTime); var timeZoneNames = GetNames(oneTimeZone, timeZoneSettings, maxLength: 50); - return $"{timeInZoneTime:HH:mm:ss} - {timeZoneNames}"; + stringBuilder.AppendFormat(CultureInfo.CurrentCulture, "{0:HH:mm:ss}", timeInZoneTime); + stringBuilder.Append(' '); + stringBuilder.Append('-'); + stringBuilder.Append(' '); + stringBuilder.Append(timeZoneNames); + + return stringBuilder; } /// @@ -168,21 +179,33 @@ private static string GetTitle(in OneTimeZone oneTimeZone, in TimeZoneSettings t /// The time zone that contain all information. /// Additional options to limit the results. /// A tool-tip with countries that use the standard time. - private static string GetStandardToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) + private static StringBuilder GetStandardToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) { var countries = GetStandardCountries(oneTimeZone, null, maxLength: int.MaxValue); var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); + var shortcuts = GetStandardShortcuts(oneTimeZone); + + if (!string.IsNullOrWhiteSpace(oneTimeZone.Shortcut)) + { + shortcuts.Append(','); + shortcuts.Append(' '); + shortcuts.Append(oneTimeZone.Shortcut); + } var stringBuilder = new StringBuilder(); stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(oneTimeZone.Offset); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.No); stringBuilder.AppendLine(string.Empty); - stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); + stringBuilder.Append(Resources.Names).Append(':').Append(' ').Append(names); + stringBuilder.AppendLine(string.Empty); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Shortcuts).Append(':').Append(' ').Append(shortcuts); stringBuilder.AppendLine(string.Empty); - stringBuilder.Append(Resources.Countries).Append(':').Append(' ').AppendLine(countries); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Countries).Append(':').Append(' ').Append(countries); - return stringBuilder.ToString(); + return stringBuilder; } /// @@ -191,21 +214,33 @@ private static string GetStandardToolTip(in OneTimeZone oneTimeZone, in TimeZone /// The time zone that contain all information. /// Additional options to limit the type of the names. /// A tool-tip with countries that use the daylight saving time. - private static string GetDaylightToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) + private static StringBuilder GetDaylightToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) { var dstCountries = GetDaylightCountries(oneTimeZone, null, maxLength: int.MaxValue); var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); + var shortcuts = GetDaylightShortcuts(oneTimeZone); + + if (!string.IsNullOrWhiteSpace(oneTimeZone.Shortcut)) + { + shortcuts.Append(','); + shortcuts.Append(' '); + shortcuts.Append(oneTimeZone.Shortcut); + } var stringBuilder = new StringBuilder(); stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(oneTimeZone.Offset); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.Yes); stringBuilder.AppendLine(string.Empty); - stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); + stringBuilder.Append(Resources.Names).Append(':').Append(' ').Append(names); stringBuilder.AppendLine(string.Empty); - stringBuilder.Append(Resources.CountriesWithDst).Append(':').Append(' ').AppendLine(dstCountries); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Shortcuts).Append(':').Append(' ').Append(shortcuts); + stringBuilder.AppendLine(string.Empty); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.CountriesWithDst).Append(':').Append(' ').Append(dstCountries); - return stringBuilder.ToString(); + return stringBuilder; } /// @@ -214,34 +249,55 @@ private static string GetDaylightToolTip(in OneTimeZone oneTimeZone, in TimeZone /// The time zone that contain all information. /// Additional options to limit the type of the names. /// A tool-tip with countries. - private static string GetAllToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) + private static StringBuilder GetAllToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) { var countries = GetStandardCountries(oneTimeZone, null, maxLength: int.MaxValue); var dstCountries = GetDaylightCountries(oneTimeZone, null, maxLength: int.MaxValue); var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); + var shortcuts = GetStandardShortcuts(oneTimeZone); + var dstShortcuts = GetDaylightShortcuts(oneTimeZone); + + if (dstShortcuts.Length > 0) + { + shortcuts.Append(','); + shortcuts.Append(' '); + shortcuts.Append(dstShortcuts); + } + + if (!string.IsNullOrWhiteSpace(oneTimeZone.Shortcut)) + { + shortcuts.Append(','); + shortcuts.Append(' '); + shortcuts.Append(oneTimeZone.Shortcut); + } var stringBuilder = new StringBuilder(); stringBuilder.Append(Resources.Offset).Append(':').Append(' ').AppendLine(oneTimeZone.Offset); stringBuilder.Append(Resources.UseDst).Append(':').Append(' ').AppendLine(Resources.Yes); stringBuilder.AppendLine(string.Empty); - stringBuilder.Append(Resources.Names).Append(':').Append(' ').AppendLine(names); + stringBuilder.Append(Resources.Names).Append(':').Append(' ').Append(names); + stringBuilder.AppendLine(string.Empty); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.Shortcuts).Append(':').Append(' ').Append(shortcuts); + stringBuilder.AppendLine(string.Empty); stringBuilder.AppendLine(string.Empty); - stringBuilder.Append(Resources.Countries).Append(':').Append(' ').AppendLine(countries); + stringBuilder.Append(Resources.Countries).Append(':').Append(' ').Append(countries); stringBuilder.AppendLine(string.Empty); - stringBuilder.Append(Resources.CountriesWithDst).Append(':').Append(' ').AppendLine(dstCountries); + stringBuilder.AppendLine(string.Empty); + stringBuilder.Append(Resources.CountriesWithDst).Append(':').Append(' ').Append(dstCountries); - return stringBuilder.ToString(); + return stringBuilder; } /// - /// Return a that contain all know names of the given time zone. + /// Return all know names of the given time zone. /// /// The time zone that contain a hand of names. /// Additional options to limit the type of the names. - /// The maximum length of the result . - /// A that contain names of a given time zone. - private static string GetNames(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in int maxLength) + /// The maximum length of the result. + /// All know names of the given time zone. + private static StringBuilder GetNames(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in int maxLength) { var names = new List(); @@ -265,9 +321,10 @@ private static string GetNames(in OneTimeZone oneTimeZone, in TimeZoneSettings t names.AddRange(oneTimeZone.TimeNamesDaylight); } + var stringBuilder = new StringBuilder(); + if (names.Any()) { - var stringBuilder = new StringBuilder(); var lastEntry = names.LastOrDefault(); foreach (var name in names) @@ -306,36 +363,86 @@ private static string GetNames(in OneTimeZone oneTimeZone, in TimeZoneSettings t } stringBuilder.CutTooLong(maxLength); - - return stringBuilder.ToString(); } else { - // fall-back + stringBuilder.Append("UTC"); + var totalMinutes = oneTimeZone.OffsetAsTimeSpan.TotalMinutes; if (totalMinutes < 0) { - return $"UTC{oneTimeZone.Offset}"; + stringBuilder.Append(oneTimeZone.Offset); } else if (totalMinutes > 0) { - return $"UTC+{oneTimeZone.Offset}"; + stringBuilder.Append('+'); + stringBuilder.Append(oneTimeZone.Offset); } else { - return "UTC±00:00"; + stringBuilder.Append("±00:00"); + } + } + + return stringBuilder; + } + + /// + /// Return all standard time names shortcuts of the given time zone. + /// + /// The time zone that contain a hand of names. + /// All standard time names shortcuts of the given time zone. + private static StringBuilder GetStandardShortcuts(in OneTimeZone oneTimeZone) + { + var stringBuilder = new StringBuilder(); + var lastEntry = oneTimeZone.ShortcutsStandard.LastOrDefault(); + + foreach (var name in oneTimeZone.ShortcutsStandard) + { + stringBuilder.Append(name); + + if (name != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); } } + + return stringBuilder; + } + + /// + /// Return all know daylight time names shortcuts of the given time zone. + /// + /// The time zone that contain a hand of names. + /// All know daylight time names shortcuts of the given time zone. + private static StringBuilder GetDaylightShortcuts(in OneTimeZone oneTimeZone) + { + var stringBuilder = new StringBuilder(); + var lastEntry = oneTimeZone.ShortcutsDaylight.LastOrDefault(); + + foreach (var name in oneTimeZone.ShortcutsDaylight) + { + stringBuilder.Append(name); + + if (name != lastEntry) + { + stringBuilder.Append(','); + stringBuilder.Append(' '); + } + } + + return stringBuilder; } /// - /// Return a that contain all countries that use the standard time of the given time zone. + /// Return all countries that use the standard time of the given time zone. /// /// The time zone that contain the countries. /// The that should match a country that use standard time. - /// The maximum length of the result . - /// A with countries that use the standard time. - private static string GetStandardCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) + /// The maximum length of the result. + /// All countries that use the standard time of the given time zone. + private static StringBuilder GetStandardCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) { IEnumerable countries; @@ -412,17 +519,17 @@ private static string GetStandardCountries(in OneTimeZone oneTimeZone, Query? qu stringBuilder.CutTooLong(maxLength); - return stringBuilder.ToString(); + return stringBuilder; } /// - /// Return a that contain all countries that use the daylight saving time of the given time zone. + /// Return all countries that use the daylight saving time of the given time zone. /// /// The time zone that contain the countries. /// The v - /// The maximum length of the result . - /// A with countries that use the daylight saving time. - private static string GetDaylightCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) + /// The maximum length of the result. + /// All countries that use the daylight saving time of the given time zone. + private static StringBuilder GetDaylightCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) { IEnumerable countries; @@ -499,17 +606,17 @@ private static string GetDaylightCountries(in OneTimeZone oneTimeZone, Query? qu stringBuilder.CutTooLong(maxLength); - return stringBuilder.ToString(); + return stringBuilder; } /// - /// Return a that contain all countries of the given time zone. + /// Return all countries of the given time zone. /// /// The time zone that contain the countries. /// The v - /// The maximum length of the result . - /// A with countries. - private static string GetAllCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) + /// The maximum length of the result. + /// All countries of the given time zone. + private static StringBuilder GetAllCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) { IEnumerable countries; @@ -587,7 +694,7 @@ private static string GetAllCountries(in OneTimeZone oneTimeZone, Query? query, stringBuilder.CutTooLong(maxLength); - return stringBuilder.ToString(); + return stringBuilder; } /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 02bba3bd5a7..2eba02744e8 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -150,6 +150,15 @@ internal static string PluginTitle { } } + /// + /// Looks up a localized string similar to Shortcuts. + /// + internal static string Shortcuts { + get { + return ResourceManager.GetString("Shortcuts", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show military time zone names. /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index f75cf84b756..8476bd7554b 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -148,6 +148,9 @@ Time zone + + Shortcuts + Show military time zone names PowerToysRun Option From 17586879363c59b1ff5e68879f91eebb52bf093e Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 6 Jan 2022 09:23:35 +0100 Subject: [PATCH 43/67] Show only names that match the query --- .../Helper/ResultHelper.cs | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index f578e740da1..f347ce7a9b9 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -71,8 +71,8 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim { var results = new Collection(); - var standardTitle = GetTitle(oneTimeZone, options, dateTime, false); - var daylightTitle = GetTitle(oneTimeZone, options, dateTime, true); + var standardTitle = GetTitle(oneTimeZone, options, query, dateTime, false); + var daylightTitle = GetTitle(oneTimeZone, options, query, dateTime, true); if (standardTitle.Equals(daylightTitle)) { @@ -154,15 +154,16 @@ private static DateTime GetTimeInTimeZone(in OneTimeZone oneTimeZone, in DateTim /// /// The time zone that contain all information. /// Additional options to limit the results. + /// The that should match. /// The current time in UTC. /// indicate that the result is for a time zone that use a daylight saving time. /// A title for a time zone. - private static StringBuilder GetTitle(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in DateTime dateTime, in bool daylightSavingTime) + private static StringBuilder GetTitle(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in Query query, in DateTime dateTime, in bool daylightSavingTime) { var stringBuilder = new StringBuilder(); var timeInZoneTime = GetTimeInTimeZone(oneTimeZone, dateTime, daylightSavingTime); - var timeZoneNames = GetNames(oneTimeZone, timeZoneSettings, maxLength: 50); + var timeZoneNames = GetNames(oneTimeZone, timeZoneSettings, query, maxLength: 50); stringBuilder.AppendFormat(CultureInfo.CurrentCulture, "{0:HH:mm:ss}", timeInZoneTime); stringBuilder.Append(' '); @@ -182,7 +183,7 @@ private static StringBuilder GetTitle(in OneTimeZone oneTimeZone, in TimeZoneSet private static StringBuilder GetStandardToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) { var countries = GetStandardCountries(oneTimeZone, null, maxLength: int.MaxValue); - var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); + var names = GetNames(oneTimeZone, timeZoneSettings, null, maxLength: int.MaxValue); var shortcuts = GetStandardShortcuts(oneTimeZone); if (!string.IsNullOrWhiteSpace(oneTimeZone.Shortcut)) @@ -217,7 +218,7 @@ private static StringBuilder GetStandardToolTip(in OneTimeZone oneTimeZone, in T private static StringBuilder GetDaylightToolTip(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings) { var dstCountries = GetDaylightCountries(oneTimeZone, null, maxLength: int.MaxValue); - var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); + var names = GetNames(oneTimeZone, timeZoneSettings, null, maxLength: int.MaxValue); var shortcuts = GetDaylightShortcuts(oneTimeZone); if (!string.IsNullOrWhiteSpace(oneTimeZone.Shortcut)) @@ -253,7 +254,7 @@ private static StringBuilder GetAllToolTip(in OneTimeZone oneTimeZone, in TimeZo { var countries = GetStandardCountries(oneTimeZone, null, maxLength: int.MaxValue); var dstCountries = GetDaylightCountries(oneTimeZone, null, maxLength: int.MaxValue); - var names = GetNames(oneTimeZone, timeZoneSettings, maxLength: int.MaxValue); + var names = GetNames(oneTimeZone, timeZoneSettings, null, maxLength: int.MaxValue); var shortcuts = GetStandardShortcuts(oneTimeZone); var dstShortcuts = GetDaylightShortcuts(oneTimeZone); @@ -291,34 +292,46 @@ private static StringBuilder GetAllToolTip(in OneTimeZone oneTimeZone, in TimeZo } /// - /// Return all know names of the given time zone. + /// Return all names of the given time zone that match the given query. /// /// The time zone that contain a hand of names. /// Additional options to limit the type of the names. + /// The query that should match. /// The maximum length of the result. /// All know names of the given time zone. - private static StringBuilder GetNames(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, in int maxLength) + private static StringBuilder GetNames(in OneTimeZone oneTimeZone, in TimeZoneSettings timeZoneSettings, Query? query, in int maxLength) { - var names = new List(); + var allNames = new List(); if (!string.IsNullOrWhiteSpace(oneTimeZone.Name) && timeZoneSettings.ShowTimeZoneNames) { - names.Add(oneTimeZone.Name); + allNames.Add(oneTimeZone.Name); } if (!string.IsNullOrWhiteSpace(oneTimeZone.MilitaryName) && timeZoneSettings.ShowMilitaryTimeZoneNames) { - names.Add(oneTimeZone.MilitaryName); + allNames.Add(oneTimeZone.MilitaryName); } if (oneTimeZone.TimeNamesStandard != null && timeZoneSettings.ShowTimeZoneNames) { - names.AddRange(oneTimeZone.TimeNamesStandard); + allNames.AddRange(oneTimeZone.TimeNamesStandard); } if (oneTimeZone.TimeNamesDaylight != null && timeZoneSettings.ShowTimeZoneNames) { - names.AddRange(oneTimeZone.TimeNamesDaylight); + allNames.AddRange(oneTimeZone.TimeNamesDaylight); + } + + IEnumerable names; + + if (query is null || string.IsNullOrWhiteSpace(query.Search)) + { + names = allNames; + } + else + { + names = allNames.Where(x => x.Contains(query.Search, StringComparison.CurrentCultureIgnoreCase)); } var stringBuilder = new StringBuilder(); @@ -526,7 +539,7 @@ private static StringBuilder GetStandardCountries(in OneTimeZone oneTimeZone, Qu /// Return all countries that use the daylight saving time of the given time zone. /// /// The time zone that contain the countries. - /// The v + /// The that should match a country that use daylight time. /// The maximum length of the result. /// All countries that use the daylight saving time of the given time zone. private static StringBuilder GetDaylightCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) @@ -613,7 +626,7 @@ private static StringBuilder GetDaylightCountries(in OneTimeZone oneTimeZone, Qu /// Return all countries of the given time zone. /// /// The time zone that contain the countries. - /// The v + /// The that should match a country that use standard or daylight time. /// The maximum length of the result. /// All countries of the given time zone. private static StringBuilder GetAllCountries(in OneTimeZone oneTimeZone, Query? query, in int maxLength) From ca6307b92d9f74aabc9c9aab2d720f0f965b3c4c Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 7 Jan 2022 09:07:36 +0100 Subject: [PATCH 44/67] Make all translatable (Part 1) --- .../Helper/ResultHelper.cs | 7 +- .../Properties/Resources.Designer.cs | 3988 ++++++++++++++++- .../Properties/Resources.resx | 1306 ++++++ .../timezones.json | 12 +- 4 files changed, 5244 insertions(+), 69 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index f347ce7a9b9..6270ebcd3d2 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -7,17 +7,16 @@ using System.Globalization; using System.Linq; using System.Text; -using Microsoft.Extensions.Primitives; using Microsoft.PowerToys.Run.Plugin.TimeZone.Classes; using Microsoft.PowerToys.Run.Plugin.TimeZone.Extensions; using Microsoft.PowerToys.Run.Plugin.TimeZone.Properties; using Mono.Collections.Generic; using Wox.Plugin; -// TODO: revisited time zone names -// TODO: revisited countries -// TODO: translate all countries +// TODO: translate (part 2, UTC+4:00) // FIXME: sometimes daylight countries in tool tips are empty +// TODO: revisited time zone names (use German Wikipedia sites as second reference) +// TODO: revisited countries (use German Wikipedia sites as second reference) namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 2eba02744e8..1a7030cc034 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -60,183 +60,3819 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Abkhazia. + /// + internal static string Abkhazia { + get { + return ResourceManager.GetString("Abkhazia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Acre (Brazil). + /// + internal static string Acre__Brazil_ { + get { + return ResourceManager.GetString("Acre (Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Acre Time. + /// + internal static string Acre_Time { + get { + return ResourceManager.GetString("Acre Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Akrotiri and Dhekelia. + /// + internal static string Akrotiri_and_Dhekelia { + get { + return ResourceManager.GetString("Akrotiri and Dhekelia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alabama (United States). + /// + internal static string Alabama__United_States_ { + get { + return ResourceManager.GetString("Alabama (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alaska (most, United States). + /// + internal static string Alaska__most__United_States_ { + get { + return ResourceManager.GetString("Alaska (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alaska Daylight Time. + /// + internal static string Alaska_Daylight_Time { + get { + return ResourceManager.GetString("Alaska Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alaska Standard Time. + /// + internal static string Alaska_Standard_Time { + get { + return ResourceManager.GetString("Alaska Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alaska Time Zone. + /// + internal static string Alaska_Time_Zone { + get { + return ResourceManager.GetString("Alaska Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Albania. + /// + internal static string Albania { + get { + return ResourceManager.GetString("Albania", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alberta (Canada). + /// + internal static string Alberta__Canada_ { + get { + return ResourceManager.GetString("Alberta (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Algeria. + /// + internal static string Algeria { + get { + return ResourceManager.GetString("Algeria", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alpha Time Zone. + /// + internal static string Alpha_Time_Zone { + get { + return ResourceManager.GetString("Alpha Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Amazon Summer Time. + /// + internal static string Amazon_Summer_Time { + get { + return ResourceManager.GetString("Amazon Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Amazon Time. + /// + internal static string Amazon_Time { + get { + return ResourceManager.GetString("Amazon Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Amazonas (most, Brazil). + /// + internal static string Amazonas__most__Brazil_ { + get { + return ResourceManager.GetString("Amazonas (most, Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to American Samoa. + /// + internal static string American_Samoa { + get { + return ResourceManager.GetString("American Samoa", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Andorra. + /// + internal static string Andorra { + get { + return ResourceManager.GetString("Andorra", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Andreanof Islands (United States). + /// + internal static string Andreanof_Islands__United_States_ { + get { + return ResourceManager.GetString("Andreanof Islands (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Angola. + /// + internal static string Angola { + get { + return ResourceManager.GetString("Angola", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Anguilla. + /// + internal static string Anguilla { + get { + return ResourceManager.GetString("Anguilla", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Antigua and Barbuda. + /// + internal static string Antigua_and_Barbuda { + get { + return ResourceManager.GetString("Antigua and Barbuda", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Arabia Standard Time. + /// + internal static string Arabia_Standard_Time { + get { + return ResourceManager.GetString("Arabia Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Argentina. + /// + internal static string Argentina { + get { + return ResourceManager.GetString("Argentina", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Argentina Time. + /// + internal static string Argentina_Time { + get { + return ResourceManager.GetString("Argentina Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Arizona (most, United States). + /// + internal static string Arizona__most__United_States_ { + get { + return ResourceManager.GetString("Arizona (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Arkansas (United States). + /// + internal static string Arkansas__United_States_ { + get { + return ResourceManager.GetString("Arkansas (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Aruba. + /// + internal static string Aruba { + get { + return ResourceManager.GetString("Aruba", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ascension and Tristan da Cunha. + /// + internal static string Ascension_and_Tristan_da_Cunha { + get { + return ResourceManager.GetString("Ascension and Tristan da Cunha", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Atikokan (Canada). + /// + internal static string Atikokan__Canada_ { + get { + return ResourceManager.GetString("Atikokan (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Atlantic Daylight Time. + /// + internal static string Atlantic_Daylight_Time { + get { + return ResourceManager.GetString("Atlantic Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Atlantic Standard Time. + /// + internal static string Atlantic_Standard_Time { + get { + return ResourceManager.GetString("Atlantic Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Atlantic Time Zone. + /// + internal static string Atlantic_Time_Zone { + get { + return ResourceManager.GetString("Atlantic Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Austria. + /// + internal static string Austria { + get { + return ResourceManager.GetString("Austria", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azores (Portugal). + /// + internal static string Azores__Portugal_ { + get { + return ResourceManager.GetString("Azores (Portugal)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azores Standard Time. + /// + internal static string Azores_Standard_Time { + get { + return ResourceManager.GetString("Azores Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azores Summer Time. + /// + internal static string Azores_Summer_Time { + get { + return ResourceManager.GetString("Azores Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bahamas. + /// + internal static string Bahamas { + get { + return ResourceManager.GetString("Bahamas", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bahrain. + /// + internal static string Bahrain { + get { + return ResourceManager.GetString("Bahrain", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Baja California (Mexico). + /// + internal static string Baja_California__Mexico_ { + get { + return ResourceManager.GetString("Baja California (Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Baja California Sur (Mexico). + /// + internal static string Baja_California_Sur__Mexico_ { + get { + return ResourceManager.GetString("Baja California Sur (Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Baker Island. + /// + internal static string Baker_Island { + get { + return ResourceManager.GetString("Baker Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Baker Island Time. + /// + internal static string Baker_Island_Time { + get { + return ResourceManager.GetString("Baker Island Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Barbados. + /// + internal static string Barbados { + get { + return ResourceManager.GetString("Barbados", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Belarus. + /// + internal static string Belarus { + get { + return ResourceManager.GetString("Belarus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Belgium. + /// + internal static string Belgium { + get { + return ResourceManager.GetString("Belgium", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Belize. + /// + internal static string Belize { + get { + return ResourceManager.GetString("Belize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Benin. + /// + internal static string Benin { + get { + return ResourceManager.GetString("Benin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bermuda. + /// + internal static string Bermuda { + get { + return ResourceManager.GetString("Bermuda", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bolivia. + /// + internal static string Bolivia { + get { + return ResourceManager.GetString("Bolivia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bolivia Time. + /// + internal static string Bolivia_Time { + get { + return ResourceManager.GetString("Bolivia Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bosnia and Herzegovina. + /// + internal static string Bosnia_and_Herzegovina { + get { + return ResourceManager.GetString("Bosnia and Herzegovina", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Botswana. + /// + internal static string Botswana { + get { + return ResourceManager.GetString("Botswana", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Brasília Summer Time. + /// + internal static string Brasília_Summer_Time { + get { + return ResourceManager.GetString("Brasília Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Brasília Time. + /// + internal static string Brasília_Time { + get { + return ResourceManager.GetString("Brasília Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bravo Time Zone. + /// + internal static string Bravo_Time_Zone { + get { + return ResourceManager.GetString("Bravo Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Brazil (most). + /// + internal static string Brazil__most_ { + get { + return ResourceManager.GetString("Brazil (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to British Columbia (most, Canada). + /// + internal static string British_Columbia__most__Canada_ { + get { + return ResourceManager.GetString("British Columbia (most, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to British Columbia (northeast, Canada). + /// + internal static string British_Columbia__northeast__Canada_ { + get { + return ResourceManager.GetString("British Columbia (northeast, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to British Columbia (southeast, Canada). + /// + internal static string British_Columbia__southeast__Canada_ { + get { + return ResourceManager.GetString("British Columbia (southeast, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to British Summer Time. + /// + internal static string British_Summer_Time { + get { + return ResourceManager.GetString("British Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to British Virgin Islands. + /// + internal static string British_Virgin_Islands { + get { + return ResourceManager.GetString("British Virgin Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bulgaria. + /// + internal static string Bulgaria { + get { + return ResourceManager.GetString("Bulgaria", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Burkina Faso. + /// + internal static string Burkina_Faso { + get { + return ResourceManager.GetString("Burkina Faso", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Burundi. + /// + internal static string Burundi { + get { + return ResourceManager.GetString("Burundi", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to California (United States). + /// + internal static string California__United_States_ { + get { + return ResourceManager.GetString("California (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cameroon. + /// + internal static string Cameroon { + get { + return ResourceManager.GetString("Cameroon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Canary Islands. + /// + internal static string Canary_Islands { + get { + return ResourceManager.GetString("Canary Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cape Verde. + /// + internal static string Cape_Verde { + get { + return ResourceManager.GetString("Cape Verde", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cape Verde Time. + /// + internal static string Cape_Verde_Time { + get { + return ResourceManager.GetString("Cape Verde Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Caribbean Netherlands. + /// + internal static string Caribbean_Netherlands { + get { + return ResourceManager.GetString("Caribbean Netherlands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cayman Islands. + /// + internal static string Cayman_Islands { + get { + return ResourceManager.GetString("Cayman Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Central Africa Time. + /// + internal static string Central_Africa_Time { + get { + return ResourceManager.GetString("Central Africa Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Central African Republic. + /// + internal static string Central_African_Republic { + get { + return ResourceManager.GetString("Central African Republic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Central Daylight Time. + /// + internal static string Central_Daylight_Time { + get { + return ResourceManager.GetString("Central Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Central European Summer Time. + /// + internal static string Central_European_Summer_Time { + get { + return ResourceManager.GetString("Central European Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Central European Time. + /// + internal static string Central_European_Time { + get { + return ResourceManager.GetString("Central European Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Central Standard Time. + /// + internal static string Central_Standard_Time { + get { + return ResourceManager.GetString("Central Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Central Time Zone. + /// + internal static string Central_Time_Zone { + get { + return ResourceManager.GetString("Central Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chad. + /// + internal static string Chad { + get { + return ResourceManager.GetString("Chad", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Charlie Time Zone. + /// + internal static string Charlie_Time_Zone { + get { + return ResourceManager.GetString("Charlie Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chihuahua (Mexico). + /// + internal static string Chihuahua__Mexico_ { + get { + return ResourceManager.GetString("Chihuahua (Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chile (most). + /// + internal static string Chile__most_ { + get { + return ResourceManager.GetString("Chile (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chile Summer Time. + /// + internal static string Chile_Summer_Time { + get { + return ResourceManager.GetString("Chile Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clipperton Island. + /// + internal static string Clipperton_Island { + get { + return ResourceManager.GetString("Clipperton Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Colombia. + /// + internal static string Colombia { + get { + return ResourceManager.GetString("Colombia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Colombia Summer Time. + /// + internal static string Colombia_Summer_Time { + get { + return ResourceManager.GetString("Colombia Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Colombia Time. + /// + internal static string Colombia_Time { + get { + return ResourceManager.GetString("Colombia Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Colorado (United States). + /// + internal static string Colorado__United_States_ { + get { + return ResourceManager.GetString("Colorado (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Comoros. + /// + internal static string Comoros { + get { + return ResourceManager.GetString("Comoros", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Congo. + /// + internal static string Congo { + get { + return ResourceManager.GetString("Congo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecticut (United States). + /// + internal static string Connecticut__United_States_ { + get { + return ResourceManager.GetString("Connecticut (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cook Islands. + /// + internal static string Cook_Islands { + get { + return ResourceManager.GetString("Cook Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Coordinated Universal Time. + /// + internal static string Coordinated_Universal_Time { + get { + return ResourceManager.GetString("Coordinated Universal Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Copy time. /// - internal static string CopyTime { + internal static string CopyTime { + get { + return ResourceManager.GetString("CopyTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Costa Rica. + /// + internal static string Costa_Rica { + get { + return ResourceManager.GetString("Costa Rica", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Countries. + /// + internal static string Countries { + get { + return ResourceManager.GetString("Countries", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Countries with daylight saving time. + /// + internal static string CountriesWithDst { + get { + return ResourceManager.GetString("CountriesWithDst", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Crimea. + /// + internal static string Crimea { + get { + return ResourceManager.GetString("Crimea", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Croatia. + /// + internal static string Croatia { + get { + return ResourceManager.GetString("Croatia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cuba. + /// + internal static string Cuba { + get { + return ResourceManager.GetString("Cuba", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cuba Daylight Time. + /// + internal static string Cuba_Daylight_Time { + get { + return ResourceManager.GetString("Cuba Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cuba Standard Time. + /// + internal static string Cuba_Standard_Time { + get { + return ResourceManager.GetString("Cuba Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Curaçao. + /// + internal static string Curaçao { + get { + return ResourceManager.GetString("Curaçao", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cyprus. + /// + internal static string Cyprus { + get { + return ResourceManager.GetString("Cyprus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Czech Republic. + /// + internal static string Czech_Republic { + get { + return ResourceManager.GetString("Czech Republic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Danmarkshavn. + /// + internal static string Danmarkshavn { + get { + return ResourceManager.GetString("Danmarkshavn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Daylight Time. + /// + internal static string DaylightTime { + get { + return ResourceManager.GetString("DaylightTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DT. + /// + internal static string DaylightTimeShortcut { + get { + return ResourceManager.GetString("DaylightTimeShortcut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delaware (United States). + /// + internal static string Delaware__United_States_ { + get { + return ResourceManager.GetString("Delaware (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Democratic Republic of the Congo (most). + /// + internal static string Democratic_Republic_of_the_Congo__most_ { + get { + return ResourceManager.GetString("Democratic Republic of the Congo (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Denmark. + /// + internal static string Denmark { + get { + return ResourceManager.GetString("Denmark", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to District of Columbia (United States). + /// + internal static string District_of_Columbia__United_States_ { + get { + return ResourceManager.GetString("District of Columbia (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Djibouti. + /// + internal static string Djibouti { + get { + return ResourceManager.GetString("Djibouti", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dominica. + /// + internal static string Dominica { + get { + return ResourceManager.GetString("Dominica", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dominican Republic. + /// + internal static string Dominican_Republic { + get { + return ResourceManager.GetString("Dominican Republic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Donetsk PR. + /// + internal static string Donetsk_PR { + get { + return ResourceManager.GetString("Donetsk PR", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to East Africa Time. + /// + internal static string East_Africa_Time { + get { + return ResourceManager.GetString("East Africa Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Easter Island (Chile). + /// + internal static string Easter_Island__Chile_ { + get { + return ResourceManager.GetString("Easter Island (Chile)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Easter Island Standard Time. + /// + internal static string Easter_Island_Standard_Time { + get { + return ResourceManager.GetString("Easter Island Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Easter Island Summer Time. + /// + internal static string Easter_Island_Summer_Time { + get { + return ResourceManager.GetString("Easter Island Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eastern Caribbean Time. + /// + internal static string Eastern_Caribbean_Time { + get { + return ResourceManager.GetString("Eastern Caribbean Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eastern Daylight Time. + /// + internal static string Eastern_Daylight_Time { + get { + return ResourceManager.GetString("Eastern Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eastern European Summer Time. + /// + internal static string Eastern_European_Summer_Time { + get { + return ResourceManager.GetString("Eastern European Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eastern European Time. + /// + internal static string Eastern_European_Time { + get { + return ResourceManager.GetString("Eastern European Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eastern Greenland Summer Time. + /// + internal static string Eastern_Greenland_Summer_Time { + get { + return ResourceManager.GetString("Eastern Greenland Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eastern Greenland Time. + /// + internal static string Eastern_Greenland_Time { + get { + return ResourceManager.GetString("Eastern Greenland Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eastern Standard Time. + /// + internal static string Eastern_Standard_Time { + get { + return ResourceManager.GetString("Eastern Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eastern Time Zone. + /// + internal static string Eastern_Time_Zone { + get { + return ResourceManager.GetString("Eastern Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ecuador: Galápagos. + /// + internal static string Ecuador__Galápagos { + get { + return ResourceManager.GetString("Ecuador: Galápagos", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ecuador (most). + /// + internal static string Ecuador__most_ { + get { + return ResourceManager.GetString("Ecuador (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ecuador Time. + /// + internal static string Ecuador_Time { + get { + return ResourceManager.GetString("Ecuador Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Egypt. + /// + internal static string Egypt { + get { + return ResourceManager.GetString("Egypt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to El Salvador. + /// + internal static string El_Salvador { + get { + return ResourceManager.GetString("El Salvador", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Équateur (Democratic Republic of the Congo). + /// + internal static string Équateur__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Équateur (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Equatorial Guinea. + /// + internal static string Equatorial_Guinea { + get { + return ResourceManager.GetString("Equatorial Guinea", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eritrea. + /// + internal static string Eritrea { + get { + return ResourceManager.GetString("Eritrea", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Estonia. + /// + internal static string Estonia { + get { + return ResourceManager.GetString("Estonia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Eswatini. + /// + internal static string Eswatini { + get { + return ResourceManager.GetString("Eswatini", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ethiopia. + /// + internal static string Ethiopia { + get { + return ResourceManager.GetString("Ethiopia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Falkland Islands. + /// + internal static string Falkland_Islands { + get { + return ResourceManager.GetString("Falkland Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Falkland Islands Summer Time. + /// + internal static string Falkland_Islands_Summer_Time { + get { + return ResourceManager.GetString("Falkland Islands Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Falkland Islands Time. + /// + internal static string Falkland_Islands_Time { + get { + return ResourceManager.GetString("Falkland Islands Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Faroe Islands. + /// + internal static string Faroe_Islands { + get { + return ResourceManager.GetString("Faroe Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fernando de Noronha (Brazil). + /// + internal static string Fernando_de_Noronha__Brazil_ { + get { + return ResourceManager.GetString("Fernando de Noronha (Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fernando de Noronha Time. + /// + internal static string Fernando_de_Noronha_Time { + get { + return ResourceManager.GetString("Fernando de Noronha Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finland. + /// + internal static string Finland { + get { + return ResourceManager.GetString("Finland", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Florida (most, United States). + /// + internal static string Florida__most__United_States_ { + get { + return ResourceManager.GetString("Florida (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to France (metropolitan). + /// + internal static string France__metropolitan_ { + get { + return ResourceManager.GetString("France (metropolitan)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to French Guiana. + /// + internal static string French_Guiana { + get { + return ResourceManager.GetString("French Guiana", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to French Guiana Time. + /// + internal static string French_Guiana_Time { + get { + return ResourceManager.GetString("French Guiana Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to French Polynesia (most). + /// + internal static string French_Polynesia__most_ { + get { + return ResourceManager.GetString("French Polynesia (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Further-eastern European Time. + /// + internal static string Further_eastern_European_Time { + get { + return ResourceManager.GetString("Further-eastern European Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gabon. + /// + internal static string Gabon { + get { + return ResourceManager.GetString("Gabon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Galápagos Time. + /// + internal static string Galápagos_Time { + get { + return ResourceManager.GetString("Galápagos Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gambia. + /// + internal static string Gambia { + get { + return ResourceManager.GetString("Gambia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gambier Islands (French Polynesia). + /// + internal static string Gambier_Islands__French_Polynesia_ { + get { + return ResourceManager.GetString("Gambier Islands (French Polynesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gambier Islands Time. + /// + internal static string Gambier_Islands_Time { + get { + return ResourceManager.GetString("Gambier Islands Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Georgia (United States). + /// + internal static string Georgia__United_States_ { + get { + return ResourceManager.GetString("Georgia (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Germany. + /// + internal static string Germany { + get { + return ResourceManager.GetString("Germany", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ghana. + /// + internal static string Ghana { + get { + return ResourceManager.GetString("Ghana", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gibraltar. + /// + internal static string Gibraltar { + get { + return ResourceManager.GetString("Gibraltar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Greece. + /// + internal static string Greece { + get { + return ResourceManager.GetString("Greece", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Greenland (most). + /// + internal static string Greenland__most_ { + get { + return ResourceManager.GetString("Greenland (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Greenwich Mean Time. + /// + internal static string Greenwich_Mean_Time { + get { + return ResourceManager.GetString("Greenwich Mean Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grenada. + /// + internal static string Grenada { + get { + return ResourceManager.GetString("Grenada", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Guadeloupe. + /// + internal static string Guadeloupe { + get { + return ResourceManager.GetString("Guadeloupe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Guatemala. + /// + internal static string Guatemala { + get { + return ResourceManager.GetString("Guatemala", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Guernsey. + /// + internal static string Guernsey { + get { + return ResourceManager.GetString("Guernsey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Guinea. + /// + internal static string Guinea { + get { + return ResourceManager.GetString("Guinea", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Guinea-Bissau. + /// + internal static string Guinea_Bissau { + get { + return ResourceManager.GetString("Guinea-Bissau", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Guyana. + /// + internal static string Guyana { + get { + return ResourceManager.GetString("Guyana", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Guyana Time. + /// + internal static string Guyana_Time { + get { + return ResourceManager.GetString("Guyana Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Haiti. + /// + internal static string Haiti { + get { + return ResourceManager.GetString("Haiti", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hawaii (United States). + /// + internal static string Hawaii__United_States_ { + get { + return ResourceManager.GetString("Hawaii (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hawaii–Aleutian Daylight Time. + /// + internal static string Hawaii_Aleutian_Daylight_Time { + get { + return ResourceManager.GetString("Hawaii_Aleutian Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hawaii–Aleutian Standard Time. + /// + internal static string Hawaii_Aleutian_Standard_Time { + get { + return ResourceManager.GetString("Hawaii_Aleutian Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hawaii–Aleutian Time Zone. + /// + internal static string Hawaii_Aleutian_Time_Zone { + get { + return ResourceManager.GetString("Hawaii_Aleutian Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Heure Avancée d'Europe Centrale. + /// + internal static string Heure_Avancée_d_Europe_Centrale { + get { + return ResourceManager.GetString("Heure Avancée d\'Europe Centrale", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Honduras. + /// + internal static string Honduras { + get { + return ResourceManager.GetString("Honduras", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Howland Island. + /// + internal static string Howland_Island { + get { + return ResourceManager.GetString("Howland Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hungary. + /// + internal static string Hungary { + get { + return ResourceManager.GetString("Hungary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Iceland. + /// + internal static string Iceland { + get { + return ResourceManager.GetString("Iceland", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Idaho (most, United States). + /// + internal static string Idaho__most__United_States_ { + get { + return ResourceManager.GetString("Idaho (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Idaho (north, United States). + /// + internal static string Idaho__north__United_States_ { + get { + return ResourceManager.GetString("Idaho (north, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illinois (United States). + /// + internal static string Illinois__United_States_ { + get { + return ResourceManager.GetString("Illinois (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Indian Ocean Time. + /// + internal static string Indian_Ocean_Time { + get { + return ResourceManager.GetString("Indian Ocean Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Indiana (most, United States). + /// + internal static string Indiana__most__United_States_ { + get { + return ResourceManager.GetString("Indiana (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to International Date Line West time zone. + /// + internal static string International_Date_Line_West_time_zone { + get { + return ResourceManager.GetString("International Date Line West time zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Iowa (United States). + /// + internal static string Iowa__United_States_ { + get { + return ResourceManager.GetString("Iowa (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Iran. + /// + internal static string Iran { + get { + return ResourceManager.GetString("Iran", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Iran Daylight Time. + /// + internal static string Iran_Daylight_Time { + get { + return ResourceManager.GetString("Iran Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Iran Standard Time. + /// + internal static string Iran_Standard_Time { + get { + return ResourceManager.GetString("Iran Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Iraq. + /// + internal static string Iraq { + get { + return ResourceManager.GetString("Iraq", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ireland. + /// + internal static string Ireland { + get { + return ResourceManager.GetString("Ireland", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Irish Standard Time. + /// + internal static string Irish_Standard_Time { + get { + return ResourceManager.GetString("Irish Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Islands of Four Mountains (United States). + /// + internal static string Islands_of_Four_Mountains__United_States_ { + get { + return ResourceManager.GetString("Islands of Four Mountains (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Isle of Man. + /// + internal static string Isle_of_Man { + get { + return ResourceManager.GetString("Isle of Man", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Israel. + /// + internal static string Israel { + get { + return ResourceManager.GetString("Israel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Israel Daylight Time. + /// + internal static string Israel_Daylight_Time { + get { + return ResourceManager.GetString("Israel Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Israel Standard Time. + /// + internal static string Israel_Standard_Time { + get { + return ResourceManager.GetString("Israel Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Italy. + /// + internal static string Italy { + get { + return ResourceManager.GetString("Italy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ittoqqortoormiit (Greenland). + /// + internal static string Ittoqqortoormiit__Greenland_ { + get { + return ResourceManager.GetString("Ittoqqortoormiit (Greenland)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ivory Coast. + /// + internal static string Ivory_Coast { + get { + return ResourceManager.GetString("Ivory Coast", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Jamaica. + /// + internal static string Jamaica { + get { + return ResourceManager.GetString("Jamaica", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Jarvis Island. + /// + internal static string Jarvis_Island { + get { + return ResourceManager.GetString("Jarvis Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Jersey. + /// + internal static string Jersey { + get { + return ResourceManager.GetString("Jersey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Johnston Atoll. + /// + internal static string Johnston_Atoll { + get { + return ResourceManager.GetString("Johnston Atoll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Jordan. + /// + internal static string Jordan { + get { + return ResourceManager.GetString("Jordan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kaliningrad (Russia). + /// + internal static string Kaliningrad__Russia_ { + get { + return ResourceManager.GetString("Kaliningrad (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kaliningrad Time. + /// + internal static string Kaliningrad_Time { + get { + return ResourceManager.GetString("Kaliningrad Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kansas (most, United States). + /// + internal static string Kansas__most__United_States_ { + get { + return ResourceManager.GetString("Kansas (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kentucky (most, United States). + /// + internal static string Kentucky__most__United_States_ { + get { + return ResourceManager.GetString("Kentucky (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kenya. + /// + internal static string Kenya { + get { + return ResourceManager.GetString("Kenya", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kingman Reef. + /// + internal static string Kingman_Reef { + get { + return ResourceManager.GetString("Kingman Reef", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kinshasa (Democratic Republic of the Congo). + /// + internal static string Kinshasa__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Kinshasa (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kongo Central (Democratic Republic of the Congo). + /// + internal static string Kongo_Central__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Kongo Central (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kosovo. + /// + internal static string Kosovo { + get { + return ResourceManager.GetString("Kosovo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kuwait. + /// + internal static string Kuwait { + get { + return ResourceManager.GetString("Kuwait", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kwango (Democratic Republic of the Congo). + /// + internal static string Kwango__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Kwango (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kwilu (Democratic Republic of the Congo). + /// + internal static string Kwilu__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Kwilu (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Labrador (most, Canada). + /// + internal static string Labrador__most__Canada_ { + get { + return ResourceManager.GetString("Labrador (most, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Labrador (southeast, Canada). + /// + internal static string Labrador__southeast__Canada_ { + get { + return ResourceManager.GetString("Labrador (southeast, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Latvia. + /// + internal static string Latvia { + get { + return ResourceManager.GetString("Latvia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lebanon. + /// + internal static string Lebanon { + get { + return ResourceManager.GetString("Lebanon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lesotho. + /// + internal static string Lesotho { + get { + return ResourceManager.GetString("Lesotho", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Liberia. + /// + internal static string Liberia { + get { + return ResourceManager.GetString("Liberia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Libya. + /// + internal static string Libya { + get { + return ResourceManager.GetString("Libya", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Liechtenstein. + /// + internal static string Liechtenstein { + get { + return ResourceManager.GetString("Liechtenstein", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lithuania. + /// + internal static string Lithuania { + get { + return ResourceManager.GetString("Lithuania", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Louisiana (United States). + /// + internal static string Louisiana__United_States_ { + get { + return ResourceManager.GetString("Louisiana (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Luhansk PR. + /// + internal static string Luhansk_PR { + get { + return ResourceManager.GetString("Luhansk PR", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Luxembourg. + /// + internal static string Luxembourg { + get { + return ResourceManager.GetString("Luxembourg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Madagascar. + /// + internal static string Madagascar { + get { + return ResourceManager.GetString("Madagascar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Magallanes (Chile). + /// + internal static string Magallanes__Chile_ { + get { + return ResourceManager.GetString("Magallanes (Chile)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mai-Ndombe (Democratic Republic of the Congo). + /// + internal static string Mai_Ndombe__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Mai-Ndombe (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maine (United States). + /// + internal static string Maine__United_States_ { + get { + return ResourceManager.GetString("Maine (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Malawi. + /// + internal static string Malawi { + get { + return ResourceManager.GetString("Malawi", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mali. + /// + internal static string Mali { + get { + return ResourceManager.GetString("Mali", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Malta. + /// + internal static string Malta { + get { + return ResourceManager.GetString("Malta", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Manitoba (Canada). + /// + internal static string Manitoba__Canada_ { + get { + return ResourceManager.GetString("Manitoba (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Marquesas Islands (French Polynesia). + /// + internal static string Marquesas_Islands__French_Polynesia_ { + get { + return ResourceManager.GetString("Marquesas Islands (French Polynesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Marquesas Islands Time. + /// + internal static string Marquesas_Islands_Time { + get { + return ResourceManager.GetString("Marquesas Islands Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Martinique. + /// + internal static string Martinique { + get { + return ResourceManager.GetString("Martinique", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maryland (United States). + /// + internal static string Maryland__United_States_ { + get { + return ResourceManager.GetString("Maryland (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Massachusetts. + /// + internal static string Massachusetts { + get { + return ResourceManager.GetString("Massachusetts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mato Grosso (Brazil). + /// + internal static string Mato_Grosso__Brazil_ { + get { + return ResourceManager.GetString("Mato Grosso (Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mato Grosso do Sul (Brazil). + /// + internal static string Mato_Grosso_do_Sul__Brazil_ { + get { + return ResourceManager.GetString("Mato Grosso do Sul (Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mauritania. + /// + internal static string Mauritania { + get { + return ResourceManager.GetString("Mauritania", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mayotte. + /// + internal static string Mayotte { + get { + return ResourceManager.GetString("Mayotte", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mexico (most). + /// + internal static string Mexico__most_ { + get { + return ResourceManager.GetString("Mexico (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Michigan (most, United States). + /// + internal static string Michigan__most__United_States_ { + get { + return ResourceManager.GetString("Michigan (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Middle European Summer Time. + /// + internal static string Middle_European_Summer_Time { + get { + return ResourceManager.GetString("Middle European Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Middle European Time. + /// + internal static string Middle_European_Time { + get { + return ResourceManager.GetString("Middle European Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Midway Atoll. + /// + internal static string Midway_Atoll { + get { + return ResourceManager.GetString("Midway Atoll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Minnesota (United States). + /// + internal static string Minnesota__United_States_ { + get { + return ResourceManager.GetString("Minnesota (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mishkeegogamang (Canada). + /// + internal static string Mishkeegogamang__Canada_ { + get { + return ResourceManager.GetString("Mishkeegogamang (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mississippi (United States). + /// + internal static string Mississippi__United_States_ { + get { + return ResourceManager.GetString("Mississippi (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missouri (United States). + /// + internal static string Missouri__United_States_ { + get { + return ResourceManager.GetString("Missouri (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Moldova. + /// + internal static string Moldova { + get { + return ResourceManager.GetString("Moldova", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Monaco. + /// + internal static string Monaco { + get { + return ResourceManager.GetString("Monaco", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mongala (Democratic Republic of the Congo). + /// + internal static string Mongala__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Mongala (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Montana (United States). + /// + internal static string Montana__United_States_ { + get { + return ResourceManager.GetString("Montana (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Montenegro. + /// + internal static string Montenegro { + get { + return ResourceManager.GetString("Montenegro", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Montserrat. + /// + internal static string Montserrat { + get { + return ResourceManager.GetString("Montserrat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Morocco. + /// + internal static string Morocco { + get { + return ResourceManager.GetString("Morocco", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Moscow Time. + /// + internal static string Moscow_Time { + get { + return ResourceManager.GetString("Moscow Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mountain Daylight Time. + /// + internal static string Mountain_Daylight_Time { + get { + return ResourceManager.GetString("Mountain Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mountain Standard Time. + /// + internal static string Mountain_Standard_Time { + get { + return ResourceManager.GetString("Mountain Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mountain Time Zone. + /// + internal static string Mountain_Time_Zone { + get { + return ResourceManager.GetString("Mountain Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mozambique. + /// + internal static string Mozambique { + get { + return ResourceManager.GetString("Mozambique", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Names. + /// + internal static string Names { + get { + return ResourceManager.GetString("Names", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Namibia. + /// + internal static string Namibia { + get { + return ResourceManager.GetString("Namibia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Navassa Island. + /// + internal static string Navassa_Island { + get { + return ResourceManager.GetString("Navassa Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nayarit (most, Mexico). + /// + internal static string Nayarit__most__Mexico_ { + get { + return ResourceManager.GetString("Nayarit (most, Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Near Islands (United States). + /// + internal static string Near_Islands__United_States_ { + get { + return ResourceManager.GetString("Near Islands (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nebraska (most, United States). + /// + internal static string Nebraska__most__United_States_ { + get { + return ResourceManager.GetString("Nebraska (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Netherlands (European). + /// + internal static string Netherlands__European_ { + get { + return ResourceManager.GetString("Netherlands (European)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nevada (United States). + /// + internal static string Nevada__United_States_ { + get { + return ResourceManager.GetString("Nevada (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Brunswick (Canada). + /// + internal static string New_Brunswick__Canada_ { + get { + return ResourceManager.GetString("New Brunswick (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Hampshire (United States). + /// + internal static string New_Hampshire__United_States_ { + get { + return ResourceManager.GetString("New Hampshire (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Jersey (United States). + /// + internal static string New_Jersey__United_States_ { + get { + return ResourceManager.GetString("New Jersey (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Mexico (United States). + /// + internal static string New_Mexico__United_States_ { + get { + return ResourceManager.GetString("New Mexico (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New York (United States). + /// + internal static string New_York__United_States_ { + get { + return ResourceManager.GetString("New York (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Newfoundland (Canada). + /// + internal static string Newfoundland__Canada_ { + get { + return ResourceManager.GetString("Newfoundland (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Newfoundland Daylight Time. + /// + internal static string Newfoundland_Daylight_Time { + get { + return ResourceManager.GetString("Newfoundland Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Newfoundland Standard Time. + /// + internal static string Newfoundland_Standard_Time { + get { + return ResourceManager.GetString("Newfoundland Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Newfoundland Time Zone. + /// + internal static string Newfoundland_Time_Zone { + get { + return ResourceManager.GetString("Newfoundland Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nicaragua. + /// + internal static string Nicaragua { + get { + return ResourceManager.GetString("Nicaragua", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Niger. + /// + internal static string Niger { + get { + return ResourceManager.GetString("Niger", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nigeria. + /// + internal static string Nigeria { + get { + return ResourceManager.GetString("Nigeria", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Niue. + /// + internal static string Niue { + get { + return ResourceManager.GetString("Niue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Niue Time. + /// + internal static string Niue_Time { + get { + return ResourceManager.GetString("Niue Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + internal static string No { + get { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nord-Ubangi (Democratic Republic of the Congo). + /// + internal static string Nord_Ubangi__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Nord-Ubangi (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Carolina (United States). + /// + internal static string North_Carolina__United_States_ { + get { + return ResourceManager.GetString("North Carolina (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Dakota (most, United States). + /// + internal static string North_Dakota__most__United_States_ { + get { + return ResourceManager.GetString("North Dakota (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Macedonia. + /// + internal static string North_Macedonia { + get { + return ResourceManager.GetString("North Macedonia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Northern Cyprus. + /// + internal static string Northern_Cyprus { + get { + return ResourceManager.GetString("Northern Cyprus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Northwest Territories (Canada). + /// + internal static string Northwest_Territories__Canada_ { + get { + return ResourceManager.GetString("Northwest Territories (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Norway. + /// + internal static string Norway { + get { + return ResourceManager.GetString("Norway", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nova Scotia (Canada). + /// + internal static string Nova_Scotia__Canada_ { + get { + return ResourceManager.GetString("Nova Scotia (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to November Time Zone. + /// + internal static string November_Time_Zone { + get { + return ResourceManager.GetString("November Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nunavut (central, Canada). + /// + internal static string Nunavut__central__Canada_ { + get { + return ResourceManager.GetString("Nunavut (central, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nunavut (east, Canada). + /// + internal static string Nunavut__east__Canada_ { + get { + return ResourceManager.GetString("Nunavut (east, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nunavut (west, Canada). + /// + internal static string Nunavut__west__Canada_ { + get { + return ResourceManager.GetString("Nunavut (west, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Offset. + /// + internal static string Offset { + get { + return ResourceManager.GetString("Offset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ohio (United States). + /// + internal static string Ohio__United_States_ { + get { + return ResourceManager.GetString("Ohio (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Oklahoma, United States. + /// + internal static string Oklahoma__United_States { + get { + return ResourceManager.GetString("Oklahoma, United States", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ontario (most, Canada). + /// + internal static string Ontario__most__Canada_ { + get { + return ResourceManager.GetString("Ontario (most, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ontario (west, Canada). + /// + internal static string Ontario__west__Canada_ { + get { + return ResourceManager.GetString("Ontario (west, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Oregon (most, United States). + /// + internal static string Oregon__most__United_States_ { + get { + return ResourceManager.GetString("Oregon (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Oscar Time Zone. + /// + internal static string Oscar_Time_Zone { + get { + return ResourceManager.GetString("Oscar Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pacific Daylight Time. + /// + internal static string Pacific_Daylight_Time { + get { + return ResourceManager.GetString("Pacific Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pacific Standard Time. + /// + internal static string Pacific_Standard_Time { + get { + return ResourceManager.GetString("Pacific Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pacific Time Zone. + /// + internal static string Pacific_Time_Zonev { + get { + return ResourceManager.GetString("Pacific Time Zonev", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Palestine. + /// + internal static string Palestine { + get { + return ResourceManager.GetString("Palestine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Palmyra Atoll. + /// + internal static string Palmyra_Atoll { + get { + return ResourceManager.GetString("Palmyra Atoll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Panama. + /// + internal static string Panama { + get { + return ResourceManager.GetString("Panama", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Papa Time Zone. + /// + internal static string Papa_Time_Zone { + get { + return ResourceManager.GetString("Papa Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paraguay. + /// + internal static string Paraguay { + get { + return ResourceManager.GetString("Paraguay", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paraguay Summer Time. + /// + internal static string Paraguay_Summer_Time { + get { + return ResourceManager.GetString("Paraguay Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paraguay Time. + /// + internal static string Paraguay_Time { + get { + return ResourceManager.GetString("Paraguay Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pennsylvania (United States). + /// + internal static string Pennsylvania__United_States_ { + get { + return ResourceManager.GetString("Pennsylvania (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Peru. + /// + internal static string Peru { + get { + return ResourceManager.GetString("Peru", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Peru Time. + /// + internal static string Peru_Time { + get { + return ResourceManager.GetString("Peru Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pitcairn Islands. + /// + internal static string Pitcairn_Islands { + get { + return ResourceManager.GetString("Pitcairn Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gets the the current time of a time zone. + /// + internal static string PluginDescription { + get { + return ResourceManager.GetString("PluginDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Time zone. + /// + internal static string PluginTitle { + get { + return ResourceManager.GetString("PluginTitle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Poland. + /// + internal static string Poland { + get { + return ResourceManager.GetString("Poland", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Portugal (most). + /// + internal static string Portugal__most_ { + get { + return ResourceManager.GetString("Portugal (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Prince Edward Island (Canada). + /// + internal static string Prince_Edward_Island__Canada_ { + get { + return ResourceManager.GetString("Prince Edward Island (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Prince Edward Islands (South Africa). + /// + internal static string Prince_Edward_Islands__South_Africa_ { + get { + return ResourceManager.GetString("Prince Edward Islands (South Africa)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Puerto Rico. + /// + internal static string Puerto_Rico { + get { + return ResourceManager.GetString("Puerto Rico", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Qatar. + /// + internal static string Qatar { + get { + return ResourceManager.GetString("Qatar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quebec (east, Canada). + /// + internal static string Quebec__east__Canada_ { + get { + return ResourceManager.GetString("Quebec (east, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quebec (most, Canada). + /// + internal static string Quebec__most__Canada_ { + get { + return ResourceManager.GetString("Quebec (most, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quebec Time Zone. + /// + internal static string Quebec_Time_Zone { + get { + return ResourceManager.GetString("Quebec Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quintana Roo (Mexico). + /// + internal static string Quintana_Roo__Mexico_ { + get { + return ResourceManager.GetString("Quintana Roo (Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rat Islands (Aleutian Islands, Alaska, United States). + /// + internal static string Rat_Islands__Aleutian_Islands__Alaska__United_States_ { + get { + return ResourceManager.GetString("Rat Islands (Aleutian Islands, Alaska, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rhode Island (United States). + /// + internal static string Rhode_Island__United_States_ { + get { + return ResourceManager.GetString("Rhode Island (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Romania. + /// + internal static string Romania { + get { + return ResourceManager.GetString("Romania", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Romeo Time Zone. + /// + internal static string Romeo_Time_Zone { + get { + return ResourceManager.GetString("Romeo Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rondônia (Brazil). + /// + internal static string Rondônia__Brazil_ { + get { + return ResourceManager.GetString("Rondônia (Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Roraima (Brazil). + /// + internal static string Roraima__Brazil_ { + get { + return ResourceManager.GetString("Roraima (Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rothera Research Station Time. + /// + internal static string Rothera_Research_Station_Time { + get { + return ResourceManager.GetString("Rothera Research Station Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Russia (most of European part). + /// + internal static string Russia__most_of_European_part_ { + get { + return ResourceManager.GetString("Russia (most of European part)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rwanda. + /// + internal static string Rwanda { + get { + return ResourceManager.GetString("Rwanda", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Barthélemy. + /// + internal static string Saint_Barthélemy { + get { + return ResourceManager.GetString("Saint Barthélemy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Helena. + /// + internal static string Saint_Helena { + get { + return ResourceManager.GetString("Saint Helena", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Kitts and Nevis. + /// + internal static string Saint_Kitts_and_Nevis { + get { + return ResourceManager.GetString("Saint Kitts and Nevis", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Lucia. + /// + internal static string Saint_Lucia { + get { + return ResourceManager.GetString("Saint Lucia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Martin. + /// + internal static string Saint_Martin { + get { + return ResourceManager.GetString("Saint Martin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Pierre and Miquelon. + /// + internal static string Saint_Pierre_and_Miquelon { + get { + return ResourceManager.GetString("Saint Pierre and Miquelon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Pierre and Miquelon Daylight Time. + /// + internal static string Saint_Pierre_and_Miquelon_Daylight_Time { + get { + return ResourceManager.GetString("Saint Pierre and Miquelon Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Pierre and Miquelon Standard Time. + /// + internal static string Saint_Pierre_and_Miquelon_Standard_Time { + get { + return ResourceManager.GetString("Saint Pierre and Miquelon Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saint Vincent and the Grenadines. + /// + internal static string Saint_Vincent_and_the_Grenadines { + get { + return ResourceManager.GetString("Saint Vincent and the Grenadines", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Samoa Standard Time. + /// + internal static string Samoa_Standard_Time { + get { + return ResourceManager.GetString("Samoa Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Samoa Time Zone. + /// + internal static string Samoa_Time_Zone { + get { + return ResourceManager.GetString("Samoa Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to San Marino. + /// + internal static string San_Marino { + get { + return ResourceManager.GetString("San Marino", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to São Tomé and Príncipe. + /// + internal static string São_Tomé_and_Príncipe { + get { + return ResourceManager.GetString("São Tomé and Príncipe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saskatchewan (most, Canada). + /// + internal static string Saskatchewan__most__Canada_ { + get { + return ResourceManager.GetString("Saskatchewan (most, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saudi Arabia. + /// + internal static string Saudi_Arabia { + get { + return ResourceManager.GetString("Saudi Arabia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scattered Islands (French Southern and Antarctic Lands). + /// + internal static string Scattered_Islands__French_Southern_and_Antarctic_Lands_ { + get { + return ResourceManager.GetString("Scattered Islands (French Southern and Antarctic Lands)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Senegal. + /// + internal static string Senegal { + get { + return ResourceManager.GetString("Senegal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Serbia. + /// + internal static string Serbia { + get { + return ResourceManager.GetString("Serbia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shortcuts. + /// + internal static string Shortcuts { + get { + return ResourceManager.GetString("Shortcuts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Showa Station Time. + /// + internal static string Showa_Station_Time { + get { + return ResourceManager.GetString("Showa Station Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show military time zone names. + /// + internal static string ShowMilitaryTimeZoneNames { + get { + return ResourceManager.GetString("ShowMilitaryTimeZoneNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show time names. + /// + internal static string ShowTimeNames { + get { + return ResourceManager.GetString("ShowTimeNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show time zone names. + /// + internal static string ShowTimeZoneNames { + get { + return ResourceManager.GetString("ShowTimeZoneNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sierra Leone. + /// + internal static string Sierra_Leone { + get { + return ResourceManager.GetString("Sierra Leone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sierra Time Zone. + /// + internal static string Sierra_Time_Zone { + get { + return ResourceManager.GetString("Sierra Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sinaloa (Mexico). + /// + internal static string Sinaloa__Mexico_ { + get { + return ResourceManager.GetString("Sinaloa (Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sint Maarten. + /// + internal static string Sint_Maarten { + get { + return ResourceManager.GetString("Sint Maarten", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Slovakia. + /// + internal static string Slovakia { + get { + return ResourceManager.GetString("Slovakia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Slovenia. + /// + internal static string Slovenia { + get { + return ResourceManager.GetString("Slovenia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Somalia. + /// + internal static string Somalia { + get { + return ResourceManager.GetString("Somalia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Somaliland. + /// + internal static string Somaliland { + get { + return ResourceManager.GetString("Somaliland", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sonora (Mexico). + /// + internal static string Sonora__Mexico_ { + get { + return ResourceManager.GetString("Sonora (Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to South Africa (most). + /// + internal static string South_Africa__most_ { + get { + return ResourceManager.GetString("South Africa (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to South African Standard Time. + /// + internal static string South_African_Standard_Time { + get { + return ResourceManager.GetString("South African Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to South Carolina (United States). + /// + internal static string South_Carolina__United_States_ { + get { + return ResourceManager.GetString("South Carolina (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to South Dakota (most, United States). + /// + internal static string South_Dakota__most__United_States_ { + get { + return ResourceManager.GetString("South Dakota (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to South Georgia and the South Sandwich Islands. + /// + internal static string South_Georgia_and_the_South_Sandwich_Islands { + get { + return ResourceManager.GetString("South Georgia and the South Sandwich Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to South Georgia and the South Sandwich Islands Time. + /// + internal static string South_Georgia_and_the_South_Sandwich_Islands_Time { + get { + return ResourceManager.GetString("South Georgia and the South Sandwich Islands Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to South Ossetia. + /// + internal static string South_Ossetia { + get { + return ResourceManager.GetString("South Ossetia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to South Sudan. + /// + internal static string South_Sudan { + get { + return ResourceManager.GetString("South Sudan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Southampton Island (Canada). + /// + internal static string Southampton_Island__Canada_ { + get { + return ResourceManager.GetString("Southampton Island (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Spain (most). + /// + internal static string Spain__most_ { + get { + return ResourceManager.GetString("Spain (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Standard Time. + /// + internal static string StandardTime { + get { + return ResourceManager.GetString("StandardTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ST. + /// + internal static string StandardTimeShortcut { + get { + return ResourceManager.GetString("StandardTimeShortcut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sud-Ubangi (Democratic Republic of the Congo). + /// + internal static string Sud_Ubangi__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Sud-Ubangi (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sudan. + /// + internal static string Sudan { + get { + return ResourceManager.GetString("Sudan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SuriName. + /// + internal static string SuriName { + get { + return ResourceManager.GetString("SuriName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Suriname Time. + /// + internal static string Suriname_Time { + get { + return ResourceManager.GetString("Suriname Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sweden. + /// + internal static string Sweden { + get { + return ResourceManager.GetString("Sweden", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Switzerland. + /// + internal static string Switzerland { + get { + return ResourceManager.GetString("Switzerland", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Syria. + /// + internal static string Syria { + get { + return ResourceManager.GetString("Syria", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tahiti Time. + /// + internal static string Tahiti_Time { + get { + return ResourceManager.GetString("Tahiti Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tango Time Zone. + /// + internal static string Tango_Time_Zone { get { - return ResourceManager.GetString("CopyTime", resourceCulture); + return ResourceManager.GetString("Tango Time Zone", resourceCulture); } } /// - /// Looks up a localized string similar to Countries. + /// Looks up a localized string similar to Tanzania. /// - internal static string Countries { + internal static string Tanzania { get { - return ResourceManager.GetString("Countries", resourceCulture); + return ResourceManager.GetString("Tanzania", resourceCulture); } } /// - /// Looks up a localized string similar to Countries with daylight saving time. + /// Looks up a localized string similar to Tennessee (most, United States). /// - internal static string CountriesWithDst { + internal static string Tennessee__most__United_States_ { get { - return ResourceManager.GetString("CountriesWithDst", resourceCulture); + return ResourceManager.GetString("Tennessee (most, United States)", resourceCulture); } } /// - /// Looks up a localized string similar to Daylight Time. + /// Looks up a localized string similar to Texas (most, United States). /// - internal static string DaylightTime { + internal static string Texas__most__United_States_ { get { - return ResourceManager.GetString("DaylightTime", resourceCulture); + return ResourceManager.GetString("Texas (most, United States)", resourceCulture); } } /// - /// Looks up a localized string similar to DT. + /// Looks up a localized string similar to Thule Air Base (Greenland). /// - internal static string DaylightTimeShortcut { + internal static string Thule_Air_Base__Greenland_ { get { - return ResourceManager.GetString("DaylightTimeShortcut", resourceCulture); + return ResourceManager.GetString("Thule Air Base (Greenland)", resourceCulture); } } /// - /// Looks up a localized string similar to Names. + /// Looks up a localized string similar to Time. /// - internal static string Names { + internal static string Time { get { - return ResourceManager.GetString("Names", resourceCulture); + return ResourceManager.GetString("Time", resourceCulture); } } /// - /// Looks up a localized string similar to No. + /// Looks up a localized string similar to T. /// - internal static string No { + internal static string TimeShortcut { get { - return ResourceManager.GetString("No", resourceCulture); + return ResourceManager.GetString("TimeShortcut", resourceCulture); } } /// - /// Looks up a localized string similar to Offset. + /// Looks up a localized string similar to Time Zone. /// - internal static string Offset { + internal static string TimeZone { get { - return ResourceManager.GetString("Offset", resourceCulture); + return ResourceManager.GetString("TimeZone", resourceCulture); } } /// - /// Looks up a localized string similar to Gets the the current time of a time zone. + /// Looks up a localized string similar to TZ. /// - internal static string PluginDescription { + internal static string TimeZoneShortcut { get { - return ResourceManager.GetString("PluginDescription", resourceCulture); + return ResourceManager.GetString("TimeZoneShortcut", resourceCulture); } } /// - /// Looks up a localized string similar to Time zone. + /// Looks up a localized string similar to Togo. /// - internal static string PluginTitle { + internal static string Togo { get { - return ResourceManager.GetString("PluginTitle", resourceCulture); + return ResourceManager.GetString("Togo", resourceCulture); } } /// - /// Looks up a localized string similar to Shortcuts. + /// Looks up a localized string similar to Transnistria. /// - internal static string Shortcuts { + internal static string Transnistria { get { - return ResourceManager.GetString("Shortcuts", resourceCulture); + return ResourceManager.GetString("Transnistria", resourceCulture); } } /// - /// Looks up a localized string similar to Show military time zone names. + /// Looks up a localized string similar to Trinidad and Tobago. /// - internal static string ShowMilitaryTimeZoneNames { + internal static string Trinidad_and_Tobago { get { - return ResourceManager.GetString("ShowMilitaryTimeZoneNames", resourceCulture); + return ResourceManager.GetString("Trinidad and Tobago", resourceCulture); } } /// - /// Looks up a localized string similar to Show time names. + /// Looks up a localized string similar to Tshuapa (Democratic Republic of the Congo). /// - internal static string ShowTimeNames { + internal static string Tshuapa__Democratic_Republic_of_the_Congo_ { get { - return ResourceManager.GetString("ShowTimeNames", resourceCulture); + return ResourceManager.GetString("Tshuapa (Democratic Republic of the Congo)", resourceCulture); } } /// - /// Looks up a localized string similar to Show time zone names. + /// Looks up a localized string similar to Tunisia. /// - internal static string ShowTimeZoneNames { + internal static string Tunisia { get { - return ResourceManager.GetString("ShowTimeZoneNames", resourceCulture); + return ResourceManager.GetString("Tunisia", resourceCulture); } } /// - /// Looks up a localized string similar to Standard Time. + /// Looks up a localized string similar to Turkey. /// - internal static string StandardTime { + internal static string Turkey { get { - return ResourceManager.GetString("StandardTime", resourceCulture); + return ResourceManager.GetString("Turkey", resourceCulture); } } /// - /// Looks up a localized string similar to ST. + /// Looks up a localized string similar to Turkey Time. /// - internal static string StandardTimeShortcut { + internal static string Turkey_Time { get { - return ResourceManager.GetString("StandardTimeShortcut", resourceCulture); + return ResourceManager.GetString("Turkey Time", resourceCulture); } } /// - /// Looks up a localized string similar to Time. + /// Looks up a localized string similar to Turks and Caicos Islands. /// - internal static string Time { + internal static string Turks_and_Caicos_Islands { get { - return ResourceManager.GetString("Time", resourceCulture); + return ResourceManager.GetString("Turks and Caicos Islands", resourceCulture); } } /// - /// Looks up a localized string similar to T. + /// Looks up a localized string similar to U.S. Virgin Islands. /// - internal static string TimeShortcut { + internal static string U_S__Virgin_Islands { get { - return ResourceManager.GetString("TimeShortcut", resourceCulture); + return ResourceManager.GetString("U.S. Virgin Islands", resourceCulture); } } /// - /// Looks up a localized string similar to Time Zone. + /// Looks up a localized string similar to Uganda. /// - internal static string TimeZone { + internal static string Uganda { get { - return ResourceManager.GetString("TimeZone", resourceCulture); + return ResourceManager.GetString("Uganda", resourceCulture); } } /// - /// Looks up a localized string similar to TZ. + /// Looks up a localized string similar to Uniform Time Zone. /// - internal static string TimeZoneShortcut { + internal static string Uniform_Time_Zone { get { - return ResourceManager.GetString("TimeZoneShortcut", resourceCulture); + return ResourceManager.GetString("Uniform Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to United Kingdom. + /// + internal static string United_Kingdom { + get { + return ResourceManager.GetString("United Kingdom", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uruguay. + /// + internal static string Uruguay { + get { + return ResourceManager.GetString("Uruguay", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uruguay Standard Time. + /// + internal static string Uruguay_Standard_Time { + get { + return ResourceManager.GetString("Uruguay Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uruguay Summer Time. + /// + internal static string Uruguay_Summer_Time { + get { + return ResourceManager.GetString("Uruguay Summer Time", resourceCulture); } } @@ -249,6 +3885,15 @@ internal static string UseDst { } } + /// + /// Looks up a localized string similar to Utah (United States). + /// + internal static string Utah__United_States_ { + get { + return ResourceManager.GetString("Utah (United States)", resourceCulture); + } + } + /// /// Looks up a localized string similar to UTC. /// @@ -258,6 +3903,195 @@ internal static string UTC { } } + /// + /// Looks up a localized string similar to Vatican City. + /// + internal static string Vatican_City { + get { + return ResourceManager.GetString("Vatican City", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Venezuela. + /// + internal static string Venezuela { + get { + return ResourceManager.GetString("Venezuela", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Venezuelan Standard Time. + /// + internal static string Venezuelan_Standard_Time { + get { + return ResourceManager.GetString("Venezuelan Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vermont (United States). + /// + internal static string Vermont__United_States_ { + get { + return ResourceManager.GetString("Vermont (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Victor Time Zone. + /// + internal static string Victor_Time_Zone { + get { + return ResourceManager.GetString("Victor Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Virginia (United States). + /// + internal static string Virginia__United_States_ { + get { + return ResourceManager.GetString("Virginia (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Washington (United States). + /// + internal static string Washington__United_States_ { + get { + return ResourceManager.GetString("Washington (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to West Africa Summer Time. + /// + internal static string West_Africa_Summer_Time { + get { + return ResourceManager.GetString("West Africa Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to West Africa Time. + /// + internal static string West_Africa_Time { + get { + return ResourceManager.GetString("West Africa Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to West Greenland Summer Time. + /// + internal static string West_Greenland_Summer_Time { + get { + return ResourceManager.GetString("West Greenland Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to West Greenland Time. + /// + internal static string West_Greenland_Time { + get { + return ResourceManager.GetString("West Greenland Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to West Virginia (United States). + /// + internal static string West_Virginia__United_States_ { + get { + return ResourceManager.GetString("West Virginia (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Weste. + /// + internal static string Weste { + get { + return ResourceManager.GetString("Weste", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Western European Summer Time. + /// + internal static string Western_European_Summer_Time { + get { + return ResourceManager.GetString("Western European Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Western European Time. + /// + internal static string Western_European_Time { + get { + return ResourceManager.GetString("Western European Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Whiskey Time Zone. + /// + internal static string Whiskey_Time_Zone { + get { + return ResourceManager.GetString("Whiskey Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wisconsin (United States). + /// + internal static string Wisconsin__United_States_ { + get { + return ResourceManager.GetString("Wisconsin (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wyoming (United States). + /// + internal static string Wyoming__United_States_ { + get { + return ResourceManager.GetString("Wyoming (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to X-ray Time Zone. + /// + internal static string X_ray_Time_Zone { + get { + return ResourceManager.GetString("X-ray Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yankee Time Zone. + /// + internal static string Yankee_Time_Zone { + get { + return ResourceManager.GetString("Yankee Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yemen. + /// + internal static string Yemen { + get { + return ResourceManager.GetString("Yemen", resourceCulture); + } + } + /// /// Looks up a localized string similar to Yes. /// @@ -266,5 +4100,41 @@ internal static string Yes { return ResourceManager.GetString("Yes", resourceCulture); } } + + /// + /// Looks up a localized string similar to Yukon (Canada). + /// + internal static string Yukon__Canada_ { + get { + return ResourceManager.GetString("Yukon (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zambia. + /// + internal static string Zambia { + get { + return ResourceManager.GetString("Zambia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zimbabwe. + /// + internal static string Zimbabwe { + get { + return ResourceManager.GetString("Zimbabwe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zulu Time Zone. + /// + internal static string Zulu_Time_Zone { + get { + return ResourceManager.GetString("Zulu Time Zone", resourceCulture); + } + } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index 8476bd7554b..fb1cb501609 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -117,15 +117,330 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Abkhazia + + + Acre (Brazil) + + + Acre Time + + + Akrotiri and Dhekelia + + + Alabama (United States) + + + Alaska (most, United States) + + + Alaska Daylight Time + + + Alaska Standard Time + + + Alaska Time Zone + + + Albania + + + Alberta (Canada) + + + Algeria + + + Alpha Time Zone + Military time zone name + + + Amazon Summer Time + + + Amazon Time + + + Amazonas (most, Brazil) + + + American Samoa + + + Andorra + + + Andreanof Islands (United States) + + + Angola + + + Anguilla + + + Antigua and Barbuda + + + Arabia Standard Time + + + Argentina + + + Argentina Time + + + Arizona (most, United States) + + + Arkansas (United States) + + + Aruba + + + Ascension and Tristan da Cunha + + + Atikokan (Canada) + + + Atlantic Daylight Time + + + Atlantic Standard Time + + + Atlantic Time Zone + + + Austria + + + Azores (Portugal) + + + Azores Standard Time + + + Azores Summer Time + + + Bahamas + + + Bahrain + + + Baja California (Mexico) + + + Baja California Sur (Mexico) + + + Baker Island + + + Baker Island Time + + + Barbados + + + Belarus + + + Belgium + + + Belize + + + Benin + + + Bermuda + + + Bolivia + + + Bolivia Time + + + Bosnia and Herzegovina + + + Botswana + + + Brasília Summer Time + + + Brasília Time + + + Bravo Time Zone + Military time zone name + + + Brazil (most) + + + British Columbia (most, Canada) + + + British Columbia (northeast, Canada) + + + British Columbia (southeast, Canada) + + + British Summer Time + + + British Virgin Islands + + + Bulgaria + + + Burkina Faso + + + Burundi + + + California (United States) + + + Cameroon + + + Canary Islands + + + Cape Verde + + + Cape Verde Time + + + Caribbean Netherlands + + + Cayman Islands + + + Central Africa Time + + + Central African Republic + + + Central Daylight Time + + + Central European Summer Time + + + Central European Time + + + Central Standard Time + + + Central Time Zone + + + Chad + + + Charlie Time Zone + Military time zone name + + + Chihuahua (Mexico) + + + Chile (most) + + + Chile Summer Time + + + Clipperton Island + + + Colombia + + + Colombia Summer Time + + + Colombia Time + + + Colorado (United States) + + + Comoros + + + Congo + + + Connecticut (United States) + + + Cook Islands + + + Coordinated Universal Time + Copy time + + Costa Rica + Countries Countries with daylight saving time + + Crimea + + + Croatia + + + Cuba + + + Cuba Daylight Time + + + Cuba Standard Time + + + Curaçao + + + Cyprus + + + Czech Republic + + + Danmarkshavn + Daylight Time @@ -133,24 +448,782 @@ DT Short for "Daylight Time" + + Delaware (United States) + + + Democratic Republic of the Congo (most) + + + Denmark + + + District of Columbia (United States) + + + Djibouti + + + Dominica + + + Dominican Republic + + + Donetsk PR + + + East Africa Time + + + Easter Island (Chile) + + + Easter Island Standard Time + + + Easter Island Summer Time + + + Eastern Caribbean Time + + + Eastern Daylight Time + + + Eastern European Summer Time + + + Eastern European Time + + + Eastern Greenland Summer Time + + + Eastern Greenland Time + + + Eastern Standard Time + + + Eastern Time Zone + + + Ecuador (most) + + + Ecuador Time + + + Ecuador: Galápagos + + + Egypt + + + El Salvador + + + Equatorial Guinea + + + Eritrea + + + Estonia + + + Eswatini + + + Ethiopia + + + Falkland Islands + + + Falkland Islands Summer Time + + + Falkland Islands Time + + + Faroe Islands + + + Fernando de Noronha (Brazil) + + + Fernando de Noronha Time + + + Finland + + + Florida (most, United States) + + + France (metropolitan) + + + French Guiana + + + French Guiana Time + + + French Polynesia (most) + + + Further-eastern European Time + + + Gabon + + + Galápagos Time + + + Gambia + + + Gambier Islands (French Polynesia) + + + Gambier Islands Time + + + Georgia (United States) + + + Germany + + + Ghana + + + Gibraltar + + + Greece + + + Greenland (most) + + + Greenwich Mean Time + + + Grenada + + + Guadeloupe + + + Guatemala + + + Guernsey + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Guyana Time + + + Haiti + + + Hawaii (United States) + + + Hawaii–Aleutian Daylight Time + + + Hawaii–Aleutian Standard Time + + + Hawaii–Aleutian Time Zone + + + Heure Avancée d'Europe Centrale + + + Honduras + + + Howland Island + + + Hungary + + + Iceland + + + Idaho (most, United States) + + + Idaho (north, United States) + + + Illinois (United States) + + + Indian Ocean Time + + + Indiana (most, United States) + + + International Date Line West time zone + + + Iowa (United States) + + + Iran + + + Iran Daylight Time + + + Iran Standard Time + + + Iraq + + + Ireland + + + Irish Standard Time + + + Islands of Four Mountains (United States) + + + Isle of Man + + + Israel + + + Israel Daylight Time + + + Israel Standard Time + + + Italy + + + Ittoqqortoormiit (Greenland) + + + Ivory Coast + + + Jamaica + + + Jarvis Island + + + Jersey + + + Johnston Atoll + + + Jordan + + + Kaliningrad (Russia) + + + Kaliningrad Time + + + Kansas (most, United States) + + + Kentucky (most, United States) + + + Kenya + + + Kingman Reef + + + Kinshasa (Democratic Republic of the Congo) + + + Kongo Central (Democratic Republic of the Congo) + + + Kosovo + + + Kuwait + + + Kwango (Democratic Republic of the Congo) + + + Kwilu (Democratic Republic of the Congo) + + + Labrador (most, Canada) + + + Labrador (southeast, Canada) + + + Latvia + + + Lebanon + + + Lesotho + + + Liberia + + + Libya + + + Liechtenstein + + + Lithuania + + + Louisiana (United States) + + + Luhansk PR + + + Luxembourg + + + Madagascar + + + Magallanes (Chile) + + + Mai-Ndombe (Democratic Republic of the Congo) + + + Maine (United States) + + + Malawi + + + Mali + + + Malta + + + Manitoba (Canada) + + + Marquesas Islands (French Polynesia) + + + Marquesas Islands Time + + + Martinique + + + Maryland (United States) + + + Massachusetts + + + Mato Grosso (Brazil) + + + Mato Grosso do Sul (Brazil) + + + Mauritania + + + Mayotte + + + Mexico (most) + + + Michigan (most, United States) + + + Middle European Summer Time + + + Middle European Time + + + Midway Atoll + + + Minnesota (United States) + + + Mishkeegogamang (Canada) + + + Mississippi (United States) + + + Missouri (United States) + + + Moldova + + + Monaco + + + Mongala (Democratic Republic of the Congo) + + + Montana (United States) + + + Montenegro + + + Montserrat + + + Morocco + + + Moscow Time + + + Mountain Daylight Time + + + Mountain Standard Time + + + Mountain Time Zone + + + Mozambique + Names + + Namibia + + + Navassa Island + + + Nayarit (most, Mexico) + + + Near Islands (United States) + + + Nebraska (most, United States) + + + Netherlands (European) + + + Nevada (United States) + + + New Brunswick (Canada) + + + New Hampshire (United States) + + + New Jersey (United States) + + + New Mexico (United States) + + + New York (United States) + + + Newfoundland (Canada) + + + Newfoundland Daylight Time + + + Newfoundland Standard Time + + + Newfoundland Time Zone + + + Nicaragua + + + Niger + + + Nigeria + + + Niue + + + Niue Time + No + + Nord-Ubangi (Democratic Republic of the Congo) + + + North Carolina (United States) + + + North Dakota (most, United States) + + + North Macedonia + + + Northern Cyprus + + + Northwest Territories (Canada) + + + Norway + + + Nova Scotia (Canada) + + + November Time Zone + Military time zone name + + + Nunavut (central, Canada) + + + Nunavut (east, Canada) + + + Nunavut (west, Canada) + Offset + + Ohio (United States) + + + Oklahoma, United States + + + Ontario (most, Canada) + + + Ontario (west, Canada) + + + Oregon (most, United States) + + + Oscar Time Zone + Military time zone name + + + Pacific Daylight Time + + + Pacific Standard Time + + + Pacific Time Zone + + + Palestine + + + Palmyra Atoll + + + Panama + + + Papa Time Zone + Military time zone name + + + Paraguay + + + Paraguay Summer Time + + + Paraguay Time + + + Pennsylvania (United States) + + + Peru + + + Peru Time + + + Pitcairn Islands + Gets the the current time of a time zone Time zone + + Poland + + + Portugal (most) + + + Prince Edward Island (Canada) + + + Prince Edward Islands (South Africa) + + + Puerto Rico + + + Qatar + + + Quebec (east, Canada) + + + Quebec (most, Canada) + + + Quebec Time Zone + Military time zone name + + + Quintana Roo (Mexico) + + + Rat Islands (Aleutian Islands, Alaska, United States) + + + Rhode Island (United States) + + + Romania + + + Romeo Time Zone + Military time zone name + + + Rondônia (Brazil) + + + Roraima (Brazil) + + + Rothera Research Station Time + + + Russia (most of European part) + + + Rwanda + + + Saint Barthélemy + + + Saint Helena + + + Saint Kitts and Nevis + + + Saint Lucia + + + Saint Martin + + + Saint Pierre and Miquelon + + + Saint Pierre and Miquelon Daylight Time + + + Saint Pierre and Miquelon Standard Time + + + Saint Vincent and the Grenadines + + + Samoa Standard Time + + + Samoa Time Zone + + + San Marino + + + Saskatchewan (most, Canada) + + + Saudi Arabia + + + Scattered Islands (French Southern and Antarctic Lands) + + + Senegal + + + Serbia + Shortcuts + + Showa Station Time + Show military time zone names PowerToysRun Option @@ -163,6 +1236,64 @@ Show time zone names PowerToysRun Option + + Sierra Leone + + + Sierra Time Zone + Military time zone name + + + Sinaloa (Mexico) + + + Sint Maarten + + + Slovakia + + + Slovenia + + + Somalia + + + Somaliland + + + Sonora (Mexico) + + + South Africa (most) + + + South African Standard Time + + + South Carolina (United States) + + + South Dakota (most, United States) + + + South Georgia and the South Sandwich Islands + + + South Georgia and the South Sandwich Islands Time + + + South Ossetia + + + South Sudan + + + Southampton Island (Canada) + + + Spain (most) + Standard Time @@ -170,6 +1301,49 @@ ST Short for "Standard Time" + + Sud-Ubangi (Democratic Republic of the Congo) + + + Sudan + + + SuriName + + + Suriname Time + + + Sweden + + + Switzerland + + + Syria + + + São Tomé and Príncipe + + + Tahiti Time + + + Tango Time Zone + Military time zone name + + + Tanzania + + + Tennessee (most, United States) + + + Texas (most, United States) + + + Thule Air Base (Greenland) + Time @@ -184,14 +1358,146 @@ TZ Short for "Time Zone" + + Togo + + + Transnistria + + + Trinidad and Tobago + + + Tshuapa (Democratic Republic of the Congo) + + + Tunisia + + + Turkey + + + Turkey Time + + + Turks and Caicos Islands + + + U.S. Virgin Islands + + + Uganda + + + Uniform Time Zone + Military time zone name + + + United Kingdom + + + Uruguay + + + Uruguay Standard Time + + + Uruguay Summer Time + Use daylight saving time + + Utah (United States) + UTC Short for "Coordinated Universal Time" + + Vatican City + + + Venezuela + + + Venezuelan Standard Time + + + Vermont (United States) + + + Victor Time Zone + Military time zone name + + + Virginia (United States) + + + Washington (United States) + + + West Africa Summer Time + + + West Africa Time + + + West Greenland Summer Time + + + West Greenland Time + + + West Virginia (United States) + + + Weste + + + Western European Summer Time + + + Western European Time + + + Whiskey Time Zone + Military time zone name + + + Wisconsin (United States) + + + Wyoming (United States) + + + X-ray Time Zone + Military time zone name + + + Yankee Time Zone + Military time zone name + + + Yemen + Yes + + Yukon (Canada) + + + Zambia + + + Zimbabwe + + + Zulu Time Zone + Military time zone name + + + Équateur (Democratic Republic of the Congo) + \ No newline at end of file diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 400995b34b0..8b2b2f6cf10 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -50,10 +50,10 @@ }, { "Offset": "-10:00", - "Name": "Hawaii–Aleutian Time Zone", + "Name": "Hawaii_Aleutian Time Zone", "MilitaryName": "Whiskey Time Zone", "TimeNamesStandard": [ - "Hawaii–Aleutian Standard Time", + "Hawaii_Aleutian Standard Time", "Tahiti Time" ], "ShortcutsStandard": [ @@ -301,14 +301,14 @@ "Connecticut (United States)", "Delaware (United States)", "District of Columbia (United States)", - "Florida (most, United States))", + "Florida (most, United States)", "Georgia (United States)", - "Indiana (most, United States))", - "Kentucky (most, United States))", + "Indiana (most, United States)", + "Kentucky (most, United States)", "Maine (United States)", "Maryland (United States)", "Massachusetts", - "Michigan (most, United States))", + "Michigan (most, United States)", "New Hampshire (United States)", "New Jersey (United States)", "New York (United States)", From 80bb87e76544787610d51e1932f90c946935d7c4 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Mon, 10 Jan 2022 09:23:31 +0100 Subject: [PATCH 45/67] Make all translatable (part 2 of 2) --- .../Helper/ResultHelper.cs | 1 - .../Helper/TranslationHelper.cs | 10 +- .../Properties/Resources.Designer.cs | 3783 ++++++++++++++--- .../Properties/Resources.resx | 858 +++- .../timezones.json | 6 +- 5 files changed, 4007 insertions(+), 651 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 6270ebcd3d2..1d546f4b0a1 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -13,7 +13,6 @@ using Mono.Collections.Generic; using Wox.Plugin; -// TODO: translate (part 2, UTC+4:00) // FIXME: sometimes daylight countries in tool tips are empty // TODO: revisited time zone names (use German Wikipedia sites as second reference) // TODO: revisited countries (use German Wikipedia sites as second reference) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/TranslationHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/TranslationHelper.cs index e5a395ec4f8..fa46d4ee978 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/TranslationHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/TranslationHelper.cs @@ -43,7 +43,7 @@ internal static void TranslateAllSettings(in TimeZoneList timeZoneList) // Translate MilitaryName if (!string.IsNullOrWhiteSpace(timeZone.MilitaryName)) { - var militaryName = Resources.ResourceManager.GetString(timeZone.MilitaryName, CultureInfo.CurrentCulture); + var militaryName = Resources.ResourceManager.GetString(timeZone.MilitaryName, CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(militaryName)) { Log.Warn($"Resource string for [{timeZone.MilitaryName}] not found", typeof(TranslationHelper)); @@ -59,7 +59,7 @@ internal static void TranslateAllSettings(in TimeZoneList timeZoneList) foreach (var nameDaylight in timeZone.TimeNamesDaylight) { - var nameDaylightT = Resources.ResourceManager.GetString(nameDaylight, CultureInfo.CurrentCulture); + var nameDaylightT = Resources.ResourceManager.GetString(nameDaylight, CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(nameDaylightT)) { Log.Warn($"Resource string for [{nameDaylight}] not found", typeof(TranslationHelper)); @@ -78,7 +78,7 @@ internal static void TranslateAllSettings(in TimeZoneList timeZoneList) foreach (var nameStandard in timeZone.TimeNamesStandard) { - var nameStandardT = Resources.ResourceManager.GetString(nameStandard, CultureInfo.CurrentCulture); + var nameStandardT = Resources.ResourceManager.GetString(nameStandard, CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(nameStandardT)) { Log.Warn($"Resource string for [{nameStandard}] not found", typeof(TranslationHelper)); @@ -97,7 +97,7 @@ internal static void TranslateAllSettings(in TimeZoneList timeZoneList) foreach (var countryDaylight in timeZone.CountriesDaylight) { - var countryDaylightT = Resources.ResourceManager.GetString(countryDaylight, CultureInfo.CurrentCulture); + var countryDaylightT = Resources.ResourceManager.GetString(countryDaylight, CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(countryDaylightT)) { Log.Warn($"Resource string for [{countryDaylight}] not found", typeof(TranslationHelper)); @@ -116,7 +116,7 @@ internal static void TranslateAllSettings(in TimeZoneList timeZoneList) foreach (var countryStandard in timeZone.CountriesStandard) { - var countryStandardT = Resources.ResourceManager.GetString(countryStandard, CultureInfo.CurrentCulture); + var countryStandardT = Resources.ResourceManager.GetString(countryStandard, CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(countryStandardT)) { Log.Warn($"Resource string for [{countryStandard}] not found", typeof(TranslationHelper)); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs index 1a7030cc034..09743eefc54 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.Designer.cs @@ -87,6 +87,24 @@ internal static string Acre_Time { } } + /// + /// Looks up a localized string similar to Afghanistan. + /// + internal static string Afghanistan { + get { + return ResourceManager.GetString("Afghanistan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Afghanistan Time. + /// + internal static string Afghanistan_Time { + get { + return ResourceManager.GetString("Afghanistan Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Akrotiri and Dhekelia. /// @@ -96,6 +114,15 @@ internal static string Akrotiri_and_Dhekelia { } } + /// + /// Looks up a localized string similar to Aktobe (Kazakhstan). + /// + internal static string Aktobe__Kazakhstan_ { + get { + return ResourceManager.GetString("Aktobe (Kazakhstan)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Alabama (United States). /// @@ -168,6 +195,15 @@ internal static string Algeria { } } + /// + /// Looks up a localized string similar to Alma-Ata Time. + /// + internal static string Alma_Ata_Time { + get { + return ResourceManager.GetString("Alma-Ata Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Alpha Time Zone. /// @@ -177,6 +213,24 @@ internal static string Alpha_Time_Zone { } } + /// + /// Looks up a localized string similar to Altai Krai (Russia). + /// + internal static string Altai_Krai__Russia_ { + get { + return ResourceManager.GetString("Altai Krai (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Altai Republic (Russia). + /// + internal static string Altai_Republic__Russia_ { + get { + return ResourceManager.GetString("Altai Republic (Russia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Amazon Summer Time. /// @@ -213,6 +267,33 @@ internal static string American_Samoa { } } + /// + /// Looks up a localized string similar to Amsterdam Island (French Southern and Antarctic Lands). + /// + internal static string Amsterdam_Island__French_Southern_and_Antarctic_Lands_ { + get { + return ResourceManager.GetString("Amsterdam Island (French Southern and Antarctic Lands)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Amur (Russia). + /// + internal static string Amur__Russia_ { + get { + return ResourceManager.GetString("Amur (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Anadyr Time. + /// + internal static string Anadyr_Time { + get { + return ResourceManager.GetString("Anadyr Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Andorra. /// @@ -258,6 +339,15 @@ internal static string Antigua_and_Barbuda { } } + /// + /// Looks up a localized string similar to Aqtobe Time. + /// + internal static string Aqtobe_Time { + get { + return ResourceManager.GetString("Aqtobe Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Arabia Standard Time. /// @@ -303,6 +393,33 @@ internal static string Arkansas__United_States_ { } } + /// + /// Looks up a localized string similar to Armenia. + /// + internal static string Armenia { + get { + return ResourceManager.GetString("Armenia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Armenia Time. + /// + internal static string Armenia_Time { + get { + return ResourceManager.GetString("Armenia Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Artsakh. + /// + internal static string Artsakh { + get { + return ResourceManager.GetString("Artsakh", resourceCulture); + } + } + /// /// Looks up a localized string similar to Aruba. /// @@ -321,6 +438,24 @@ internal static string Ascension_and_Tristan_da_Cunha { } } + /// + /// Looks up a localized string similar to ASEAN Common Time. + /// + internal static string ASEAN_Common_Time { + get { + return ResourceManager.GetString("ASEAN Common Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Astrakhan (Russia). + /// + internal static string Astrakhan__Russia_ { + get { + return ResourceManager.GetString("Astrakhan (Russia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Atikokan (Canada). /// @@ -357,6 +492,96 @@ internal static string Atlantic_Time_Zone { } } + /// + /// Looks up a localized string similar to Atyrau (Kazakhstan). + /// + internal static string Atyrau__Kazakhstan_ { + get { + return ResourceManager.GetString("Atyrau (Kazakhstan)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australia: Western Australia (most). + /// + internal static string Australia__Western_Australia__most_ { + get { + return ResourceManager.GetString("Australia: Western Australia (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australian Capital Territory (Australia). + /// + internal static string Australian_Capital_Territory__Australia_ { + get { + return ResourceManager.GetString("Australian Capital Territory (Australia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australian Central Daylight Saving Time. + /// + internal static string Australian_Central_Daylight_Saving_Time { + get { + return ResourceManager.GetString("Australian Central Daylight Saving Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australian Central Standard Time. + /// + internal static string Australian_Central_Standard_Time { + get { + return ResourceManager.GetString("Australian Central Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australian Central Western Standard Time. + /// + internal static string Australian_Central_Western_Standard_Time { + get { + return ResourceManager.GetString("Australian Central Western Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australian Eastern Daylight Saving Time. + /// + internal static string Australian_Eastern_Daylight_Saving_Time { + get { + return ResourceManager.GetString("Australian Eastern Daylight Saving Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australian Eastern Standard Time. + /// + internal static string Australian_Eastern_Standard_Time { + get { + return ResourceManager.GetString("Australian Eastern Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australian Eastern Time. + /// + internal static string Australian_Eastern_Time { + get { + return ResourceManager.GetString("Australian Eastern Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Australian Western Standard Time. + /// + internal static string Australian_Western_Standard_Time { + get { + return ResourceManager.GetString("Australian Western Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Austria. /// @@ -366,6 +591,24 @@ internal static string Austria { } } + /// + /// Looks up a localized string similar to Azerbaijan. + /// + internal static string Azerbaijan { + get { + return ResourceManager.GetString("Azerbaijan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azerbaijan Time. + /// + internal static string Azerbaijan_Time { + get { + return ResourceManager.GetString("Azerbaijan Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Azores (Portugal). /// @@ -411,6 +654,15 @@ internal static string Bahrain { } } + /// + /// Looks up a localized string similar to Baikonur (Kazakhstan). + /// + internal static string Baikonur__Kazakhstan_ { + get { + return ResourceManager.GetString("Baikonur (Kazakhstan)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Baja California (Mexico). /// @@ -447,6 +699,33 @@ internal static string Baker_Island_Time { } } + /// + /// Looks up a localized string similar to Bali (Indonesia). + /// + internal static string Bali__Indonesia_ { + get { + return ResourceManager.GetString("Bali (Indonesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bangladesh. + /// + internal static string Bangladesh { + get { + return ResourceManager.GetString("Bangladesh", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bangladesh Standard Time. + /// + internal static string Bangladesh_Standard_Time { + get { + return ResourceManager.GetString("Bangladesh Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Barbados. /// @@ -456,6 +735,24 @@ internal static string Barbados { } } + /// + /// Looks up a localized string similar to Bashkortostan (Russia). + /// + internal static string Bashkortostan__Russia_ { + get { + return ResourceManager.GetString("Bashkortostan (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bayan-Ölgii (Mongolia). + /// + internal static string Bayan_Ölgii__Mongolia_ { + get { + return ResourceManager.GetString("Bayan-Ölgii (Mongolia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Belarus. /// @@ -501,6 +798,24 @@ internal static string Bermuda { } } + /// + /// Looks up a localized string similar to Bhutan. + /// + internal static string Bhutan { + get { + return ResourceManager.GetString("Bhutan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bhutan Time. + /// + internal static string Bhutan_Time { + get { + return ResourceManager.GetString("Bhutan Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Bolivia. /// @@ -519,6 +834,15 @@ internal static string Bolivia_Time { } } + /// + /// Looks up a localized string similar to Border Village (Australia). + /// + internal static string Border_Village__Australia_ { + get { + return ResourceManager.GetString("Border Village (Australia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Bosnia and Herzegovina. /// @@ -537,6 +861,24 @@ internal static string Botswana { } } + /// + /// Looks up a localized string similar to Bougainville (Papua New Guinea). + /// + internal static string Bougainville__Papua_New_Guinea_ { + get { + return ResourceManager.GetString("Bougainville (Papua New Guinea)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bougainville Standard Time. + /// + internal static string Bougainville_Standard_Time { + get { + return ResourceManager.GetString("Bougainville Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Brasília Summer Time. /// @@ -600,6 +942,24 @@ internal static string British_Columbia__southeast__Canada_ { } } + /// + /// Looks up a localized string similar to British Indian Ocean Territory. + /// + internal static string British_Indian_Ocean_Territory { + get { + return ResourceManager.GetString("British Indian Ocean Territory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to British Indian Ocean Time. + /// + internal static string British_Indian_Ocean_Time { + get { + return ResourceManager.GetString("British Indian Ocean Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to British Summer Time. /// @@ -618,6 +978,24 @@ internal static string British_Virgin_Islands { } } + /// + /// Looks up a localized string similar to Brunei. + /// + internal static string Brunei { + get { + return ResourceManager.GetString("Brunei", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Brunei Time. + /// + internal static string Brunei_Time { + get { + return ResourceManager.GetString("Brunei Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Bulgaria. /// @@ -646,16 +1024,43 @@ internal static string Burundi { } /// - /// Looks up a localized string similar to California (United States). + /// Looks up a localized string similar to Buryatia (Russia). /// - internal static string California__United_States_ { + internal static string Buryatia__Russia_ { get { - return ResourceManager.GetString("California (United States)", resourceCulture); + return ResourceManager.GetString("Buryatia (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Cameroon. + /// Looks up a localized string similar to Caiguna (Australia). + /// + internal static string Caiguna__Australia_ { + get { + return ResourceManager.GetString("Caiguna (Australia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to California (United States). + /// + internal static string California__United_States_ { + get { + return ResourceManager.GetString("California (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cambodia. + /// + internal static string Cambodia { + get { + return ResourceManager.GetString("Cambodia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cameroon. /// internal static string Cameroon { get { @@ -753,6 +1158,24 @@ internal static string Central_European_Time { } } + /// + /// Looks up a localized string similar to Central Indonesian Time. + /// + internal static string Central_Indonesian_Time { + get { + return ResourceManager.GetString("Central Indonesian Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Central Kalimantan (Indonesia). + /// + internal static string Central_Kalimantan__Indonesia_ { + get { + return ResourceManager.GetString("Central Kalimantan (Indonesia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Central Standard Time. /// @@ -771,6 +1194,15 @@ internal static string Central_Time_Zone { } } + /// + /// Looks up a localized string similar to Central Western Standard Time. + /// + internal static string Central_Western_Standard_Time { + get { + return ResourceManager.GetString("Central Western Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Chad. /// @@ -780,6 +1212,24 @@ internal static string Chad { } } + /// + /// Looks up a localized string similar to Chamorro Standard Time. + /// + internal static string Chamorro_Standard_Time { + get { + return ResourceManager.GetString("Chamorro Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chamorro Time Zone. + /// + internal static string Chamorro_Time_Zone { + get { + return ResourceManager.GetString("Chamorro Time Zone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Charlie Time Zone. /// @@ -789,6 +1239,42 @@ internal static string Charlie_Time_Zone { } } + /// + /// Looks up a localized string similar to Chatham Daylight Time. + /// + internal static string Chatham_Daylight_Time { + get { + return ResourceManager.GetString("Chatham Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chatham Islands (New Zealand). + /// + internal static string Chatham_Islands__New_Zealand_ { + get { + return ResourceManager.GetString("Chatham Islands (New Zealand)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chatham Standard Time. + /// + internal static string Chatham_Standard_Time { + get { + return ResourceManager.GetString("Chatham Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chelyabinsk (Russia). + /// + internal static string Chelyabinsk__Russia_ { + get { + return ResourceManager.GetString("Chelyabinsk (Russia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Chihuahua (Mexico). /// @@ -816,6 +1302,87 @@ internal static string Chile_Summer_Time { } } + /// + /// Looks up a localized string similar to China. + /// + internal static string China { + get { + return ResourceManager.GetString("China", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to China Standard Time. + /// + internal static string China_Standard_Time { + get { + return ResourceManager.GetString("China Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choibalsan Standard Time. + /// + internal static string Choibalsan_Standard_Time { + get { + return ResourceManager.GetString("Choibalsan Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choibalsan Summer Time. + /// + internal static string Choibalsan_Summer_Time { + get { + return ResourceManager.GetString("Choibalsan Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Christmas Island. + /// + internal static string Christmas_Island { + get { + return ResourceManager.GetString("Christmas Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Christmas Island Time. + /// + internal static string Christmas_Island_Time { + get { + return ResourceManager.GetString("Christmas Island Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chukotka (Russia). + /// + internal static string Chukotka__Russia_ { + get { + return ResourceManager.GetString("Chukotka (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chuuk (Micronesia). + /// + internal static string Chuuk__Micronesia_ { + get { + return ResourceManager.GetString("Chuuk (Micronesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Chuuk Time. + /// + internal static string Chuuk_Time { + get { + return ResourceManager.GetString("Chuuk Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Clipperton Island. /// @@ -825,6 +1392,42 @@ internal static string Clipperton_Island { } } + /// + /// Looks up a localized string similar to Clipperton Island Standard Time. + /// + internal static string Clipperton_Island_Standard_Time { + get { + return ResourceManager.GetString("Clipperton Island Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cocklebiddy (Australia). + /// + internal static string Cocklebiddy__Australia_ { + get { + return ResourceManager.GetString("Cocklebiddy (Australia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cocos Islands. + /// + internal static string Cocos_Islands { + get { + return ResourceManager.GetString("Cocos Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cocos Islands Time. + /// + internal static string Cocos_Islands_Time { + get { + return ResourceManager.GetString("Cocos Islands Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Colombia. /// @@ -960,6 +1563,15 @@ internal static string Croatia { } } + /// + /// Looks up a localized string similar to Crozet Islands (French Southern and Antarctic Lands). + /// + internal static string Crozet_Islands__French_Southern_and_Antarctic_Lands_ { + get { + return ResourceManager.GetString("Crozet Islands (French Southern and Antarctic Lands)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cuba. /// @@ -1023,6 +1635,15 @@ internal static string Danmarkshavn { } } + /// + /// Looks up a localized string similar to Davis Time. + /// + internal static string Davis_Time { + get { + return ResourceManager.GetString("Davis Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Daylight Time. /// @@ -1050,6 +1671,15 @@ internal static string Delaware__United_States_ { } } + /// + /// Looks up a localized string similar to Delta Time Zone. + /// + internal static string Delta_Time_Zone { + get { + return ResourceManager.GetString("Delta Time Zone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Democratic Republic of the Congo (most). /// @@ -1113,6 +1743,15 @@ internal static string Donetsk_PR { } } + /// + /// Looks up a localized string similar to Dumont d'Urville Time. + /// + internal static string Dumont_d_Urville_Time { + get { + return ResourceManager.GetString("Dumont d\'Urville Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to East Africa Time. /// @@ -1122,6 +1761,33 @@ internal static string East_Africa_Time { } } + /// + /// Looks up a localized string similar to East Kalimantan (Indonesia). + /// + internal static string East_Kalimantan__Indonesia_ { + get { + return ResourceManager.GetString("East Kalimantan (Indonesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to East Nusa Tenggara (Indonesia). + /// + internal static string East_Nusa_Tenggara__Indonesia_ { + get { + return ResourceManager.GetString("East Nusa Tenggara (Indonesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to East Timor. + /// + internal static string East_Timor { + get { + return ResourceManager.GetString("East Timor", resourceCulture); + } + } + /// /// Looks up a localized string similar to Easter Island (Chile). /// @@ -1203,6 +1869,15 @@ internal static string Eastern_Greenland_Time { } } + /// + /// Looks up a localized string similar to Eastern Indonesian Time. + /// + internal static string Eastern_Indonesian_Time { + get { + return ResourceManager.GetString("Eastern Indonesian Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Eastern Standard Time. /// @@ -1221,6 +1896,15 @@ internal static string Eastern_Time_Zone { } } + /// + /// Looks up a localized string similar to Echo Time Zone. + /// + internal static string Echo_Time_Zone { + get { + return ResourceManager.GetString("Echo Time Zone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Ecuador: Galápagos. /// @@ -1320,6 +2004,15 @@ internal static string Ethiopia { } } + /// + /// Looks up a localized string similar to Eucla (Australia). + /// + internal static string Eucla__Australia_ { + get { + return ResourceManager.GetString("Eucla (Australia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Falkland Islands. /// @@ -1374,6 +2067,24 @@ internal static string Fernando_de_Noronha_Time { } } + /// + /// Looks up a localized string similar to Fiji. + /// + internal static string Fiji { + get { + return ResourceManager.GetString("Fiji", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fiji Time. + /// + internal static string Fiji_Time { + get { + return ResourceManager.GetString("Fiji Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Finland. /// @@ -1392,6 +2103,24 @@ internal static string Florida__most__United_States_ { } } + /// + /// Looks up a localized string similar to Forty-Fours (New Zealand). + /// + internal static string Forty_Fours__New_Zealand_ { + get { + return ResourceManager.GetString("Forty-Fours (New Zealand)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Foxtrot Time Zone. + /// + internal static string Foxtrot_Time_Zone { + get { + return ResourceManager.GetString("Foxtrot Time Zone", resourceCulture); + } + } + /// /// Looks up a localized string similar to France (metropolitan). /// @@ -1428,6 +2157,15 @@ internal static string French_Polynesia__most_ { } } + /// + /// Looks up a localized string similar to French Southern and Antarctic Time. + /// + internal static string French_Southern_and_Antarctic_Time { + get { + return ResourceManager.GetString("French Southern and Antarctic Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Further-eastern European Time. /// @@ -1482,6 +2220,15 @@ internal static string Gambier_Islands_Time { } } + /// + /// Looks up a localized string similar to Georgia. + /// + internal static string Georgia { + get { + return ResourceManager.GetString("Georgia", resourceCulture); + } + } + /// /// Looks up a localized string similar to Georgia (United States). /// @@ -1491,6 +2238,15 @@ internal static string Georgia__United_States_ { } } + /// + /// Looks up a localized string similar to Georgia Standard Time. + /// + internal static string Georgia_Standard_Time { + get { + return ResourceManager.GetString("Georgia Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Germany. /// @@ -1518,6 +2274,33 @@ internal static string Gibraltar { } } + /// + /// Looks up a localized string similar to Gilbert Island Time. + /// + internal static string Gilbert_Island_Time { + get { + return ResourceManager.GetString("Gilbert Island Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gilbert Islands (Kiribati). + /// + internal static string Gilbert_Islands__Kiribati_ { + get { + return ResourceManager.GetString("Gilbert Islands (Kiribati)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Golf Time Zone. + /// + internal static string Golf_Time_Zone { + get { + return ResourceManager.GetString("Golf Time Zone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Greece. /// @@ -1563,6 +2346,15 @@ internal static string Guadeloupe { } } + /// + /// Looks up a localized string similar to Guam. + /// + internal static string Guam { + get { + return ResourceManager.GetString("Guam", resourceCulture); + } + } + /// /// Looks up a localized string similar to Guatemala. /// @@ -1599,6 +2391,15 @@ internal static string Guinea_Bissau { } } + /// + /// Looks up a localized string similar to Gulf Standard Time. + /// + internal static string Gulf_Standard_Time { + get { + return ResourceManager.GetString("Gulf Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Guyana. /// @@ -1636,29 +2437,47 @@ internal static string Hawaii__United_States_ { } /// - /// Looks up a localized string similar to Hawaii–Aleutian Daylight Time. + /// Looks up a localized string similar to Hawaii-Aleutian Daylight Time. /// internal static string Hawaii_Aleutian_Daylight_Time { get { - return ResourceManager.GetString("Hawaii_Aleutian Daylight Time", resourceCulture); + return ResourceManager.GetString("Hawaii-Aleutian Daylight Time", resourceCulture); } } /// - /// Looks up a localized string similar to Hawaii–Aleutian Standard Time. + /// Looks up a localized string similar to Hawaii-Aleutian Standard Time. /// internal static string Hawaii_Aleutian_Standard_Time { get { - return ResourceManager.GetString("Hawaii_Aleutian Standard Time", resourceCulture); + return ResourceManager.GetString("Hawaii-Aleutian Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Hawaii–Aleutian Time Zone. + /// Looks up a localized string similar to Hawaii-Aleutian Time Zone. /// internal static string Hawaii_Aleutian_Time_Zone { get { - return ResourceManager.GetString("Hawaii_Aleutian Time Zone", resourceCulture); + return ResourceManager.GetString("Hawaii-Aleutian Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Heard and McDonald Islands Time. + /// + internal static string Heard_and_McDonald_Islands_Time { + get { + return ResourceManager.GetString("Heard and McDonald Islands Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Heard Island and McDonald Islands. + /// + internal static string Heard_Island_and_McDonald_Islands { + get { + return ResourceManager.GetString("Heard Island and McDonald Islands", resourceCulture); } } @@ -1680,6 +2499,42 @@ internal static string Honduras { } } + /// + /// Looks up a localized string similar to Hong Kong. + /// + internal static string Hong_Kong { + get { + return ResourceManager.GetString("Hong Kong", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hong Kong Time. + /// + internal static string Hong_Kong_Time { + get { + return ResourceManager.GetString("Hong Kong Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hotel Time Zone. + /// + internal static string Hotel_Time_Zone { + get { + return ResourceManager.GetString("Hotel Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hovd Time. + /// + internal static string Hovd_Time { + get { + return ResourceManager.GetString("Hovd Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Howland Island. /// @@ -1734,6 +2589,24 @@ internal static string Illinois__United_States_ { } } + /// + /// Looks up a localized string similar to India. + /// + internal static string India { + get { + return ResourceManager.GetString("India", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to India Time Zone. + /// + internal static string India_Time_Zone { + get { + return ResourceManager.GetString("India Time Zone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Indian Ocean Time. /// @@ -1743,6 +2616,15 @@ internal static string Indian_Ocean_Time { } } + /// + /// Looks up a localized string similar to Indian Standard Time. + /// + internal static string Indian_Standard_Time { + get { + return ResourceManager.GetString("Indian Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Indiana (most, United States). /// @@ -1752,6 +2634,15 @@ internal static string Indiana__most__United_States_ { } } + /// + /// Looks up a localized string similar to Indochina Time. + /// + internal static string Indochina_Time { + get { + return ResourceManager.GetString("Indochina Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to International Date Line West time zone. /// @@ -1824,6 +2715,24 @@ internal static string Irish_Standard_Time { } } + /// + /// Looks up a localized string similar to Irkutsk (Russia). + /// + internal static string Irkutsk__Russia_ { + get { + return ResourceManager.GetString("Irkutsk (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Irkutsk Time. + /// + internal static string Irkutsk_Time { + get { + return ResourceManager.GetString("Irkutsk Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Islands of Four Mountains (United States). /// @@ -1905,6 +2814,24 @@ internal static string Jamaica { } } + /// + /// Looks up a localized string similar to Japan. + /// + internal static string Japan { + get { + return ResourceManager.GetString("Japan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Japan Standard Time. + /// + internal static string Japan_Standard_Time { + get { + return ResourceManager.GetString("Japan Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Jarvis Island. /// @@ -1914,6 +2841,15 @@ internal static string Jarvis_Island { } } + /// + /// Looks up a localized string similar to Java (Indonesia). + /// + internal static string Java__Indonesia_ { + get { + return ResourceManager.GetString("Java (Indonesia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Jersey. /// @@ -1923,6 +2859,24 @@ internal static string Jersey { } } + /// + /// Looks up a localized string similar to Jervis Bay Territory (Australia). + /// + internal static string Jervis_Bay_Territory__Australia_ { + get { + return ResourceManager.GetString("Jervis Bay Territory (Australia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Jewish (Russia). + /// + internal static string Jewish__Russia_ { + get { + return ResourceManager.GetString("Jewish (Russia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Johnston Atoll. /// @@ -1960,1883 +2914,3215 @@ internal static string Kaliningrad_Time { } /// - /// Looks up a localized string similar to Kansas (most, United States). + /// Looks up a localized string similar to Kamchatka (Russia). /// - internal static string Kansas__most__United_States_ { + internal static string Kamchatka__Russia_ { get { - return ResourceManager.GetString("Kansas (most, United States)", resourceCulture); + return ResourceManager.GetString("Kamchatka (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Kentucky (most, United States). + /// Looks up a localized string similar to Kamchatka Time. /// - internal static string Kentucky__most__United_States_ { + internal static string Kamchatka_Time { get { - return ResourceManager.GetString("Kentucky (most, United States)", resourceCulture); + return ResourceManager.GetString("Kamchatka Time", resourceCulture); } } /// - /// Looks up a localized string similar to Kenya. + /// Looks up a localized string similar to Kansas (most, United States). /// - internal static string Kenya { + internal static string Kansas__most__United_States_ { get { - return ResourceManager.GetString("Kenya", resourceCulture); + return ResourceManager.GetString("Kansas (most, United States)", resourceCulture); } } /// - /// Looks up a localized string similar to Kingman Reef. + /// Looks up a localized string similar to Kazakhstan (most). /// - internal static string Kingman_Reef { + internal static string Kazakhstan__most_ { get { - return ResourceManager.GetString("Kingman Reef", resourceCulture); + return ResourceManager.GetString("Kazakhstan (most)", resourceCulture); } } /// - /// Looks up a localized string similar to Kinshasa (Democratic Republic of the Congo). + /// Looks up a localized string similar to Kemerovo (Russia). /// - internal static string Kinshasa__Democratic_Republic_of_the_Congo_ { + internal static string Kemerovo__Russia_ { get { - return ResourceManager.GetString("Kinshasa (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Kemerovo (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Kongo Central (Democratic Republic of the Congo). + /// Looks up a localized string similar to Kentucky (most, United States). /// - internal static string Kongo_Central__Democratic_Republic_of_the_Congo_ { + internal static string Kentucky__most__United_States_ { get { - return ResourceManager.GetString("Kongo Central (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Kentucky (most, United States)", resourceCulture); } } /// - /// Looks up a localized string similar to Kosovo. + /// Looks up a localized string similar to Kenya. /// - internal static string Kosovo { + internal static string Kenya { get { - return ResourceManager.GetString("Kosovo", resourceCulture); + return ResourceManager.GetString("Kenya", resourceCulture); } } /// - /// Looks up a localized string similar to Kuwait. + /// Looks up a localized string similar to Kerguelen Islands (French Southern and Antarctic Lands). /// - internal static string Kuwait { + internal static string Kerguelen_Islands__French_Southern_and_Antarctic_Lands_ { get { - return ResourceManager.GetString("Kuwait", resourceCulture); + return ResourceManager.GetString("Kerguelen Islands (French Southern and Antarctic Lands)", resourceCulture); } } /// - /// Looks up a localized string similar to Kwango (Democratic Republic of the Congo). + /// Looks up a localized string similar to Khabarovsk (Russia). /// - internal static string Kwango__Democratic_Republic_of_the_Congo_ { + internal static string Khabarovsk__Russia_ { get { - return ResourceManager.GetString("Kwango (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Khabarovsk (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Kwilu (Democratic Republic of the Congo). + /// Looks up a localized string similar to Khakassia (Russia). /// - internal static string Kwilu__Democratic_Republic_of_the_Congo_ { + internal static string Khakassia__Russia_ { get { - return ResourceManager.GetString("Kwilu (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Khakassia (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Labrador (most, Canada). + /// Looks up a localized string similar to Khanty-Mansi (Russia). /// - internal static string Labrador__most__Canada_ { + internal static string Khanty_Mansi__Russia_ { get { - return ResourceManager.GetString("Labrador (most, Canada)", resourceCulture); + return ResourceManager.GetString("Khanty-Mansi (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Labrador (southeast, Canada). + /// Looks up a localized string similar to Khovd (Mongolia). /// - internal static string Labrador__southeast__Canada_ { + internal static string Khovd__Mongolia_ { get { - return ResourceManager.GetString("Labrador (southeast, Canada)", resourceCulture); + return ResourceManager.GetString("Khovd (Mongolia)", resourceCulture); } } /// - /// Looks up a localized string similar to Latvia. + /// Looks up a localized string similar to Kilo Time Zone. /// - internal static string Latvia { + internal static string Kilo_Time_Zone { get { - return ResourceManager.GetString("Latvia", resourceCulture); + return ResourceManager.GetString("Kilo Time Zone", resourceCulture); } } /// - /// Looks up a localized string similar to Lebanon. + /// Looks up a localized string similar to Kingman Reef. /// - internal static string Lebanon { + internal static string Kingman_Reef { get { - return ResourceManager.GetString("Lebanon", resourceCulture); + return ResourceManager.GetString("Kingman Reef", resourceCulture); } } /// - /// Looks up a localized string similar to Lesotho. + /// Looks up a localized string similar to Kinshasa (Democratic Republic of the Congo). /// - internal static string Lesotho { + internal static string Kinshasa__Democratic_Republic_of_the_Congo_ { get { - return ResourceManager.GetString("Lesotho", resourceCulture); + return ResourceManager.GetString("Kinshasa (Democratic Republic of the Congo)", resourceCulture); } } /// - /// Looks up a localized string similar to Liberia. + /// Looks up a localized string similar to Kongo Central (Democratic Republic of the Congo). /// - internal static string Liberia { + internal static string Kongo_Central__Democratic_Republic_of_the_Congo_ { get { - return ResourceManager.GetString("Liberia", resourceCulture); + return ResourceManager.GetString("Kongo Central (Democratic Republic of the Congo)", resourceCulture); } } /// - /// Looks up a localized string similar to Libya. + /// Looks up a localized string similar to Korea Standard Time. /// - internal static string Libya { + internal static string Korea_Standard_Time { get { - return ResourceManager.GetString("Libya", resourceCulture); + return ResourceManager.GetString("Korea Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Liechtenstein. + /// Looks up a localized string similar to Kosovo. /// - internal static string Liechtenstein { + internal static string Kosovo { get { - return ResourceManager.GetString("Liechtenstein", resourceCulture); + return ResourceManager.GetString("Kosovo", resourceCulture); } } /// - /// Looks up a localized string similar to Lithuania. + /// Looks up a localized string similar to Kosrae (Micronesia). /// - internal static string Lithuania { + internal static string Kosrae__Micronesia_ { get { - return ResourceManager.GetString("Lithuania", resourceCulture); + return ResourceManager.GetString("Kosrae (Micronesia)", resourceCulture); } } /// - /// Looks up a localized string similar to Louisiana (United States). + /// Looks up a localized string similar to Kosrae Time. /// - internal static string Louisiana__United_States_ { + internal static string Kosrae_Time { get { - return ResourceManager.GetString("Louisiana (United States)", resourceCulture); + return ResourceManager.GetString("Kosrae Time", resourceCulture); } } /// - /// Looks up a localized string similar to Luhansk PR. + /// Looks up a localized string similar to Krasnoyarsk (Russia). /// - internal static string Luhansk_PR { + internal static string Krasnoyarsk__Russia_ { get { - return ResourceManager.GetString("Luhansk PR", resourceCulture); + return ResourceManager.GetString("Krasnoyarsk (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Luxembourg. + /// Looks up a localized string similar to Krasnoyarsk Time. /// - internal static string Luxembourg { + internal static string Krasnoyarsk_Time { get { - return ResourceManager.GetString("Luxembourg", resourceCulture); + return ResourceManager.GetString("Krasnoyarsk Time", resourceCulture); } } /// - /// Looks up a localized string similar to Madagascar. + /// Looks up a localized string similar to Kurgan (Russia). /// - internal static string Madagascar { + internal static string Kurgan__Russia_ { get { - return ResourceManager.GetString("Madagascar", resourceCulture); + return ResourceManager.GetString("Kurgan (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Magallanes (Chile). + /// Looks up a localized string similar to Kuwait. /// - internal static string Magallanes__Chile_ { + internal static string Kuwait { get { - return ResourceManager.GetString("Magallanes (Chile)", resourceCulture); + return ResourceManager.GetString("Kuwait", resourceCulture); } } /// - /// Looks up a localized string similar to Mai-Ndombe (Democratic Republic of the Congo). + /// Looks up a localized string similar to Kwango (Democratic Republic of the Congo). /// - internal static string Mai_Ndombe__Democratic_Republic_of_the_Congo_ { + internal static string Kwango__Democratic_Republic_of_the_Congo_ { get { - return ResourceManager.GetString("Mai-Ndombe (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Kwango (Democratic Republic of the Congo)", resourceCulture); } } /// - /// Looks up a localized string similar to Maine (United States). + /// Looks up a localized string similar to Kwilu (Democratic Republic of the Congo). /// - internal static string Maine__United_States_ { + internal static string Kwilu__Democratic_Republic_of_the_Congo_ { get { - return ResourceManager.GetString("Maine (United States)", resourceCulture); + return ResourceManager.GetString("Kwilu (Democratic Republic of the Congo)", resourceCulture); } } /// - /// Looks up a localized string similar to Malawi. + /// Looks up a localized string similar to Kyrgyzstan. /// - internal static string Malawi { + internal static string Kyrgyzstan { get { - return ResourceManager.GetString("Malawi", resourceCulture); + return ResourceManager.GetString("Kyrgyzstan", resourceCulture); } } /// - /// Looks up a localized string similar to Mali. + /// Looks up a localized string similar to Kyrgyzstan Time. /// - internal static string Mali { + internal static string Kyrgyzstan_Time { get { - return ResourceManager.GetString("Mali", resourceCulture); + return ResourceManager.GetString("Kyrgyzstan Time", resourceCulture); } } /// - /// Looks up a localized string similar to Malta. + /// Looks up a localized string similar to Kyzylorda (Kazakhstan). /// - internal static string Malta { + internal static string Kyzylorda__Kazakhstan_ { get { - return ResourceManager.GetString("Malta", resourceCulture); + return ResourceManager.GetString("Kyzylorda (Kazakhstan)", resourceCulture); } } /// - /// Looks up a localized string similar to Manitoba (Canada). + /// Looks up a localized string similar to Labrador (most, Canada). /// - internal static string Manitoba__Canada_ { + internal static string Labrador__most__Canada_ { get { - return ResourceManager.GetString("Manitoba (Canada)", resourceCulture); + return ResourceManager.GetString("Labrador (most, Canada)", resourceCulture); } } /// - /// Looks up a localized string similar to Marquesas Islands (French Polynesia). + /// Looks up a localized string similar to Labrador (southeast, Canada). /// - internal static string Marquesas_Islands__French_Polynesia_ { + internal static string Labrador__southeast__Canada_ { get { - return ResourceManager.GetString("Marquesas Islands (French Polynesia)", resourceCulture); + return ResourceManager.GetString("Labrador (southeast, Canada)", resourceCulture); } } /// - /// Looks up a localized string similar to Marquesas Islands Time. + /// Looks up a localized string similar to Laos. /// - internal static string Marquesas_Islands_Time { + internal static string Laos { get { - return ResourceManager.GetString("Marquesas Islands Time", resourceCulture); + return ResourceManager.GetString("Laos", resourceCulture); } } /// - /// Looks up a localized string similar to Martinique. + /// Looks up a localized string similar to Latvia. /// - internal static string Martinique { + internal static string Latvia { get { - return ResourceManager.GetString("Martinique", resourceCulture); + return ResourceManager.GetString("Latvia", resourceCulture); } } /// - /// Looks up a localized string similar to Maryland (United States). + /// Looks up a localized string similar to Lebanon. /// - internal static string Maryland__United_States_ { + internal static string Lebanon { get { - return ResourceManager.GetString("Maryland (United States)", resourceCulture); + return ResourceManager.GetString("Lebanon", resourceCulture); } } /// - /// Looks up a localized string similar to Massachusetts. + /// Looks up a localized string similar to Lesotho. /// - internal static string Massachusetts { + internal static string Lesotho { get { - return ResourceManager.GetString("Massachusetts", resourceCulture); + return ResourceManager.GetString("Lesotho", resourceCulture); } } /// - /// Looks up a localized string similar to Mato Grosso (Brazil). + /// Looks up a localized string similar to Liberia. /// - internal static string Mato_Grosso__Brazil_ { + internal static string Liberia { get { - return ResourceManager.GetString("Mato Grosso (Brazil)", resourceCulture); + return ResourceManager.GetString("Liberia", resourceCulture); } } /// - /// Looks up a localized string similar to Mato Grosso do Sul (Brazil). + /// Looks up a localized string similar to Libya. /// - internal static string Mato_Grosso_do_Sul__Brazil_ { + internal static string Libya { get { - return ResourceManager.GetString("Mato Grosso do Sul (Brazil)", resourceCulture); + return ResourceManager.GetString("Libya", resourceCulture); } } /// - /// Looks up a localized string similar to Mauritania. + /// Looks up a localized string similar to Liechtenstein. /// - internal static string Mauritania { + internal static string Liechtenstein { get { - return ResourceManager.GetString("Mauritania", resourceCulture); + return ResourceManager.GetString("Liechtenstein", resourceCulture); } } /// - /// Looks up a localized string similar to Mayotte. + /// Looks up a localized string similar to Lima Time Zone. /// - internal static string Mayotte { + internal static string Lima_Time_Zone { get { - return ResourceManager.GetString("Mayotte", resourceCulture); + return ResourceManager.GetString("Lima Time Zone", resourceCulture); } } /// - /// Looks up a localized string similar to Mexico (most). + /// Looks up a localized string similar to Line Islands (Kiribati). /// - internal static string Mexico__most_ { + internal static string Line_Islands__Kiribati_ { get { - return ResourceManager.GetString("Mexico (most)", resourceCulture); + return ResourceManager.GetString("Line Islands (Kiribati)", resourceCulture); } } /// - /// Looks up a localized string similar to Michigan (most, United States). + /// Looks up a localized string similar to Line Islands Time. /// - internal static string Michigan__most__United_States_ { + internal static string Line_Islands_Time { get { - return ResourceManager.GetString("Michigan (most, United States)", resourceCulture); + return ResourceManager.GetString("Line Islands Time", resourceCulture); } } /// - /// Looks up a localized string similar to Middle European Summer Time. + /// Looks up a localized string similar to Lithuania. /// - internal static string Middle_European_Summer_Time { + internal static string Lithuania { get { - return ResourceManager.GetString("Middle European Summer Time", resourceCulture); + return ResourceManager.GetString("Lithuania", resourceCulture); } } /// - /// Looks up a localized string similar to Middle European Time. + /// Looks up a localized string similar to Little Mangere Island (New Zealand). /// - internal static string Middle_European_Time { + internal static string Little_Mangere_Island__New_Zealand_ { get { - return ResourceManager.GetString("Middle European Time", resourceCulture); + return ResourceManager.GetString("Little Mangere Island (New Zealand)", resourceCulture); } } /// - /// Looks up a localized string similar to Midway Atoll. + /// Looks up a localized string similar to Lord Howe Island (Australia). /// - internal static string Midway_Atoll { + internal static string Lord_Howe_Island__Australia_ { get { - return ResourceManager.GetString("Midway Atoll", resourceCulture); + return ResourceManager.GetString("Lord Howe Island (Australia)", resourceCulture); } } /// - /// Looks up a localized string similar to Minnesota (United States). + /// Looks up a localized string similar to Lord Howe Standard Time. /// - internal static string Minnesota__United_States_ { + internal static string Lord_Howe_Standard_Time { get { - return ResourceManager.GetString("Minnesota (United States)", resourceCulture); + return ResourceManager.GetString("Lord Howe Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Mishkeegogamang (Canada). + /// Looks up a localized string similar to Lord Howe Summer Time. /// - internal static string Mishkeegogamang__Canada_ { + internal static string Lord_Howe_Summer_Time { get { - return ResourceManager.GetString("Mishkeegogamang (Canada)", resourceCulture); + return ResourceManager.GetString("Lord Howe Summer Time", resourceCulture); } } /// - /// Looks up a localized string similar to Mississippi (United States). + /// Looks up a localized string similar to Louisiana (United States). /// - internal static string Mississippi__United_States_ { + internal static string Louisiana__United_States_ { get { - return ResourceManager.GetString("Mississippi (United States)", resourceCulture); + return ResourceManager.GetString("Louisiana (United States)", resourceCulture); } } /// - /// Looks up a localized string similar to Missouri (United States). + /// Looks up a localized string similar to Luhansk PR. /// - internal static string Missouri__United_States_ { + internal static string Luhansk_PR { get { - return ResourceManager.GetString("Missouri (United States)", resourceCulture); + return ResourceManager.GetString("Luhansk PR", resourceCulture); } } /// - /// Looks up a localized string similar to Moldova. + /// Looks up a localized string similar to Luxembourg. /// - internal static string Moldova { + internal static string Luxembourg { get { - return ResourceManager.GetString("Moldova", resourceCulture); + return ResourceManager.GetString("Luxembourg", resourceCulture); } } /// - /// Looks up a localized string similar to Monaco. + /// Looks up a localized string similar to Macau. /// - internal static string Monaco { + internal static string Macau { get { - return ResourceManager.GetString("Monaco", resourceCulture); + return ResourceManager.GetString("Macau", resourceCulture); } } /// - /// Looks up a localized string similar to Mongala (Democratic Republic of the Congo). + /// Looks up a localized string similar to Macquarie Island Station Time. /// - internal static string Mongala__Democratic_Republic_of_the_Congo_ { + internal static string Macquarie_Island_Station_Time { get { - return ResourceManager.GetString("Mongala (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Macquarie Island Station Time", resourceCulture); } } /// - /// Looks up a localized string similar to Montana (United States). + /// Looks up a localized string similar to Madagascar. /// - internal static string Montana__United_States_ { + internal static string Madagascar { get { - return ResourceManager.GetString("Montana (United States)", resourceCulture); + return ResourceManager.GetString("Madagascar", resourceCulture); } } /// - /// Looks up a localized string similar to Montenegro. + /// Looks up a localized string similar to Madura (Australia). /// - internal static string Montenegro { + internal static string Madura__Australia_ { get { - return ResourceManager.GetString("Montenegro", resourceCulture); + return ResourceManager.GetString("Madura (Australia)", resourceCulture); } } /// - /// Looks up a localized string similar to Montserrat. + /// Looks up a localized string similar to Magadan (Russia). /// - internal static string Montserrat { + internal static string Magadan__Russia_ { get { - return ResourceManager.GetString("Montserrat", resourceCulture); + return ResourceManager.GetString("Magadan (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Morocco. + /// Looks up a localized string similar to Magadan Time. /// - internal static string Morocco { + internal static string Magadan_Time { get { - return ResourceManager.GetString("Morocco", resourceCulture); + return ResourceManager.GetString("Magadan Time", resourceCulture); } } /// - /// Looks up a localized string similar to Moscow Time. + /// Looks up a localized string similar to Magallanes (Chile). /// - internal static string Moscow_Time { + internal static string Magallanes__Chile_ { get { - return ResourceManager.GetString("Moscow Time", resourceCulture); + return ResourceManager.GetString("Magallanes (Chile)", resourceCulture); } } /// - /// Looks up a localized string similar to Mountain Daylight Time. + /// Looks up a localized string similar to Mai-Ndombe (Democratic Republic of the Congo). /// - internal static string Mountain_Daylight_Time { + internal static string Mai_Ndombe__Democratic_Republic_of_the_Congo_ { get { - return ResourceManager.GetString("Mountain Daylight Time", resourceCulture); + return ResourceManager.GetString("Mai-Ndombe (Democratic Republic of the Congo)", resourceCulture); } } /// - /// Looks up a localized string similar to Mountain Standard Time. + /// Looks up a localized string similar to Maine (United States). /// - internal static string Mountain_Standard_Time { + internal static string Maine__United_States_ { get { - return ResourceManager.GetString("Mountain Standard Time", resourceCulture); + return ResourceManager.GetString("Maine (United States)", resourceCulture); } } /// - /// Looks up a localized string similar to Mountain Time Zone. + /// Looks up a localized string similar to Malawi. /// - internal static string Mountain_Time_Zone { + internal static string Malawi { get { - return ResourceManager.GetString("Mountain Time Zone", resourceCulture); + return ResourceManager.GetString("Malawi", resourceCulture); } } /// - /// Looks up a localized string similar to Mozambique. + /// Looks up a localized string similar to Malaysia. /// - internal static string Mozambique { + internal static string Malaysia { get { - return ResourceManager.GetString("Mozambique", resourceCulture); + return ResourceManager.GetString("Malaysia", resourceCulture); } } /// - /// Looks up a localized string similar to Names. + /// Looks up a localized string similar to Malaysia Standard Time. /// - internal static string Names { + internal static string Malaysia_Standard_Time { get { - return ResourceManager.GetString("Names", resourceCulture); + return ResourceManager.GetString("Malaysia Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Namibia. + /// Looks up a localized string similar to Malaysia Time. /// - internal static string Namibia { + internal static string Malaysia_Time { get { - return ResourceManager.GetString("Namibia", resourceCulture); + return ResourceManager.GetString("Malaysia Time", resourceCulture); } } /// - /// Looks up a localized string similar to Navassa Island. + /// Looks up a localized string similar to Maldives. /// - internal static string Navassa_Island { + internal static string Maldives { get { - return ResourceManager.GetString("Navassa Island", resourceCulture); + return ResourceManager.GetString("Maldives", resourceCulture); } } /// - /// Looks up a localized string similar to Nayarit (most, Mexico). + /// Looks up a localized string similar to Maldives Time. /// - internal static string Nayarit__most__Mexico_ { + internal static string Maldives_Time { get { - return ResourceManager.GetString("Nayarit (most, Mexico)", resourceCulture); + return ResourceManager.GetString("Maldives Time", resourceCulture); } } /// - /// Looks up a localized string similar to Near Islands (United States). + /// Looks up a localized string similar to Mali. /// - internal static string Near_Islands__United_States_ { + internal static string Mali { get { - return ResourceManager.GetString("Near Islands (United States)", resourceCulture); + return ResourceManager.GetString("Mali", resourceCulture); } } /// - /// Looks up a localized string similar to Nebraska (most, United States). + /// Looks up a localized string similar to Malta. /// - internal static string Nebraska__most__United_States_ { + internal static string Malta { get { - return ResourceManager.GetString("Nebraska (most, United States)", resourceCulture); + return ResourceManager.GetString("Malta", resourceCulture); } } /// - /// Looks up a localized string similar to Netherlands (European). + /// Looks up a localized string similar to Maluku (Indonesia). /// - internal static string Netherlands__European_ { + internal static string Maluku__Indonesia_ { get { - return ResourceManager.GetString("Netherlands (European)", resourceCulture); + return ResourceManager.GetString("Maluku (Indonesia)", resourceCulture); } } /// - /// Looks up a localized string similar to Nevada (United States). + /// Looks up a localized string similar to Mangystau (Kazakhstan). /// - internal static string Nevada__United_States_ { + internal static string Mangystau__Kazakhstan_ { get { - return ResourceManager.GetString("Nevada (United States)", resourceCulture); + return ResourceManager.GetString("Mangystau (Kazakhstan)", resourceCulture); } } /// - /// Looks up a localized string similar to New Brunswick (Canada). + /// Looks up a localized string similar to Manitoba (Canada). /// - internal static string New_Brunswick__Canada_ { + internal static string Manitoba__Canada_ { get { - return ResourceManager.GetString("New Brunswick (Canada)", resourceCulture); + return ResourceManager.GetString("Manitoba (Canada)", resourceCulture); } } /// - /// Looks up a localized string similar to New Hampshire (United States). + /// Looks up a localized string similar to Marquesas Islands (French Polynesia). /// - internal static string New_Hampshire__United_States_ { + internal static string Marquesas_Islands__French_Polynesia_ { get { - return ResourceManager.GetString("New Hampshire (United States)", resourceCulture); + return ResourceManager.GetString("Marquesas Islands (French Polynesia)", resourceCulture); } } /// - /// Looks up a localized string similar to New Jersey (United States). + /// Looks up a localized string similar to Marquesas Islands Time. /// - internal static string New_Jersey__United_States_ { + internal static string Marquesas_Islands_Time { get { - return ResourceManager.GetString("New Jersey (United States)", resourceCulture); + return ResourceManager.GetString("Marquesas Islands Time", resourceCulture); } } /// - /// Looks up a localized string similar to New Mexico (United States). + /// Looks up a localized string similar to Marshall Islands. /// - internal static string New_Mexico__United_States_ { + internal static string Marshall_Islands { get { - return ResourceManager.GetString("New Mexico (United States)", resourceCulture); + return ResourceManager.GetString("Marshall Islands", resourceCulture); } } /// - /// Looks up a localized string similar to New York (United States). + /// Looks up a localized string similar to Marshall Islands Time. /// - internal static string New_York__United_States_ { + internal static string Marshall_Islands_Time { get { - return ResourceManager.GetString("New York (United States)", resourceCulture); + return ResourceManager.GetString("Marshall Islands Time", resourceCulture); } } /// - /// Looks up a localized string similar to Newfoundland (Canada). + /// Looks up a localized string similar to Martinique. /// - internal static string Newfoundland__Canada_ { + internal static string Martinique { get { - return ResourceManager.GetString("Newfoundland (Canada)", resourceCulture); + return ResourceManager.GetString("Martinique", resourceCulture); } } /// - /// Looks up a localized string similar to Newfoundland Daylight Time. + /// Looks up a localized string similar to Maryland (United States). /// - internal static string Newfoundland_Daylight_Time { + internal static string Maryland__United_States_ { get { - return ResourceManager.GetString("Newfoundland Daylight Time", resourceCulture); + return ResourceManager.GetString("Maryland (United States)", resourceCulture); } } /// - /// Looks up a localized string similar to Newfoundland Standard Time. + /// Looks up a localized string similar to Massachusetts. /// - internal static string Newfoundland_Standard_Time { + internal static string Massachusetts { get { - return ResourceManager.GetString("Newfoundland Standard Time", resourceCulture); + return ResourceManager.GetString("Massachusetts", resourceCulture); } } /// - /// Looks up a localized string similar to Newfoundland Time Zone. + /// Looks up a localized string similar to Mato Grosso (Brazil). /// - internal static string Newfoundland_Time_Zone { + internal static string Mato_Grosso__Brazil_ { get { - return ResourceManager.GetString("Newfoundland Time Zone", resourceCulture); + return ResourceManager.GetString("Mato Grosso (Brazil)", resourceCulture); } } /// - /// Looks up a localized string similar to Nicaragua. + /// Looks up a localized string similar to Mato Grosso do Sul (Brazil). /// - internal static string Nicaragua { + internal static string Mato_Grosso_do_Sul__Brazil_ { get { - return ResourceManager.GetString("Nicaragua", resourceCulture); + return ResourceManager.GetString("Mato Grosso do Sul (Brazil)", resourceCulture); } } /// - /// Looks up a localized string similar to Niger. + /// Looks up a localized string similar to Mauritania. /// - internal static string Niger { + internal static string Mauritania { get { - return ResourceManager.GetString("Niger", resourceCulture); + return ResourceManager.GetString("Mauritania", resourceCulture); } } /// - /// Looks up a localized string similar to Nigeria. + /// Looks up a localized string similar to Mauritius. /// - internal static string Nigeria { + internal static string Mauritius { get { - return ResourceManager.GetString("Nigeria", resourceCulture); + return ResourceManager.GetString("Mauritius", resourceCulture); } } /// - /// Looks up a localized string similar to Niue. + /// Looks up a localized string similar to Mauritius Time. /// - internal static string Niue { + internal static string Mauritius_Time { get { - return ResourceManager.GetString("Niue", resourceCulture); + return ResourceManager.GetString("Mauritius Time", resourceCulture); } } /// - /// Looks up a localized string similar to Niue Time. + /// Looks up a localized string similar to Mawson Station Time. /// - internal static string Niue_Time { + internal static string Mawson_Station_Time { get { - return ResourceManager.GetString("Niue Time", resourceCulture); + return ResourceManager.GetString("Mawson Station Time", resourceCulture); } } /// - /// Looks up a localized string similar to No. + /// Looks up a localized string similar to Mayotte. /// - internal static string No { + internal static string Mayotte { get { - return ResourceManager.GetString("No", resourceCulture); + return ResourceManager.GetString("Mayotte", resourceCulture); } } /// - /// Looks up a localized string similar to Nord-Ubangi (Democratic Republic of the Congo). + /// Looks up a localized string similar to Mexico (most). /// - internal static string Nord_Ubangi__Democratic_Republic_of_the_Congo_ { + internal static string Mexico__most_ { get { - return ResourceManager.GetString("Nord-Ubangi (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Mexico (most)", resourceCulture); } } /// - /// Looks up a localized string similar to North Carolina (United States). + /// Looks up a localized string similar to Michigan (most, United States). /// - internal static string North_Carolina__United_States_ { + internal static string Michigan__most__United_States_ { get { - return ResourceManager.GetString("North Carolina (United States)", resourceCulture); + return ResourceManager.GetString("Michigan (most, United States)", resourceCulture); } } /// - /// Looks up a localized string similar to North Dakota (most, United States). + /// Looks up a localized string similar to Middle European Summer Time. + /// + internal static string Middle_European_Summer_Time { + get { + return ResourceManager.GetString("Middle European Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Middle European Time. + /// + internal static string Middle_European_Time { + get { + return ResourceManager.GetString("Middle European Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Midway Atoll. + /// + internal static string Midway_Atoll { + get { + return ResourceManager.GetString("Midway Atoll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mike Time Zone. + /// + internal static string Mike_Time_Zone { + get { + return ResourceManager.GetString("Mike Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Minnesota (United States). + /// + internal static string Minnesota__United_States_ { + get { + return ResourceManager.GetString("Minnesota (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mishkeegogamang (Canada). + /// + internal static string Mishkeegogamang__Canada_ { + get { + return ResourceManager.GetString("Mishkeegogamang (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mississippi (United States). + /// + internal static string Mississippi__United_States_ { + get { + return ResourceManager.GetString("Mississippi (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missouri (United States). + /// + internal static string Missouri__United_States_ { + get { + return ResourceManager.GetString("Missouri (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Moldova. + /// + internal static string Moldova { + get { + return ResourceManager.GetString("Moldova", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Monaco. + /// + internal static string Monaco { + get { + return ResourceManager.GetString("Monaco", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mongala (Democratic Republic of the Congo). + /// + internal static string Mongala__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Mongala (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mongolia (most). + /// + internal static string Mongolia__most_ { + get { + return ResourceManager.GetString("Mongolia (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Montana (United States). + /// + internal static string Montana__United_States_ { + get { + return ResourceManager.GetString("Montana (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Montenegro. + /// + internal static string Montenegro { + get { + return ResourceManager.GetString("Montenegro", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Montserrat. + /// + internal static string Montserrat { + get { + return ResourceManager.GetString("Montserrat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Morocco. + /// + internal static string Morocco { + get { + return ResourceManager.GetString("Morocco", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Moscow Time. + /// + internal static string Moscow_Time { + get { + return ResourceManager.GetString("Moscow Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mountain Daylight Time. + /// + internal static string Mountain_Daylight_Time { + get { + return ResourceManager.GetString("Mountain Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mountain Standard Time. + /// + internal static string Mountain_Standard_Time { + get { + return ResourceManager.GetString("Mountain Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mountain Time Zone. + /// + internal static string Mountain_Time_Zone { + get { + return ResourceManager.GetString("Mountain Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mozambique. + /// + internal static string Mozambique { + get { + return ResourceManager.GetString("Mozambique", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mundrabilla (Australia). + /// + internal static string Mundrabilla__Australia_ { + get { + return ResourceManager.GetString("Mundrabilla (Australia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Myanmar. + /// + internal static string Myanmar { + get { + return ResourceManager.GetString("Myanmar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Myanmar Standard Time. + /// + internal static string Myanmar_Standard_Time { + get { + return ResourceManager.GetString("Myanmar Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Names. + /// + internal static string Names { + get { + return ResourceManager.GetString("Names", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Namibia. + /// + internal static string Namibia { + get { + return ResourceManager.GetString("Namibia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nauru. + /// + internal static string Nauru { + get { + return ResourceManager.GetString("Nauru", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Navassa Island. + /// + internal static string Navassa_Island { + get { + return ResourceManager.GetString("Navassa Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nayarit (most, Mexico). + /// + internal static string Nayarit__most__Mexico_ { + get { + return ResourceManager.GetString("Nayarit (most, Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Near Islands (United States). + /// + internal static string Near_Islands__United_States_ { + get { + return ResourceManager.GetString("Near Islands (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nebraska (most, United States). + /// + internal static string Nebraska__most__United_States_ { + get { + return ResourceManager.GetString("Nebraska (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nepal. + /// + internal static string Nepal { + get { + return ResourceManager.GetString("Nepal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nepal Standard Time. + /// + internal static string Nepal_Standard_Time { + get { + return ResourceManager.GetString("Nepal Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Netherlands (European). + /// + internal static string Netherlands__European_ { + get { + return ResourceManager.GetString("Netherlands (European)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nevada (United States). + /// + internal static string Nevada__United_States_ { + get { + return ResourceManager.GetString("Nevada (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Brunswick (Canada). + /// + internal static string New_Brunswick__Canada_ { + get { + return ResourceManager.GetString("New Brunswick (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Caledonia. + /// + internal static string New_Caledonia { + get { + return ResourceManager.GetString("New Caledonia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Caledonia Time. + /// + internal static string New_Caledonia_Time { + get { + return ResourceManager.GetString("New Caledonia Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Hampshire (United States). + /// + internal static string New_Hampshire__United_States_ { + get { + return ResourceManager.GetString("New Hampshire (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Jersey (United States). + /// + internal static string New_Jersey__United_States_ { + get { + return ResourceManager.GetString("New Jersey (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Mexico (United States). + /// + internal static string New_Mexico__United_States_ { + get { + return ResourceManager.GetString("New Mexico (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New South Wales (most, Australia). + /// + internal static string New_South_Wales__most__Australia_ { + get { + return ResourceManager.GetString("New South Wales (most, Australia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New York (United States). + /// + internal static string New_York__United_States_ { + get { + return ResourceManager.GetString("New York (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Zealand. + /// + internal static string New_Zealand { + get { + return ResourceManager.GetString("New Zealand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Zealand Daylight Time. + /// + internal static string New_Zealand_Daylight_Time { + get { + return ResourceManager.GetString("New Zealand Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Zealand Standard Time. + /// + internal static string New_Zealand_Standard_Time { + get { + return ResourceManager.GetString("New Zealand Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Newfoundland (Canada). + /// + internal static string Newfoundland__Canada_ { + get { + return ResourceManager.GetString("Newfoundland (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Newfoundland Daylight Time. + /// + internal static string Newfoundland_Daylight_Time { + get { + return ResourceManager.GetString("Newfoundland Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Newfoundland Standard Time. + /// + internal static string Newfoundland_Standard_Time { + get { + return ResourceManager.GetString("Newfoundland Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Newfoundland Time Zone. + /// + internal static string Newfoundland_Time_Zone { + get { + return ResourceManager.GetString("Newfoundland Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nicaragua. + /// + internal static string Nicaragua { + get { + return ResourceManager.GetString("Nicaragua", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Niger. + /// + internal static string Niger { + get { + return ResourceManager.GetString("Niger", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nigeria. + /// + internal static string Nigeria { + get { + return ResourceManager.GetString("Nigeria", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Niue. + /// + internal static string Niue { + get { + return ResourceManager.GetString("Niue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Niue Time. + /// + internal static string Niue_Time { + get { + return ResourceManager.GetString("Niue Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + internal static string No { + get { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nord-Ubangi (Democratic Republic of the Congo). + /// + internal static string Nord_Ubangi__Democratic_Republic_of_the_Congo_ { + get { + return ResourceManager.GetString("Nord-Ubangi (Democratic Republic of the Congo)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Norfolk Island. + /// + internal static string Norfolk_Island { + get { + return ResourceManager.GetString("Norfolk Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Norfolk Island Time. + /// + internal static string Norfolk_Island_Time { + get { + return ResourceManager.GetString("Norfolk Island Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Carolina (United States). + /// + internal static string North_Carolina__United_States_ { + get { + return ResourceManager.GetString("North Carolina (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Dakota (most, United States). /// internal static string North_Dakota__most__United_States_ { get { - return ResourceManager.GetString("North Dakota (most, United States)", resourceCulture); + return ResourceManager.GetString("North Dakota (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Kalimantan (Indonesia). + /// + internal static string North_Kalimantan__Indonesia_ { + get { + return ResourceManager.GetString("North Kalimantan (Indonesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Korea. + /// + internal static string North_Korea { + get { + return ResourceManager.GetString("North Korea", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Macedonia. + /// + internal static string North_Macedonia { + get { + return ResourceManager.GetString("North Macedonia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to North Maluku (Indonesia). + /// + internal static string North_Maluku__Indonesia_ { + get { + return ResourceManager.GetString("North Maluku (Indonesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Northern Cyprus. + /// + internal static string Northern_Cyprus { + get { + return ResourceManager.GetString("Northern Cyprus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Northern Mariana Islands. + /// + internal static string Northern_Mariana_Islands { + get { + return ResourceManager.GetString("Northern Mariana Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Northern Territory. + /// + internal static string Northern_Territory { + get { + return ResourceManager.GetString("Northern Territory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Northwest Territories (Canada). + /// + internal static string Northwest_Territories__Canada_ { + get { + return ResourceManager.GetString("Northwest Territories (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Norway. + /// + internal static string Norway { + get { + return ResourceManager.GetString("Norway", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nova Scotia (Canada). + /// + internal static string Nova_Scotia__Canada_ { + get { + return ResourceManager.GetString("Nova Scotia (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to November Time Zone. + /// + internal static string November_Time_Zone { + get { + return ResourceManager.GetString("November Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Novosibirsk (Russia). + /// + internal static string Novosibirsk__Russia_ { + get { + return ResourceManager.GetString("Novosibirsk (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Novosibirsk Time. + /// + internal static string Novosibirsk_Time { + get { + return ResourceManager.GetString("Novosibirsk Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nunavut (central, Canada). + /// + internal static string Nunavut__central__Canada_ { + get { + return ResourceManager.GetString("Nunavut (central, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nunavut (east, Canada). + /// + internal static string Nunavut__east__Canada_ { + get { + return ResourceManager.GetString("Nunavut (east, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nunavut (west, Canada). + /// + internal static string Nunavut__west__Canada_ { + get { + return ResourceManager.GetString("Nunavut (west, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Offset. + /// + internal static string Offset { + get { + return ResourceManager.GetString("Offset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ohio (United States). + /// + internal static string Ohio__United_States_ { + get { + return ResourceManager.GetString("Ohio (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Oklahoma, United States. + /// + internal static string Oklahoma__United_States { + get { + return ResourceManager.GetString("Oklahoma, United States", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Oman. + /// + internal static string Oman { + get { + return ResourceManager.GetString("Oman", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Omsk (Russia). + /// + internal static string Omsk__Russia_ { + get { + return ResourceManager.GetString("Omsk (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Omsk Time. + /// + internal static string Omsk_Time { + get { + return ResourceManager.GetString("Omsk Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ontario (most, Canada). + /// + internal static string Ontario__most__Canada_ { + get { + return ResourceManager.GetString("Ontario (most, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ontario (west, Canada). + /// + internal static string Ontario__west__Canada_ { + get { + return ResourceManager.GetString("Ontario (west, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Oral Time. + /// + internal static string Oral_Time { + get { + return ResourceManager.GetString("Oral Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Oregon (most, United States). + /// + internal static string Oregon__most__United_States_ { + get { + return ResourceManager.GetString("Oregon (most, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Orenburg (Russia). + /// + internal static string Orenburg__Russia_ { + get { + return ResourceManager.GetString("Orenburg (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Oscar Time Zone. + /// + internal static string Oscar_Time_Zone { + get { + return ResourceManager.GetString("Oscar Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pacific Daylight Time. + /// + internal static string Pacific_Daylight_Time { + get { + return ResourceManager.GetString("Pacific Daylight Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pacific Standard Time. + /// + internal static string Pacific_Standard_Time { + get { + return ResourceManager.GetString("Pacific Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pacific Time Zone. + /// + internal static string Pacific_Time_Zone { + get { + return ResourceManager.GetString("Pacific Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pacific Time Zone. + /// + internal static string Pacific_Time_Zonev { + get { + return ResourceManager.GetString("Pacific Time Zonev", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pakistan. + /// + internal static string Pakistan { + get { + return ResourceManager.GetString("Pakistan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pakistan Standard Time. + /// + internal static string Pakistan_Standard_Time { + get { + return ResourceManager.GetString("Pakistan Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Palau. + /// + internal static string Palau { + get { + return ResourceManager.GetString("Palau", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Palau Time. + /// + internal static string Palau_Time { + get { + return ResourceManager.GetString("Palau Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Palestine. + /// + internal static string Palestine { + get { + return ResourceManager.GetString("Palestine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Palmyra Atoll. + /// + internal static string Palmyra_Atoll { + get { + return ResourceManager.GetString("Palmyra Atoll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Panama. + /// + internal static string Panama { + get { + return ResourceManager.GetString("Panama", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Papa Time Zone. + /// + internal static string Papa_Time_Zone { + get { + return ResourceManager.GetString("Papa Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Papua (Indonesia). + /// + internal static string Papua__Indonesia_ { + get { + return ResourceManager.GetString("Papua (Indonesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Papua New Guinea (most). + /// + internal static string Papua_New_Guinea__most_ { + get { + return ResourceManager.GetString("Papua New Guinea (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Papua New Guinea Time. + /// + internal static string Papua_New_Guinea_Time { + get { + return ResourceManager.GetString("Papua New Guinea Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paraguay. + /// + internal static string Paraguay { + get { + return ResourceManager.GetString("Paraguay", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paraguay Summer Time. + /// + internal static string Paraguay_Summer_Time { + get { + return ResourceManager.GetString("Paraguay Summer Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paraguay Time. + /// + internal static string Paraguay_Time { + get { + return ResourceManager.GetString("Paraguay Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pennsylvania (United States). + /// + internal static string Pennsylvania__United_States_ { + get { + return ResourceManager.GetString("Pennsylvania (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Perm (Russia). + /// + internal static string Perm__Russia_ { + get { + return ResourceManager.GetString("Perm (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Peru. + /// + internal static string Peru { + get { + return ResourceManager.GetString("Peru", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Peru Time. + /// + internal static string Peru_Time { + get { + return ResourceManager.GetString("Peru Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Philippine Standard Time. + /// + internal static string Philippine_Standard_Time { + get { + return ResourceManager.GetString("Philippine Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Philippine Time. + /// + internal static string Philippine_Time { + get { + return ResourceManager.GetString("Philippine Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Philippines. + /// + internal static string Philippines { + get { + return ResourceManager.GetString("Philippines", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Phoenix Island Time. + /// + internal static string Phoenix_Island_Time { + get { + return ResourceManager.GetString("Phoenix Island Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Phoenix Islands (Kiribati). + /// + internal static string Phoenix_Islands__Kiribati_ { + get { + return ResourceManager.GetString("Phoenix Islands (Kiribati)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pitcairn Islands. + /// + internal static string Pitcairn_Islands { + get { + return ResourceManager.GetString("Pitcairn Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pitt Islands (New Zealand). + /// + internal static string Pitt_Islands__New_Zealand_ { + get { + return ResourceManager.GetString("Pitt Islands (New Zealand)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gets the the current time of a time zone. + /// + internal static string PluginDescription { + get { + return ResourceManager.GetString("PluginDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Time zone. + /// + internal static string PluginTitle { + get { + return ResourceManager.GetString("PluginTitle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pohnpei (Micronesia). + /// + internal static string Pohnpei__Micronesia_ { + get { + return ResourceManager.GetString("Pohnpei (Micronesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pohnpei Standard Time. + /// + internal static string Pohnpei_Standard_Time { + get { + return ResourceManager.GetString("Pohnpei Standard Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Poland. + /// + internal static string Poland { + get { + return ResourceManager.GetString("Poland", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Portugal (most). + /// + internal static string Portugal__most_ { + get { + return ResourceManager.GetString("Portugal (most)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primorsky (Russia). + /// + internal static string Primorsky__Russia_ { + get { + return ResourceManager.GetString("Primorsky (Russia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Prince Edward Island (Canada). + /// + internal static string Prince_Edward_Island__Canada_ { + get { + return ResourceManager.GetString("Prince Edward Island (Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Prince Edward Islands (South Africa). + /// + internal static string Prince_Edward_Islands__South_Africa_ { + get { + return ResourceManager.GetString("Prince Edward Islands (South Africa)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Puerto Rico. + /// + internal static string Puerto_Rico { + get { + return ResourceManager.GetString("Puerto Rico", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Qatar. + /// + internal static string Qatar { + get { + return ResourceManager.GetString("Qatar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quebec (east, Canada). + /// + internal static string Quebec__east__Canada_ { + get { + return ResourceManager.GetString("Quebec (east, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quebec (most, Canada). + /// + internal static string Quebec__most__Canada_ { + get { + return ResourceManager.GetString("Quebec (most, Canada)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quebec Time Zone. + /// + internal static string Quebec_Time_Zone { + get { + return ResourceManager.GetString("Quebec Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Queensland (Australia). + /// + internal static string Queensland__Australia_ { + get { + return ResourceManager.GetString("Queensland (Australia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Quintana Roo (Mexico). + /// + internal static string Quintana_Roo__Mexico_ { + get { + return ResourceManager.GetString("Quintana Roo (Mexico)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rat Islands (Aleutian Islands, Alaska, United States). + /// + internal static string Rat_Islands__Aleutian_Islands__Alaska__United_States_ { + get { + return ResourceManager.GetString("Rat Islands (Aleutian Islands, Alaska, United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Réunion. + /// + internal static string Réunion { + get { + return ResourceManager.GetString("Réunion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Réunion Time. + /// + internal static string Réunion_Time { + get { + return ResourceManager.GetString("Réunion Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rhode Island (United States). + /// + internal static string Rhode_Island__United_States_ { + get { + return ResourceManager.GetString("Rhode Island (United States)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Romania. + /// + internal static string Romania { + get { + return ResourceManager.GetString("Romania", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Romeo Time Zone. + /// + internal static string Romeo_Time_Zone { + get { + return ResourceManager.GetString("Romeo Time Zone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rondônia (Brazil). + /// + internal static string Rondônia__Brazil_ { + get { + return ResourceManager.GetString("Rondônia (Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Roraima (Brazil). + /// + internal static string Roraima__Brazil_ { + get { + return ResourceManager.GetString("Roraima (Brazil)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rothera Research Station Time. + /// + internal static string Rothera_Research_Station_Time { + get { + return ResourceManager.GetString("Rothera Research Station Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Russia (most of European part). + /// + internal static string Russia__most_of_European_part_ { + get { + return ResourceManager.GetString("Russia (most of European part)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rwanda. + /// + internal static string Rwanda { + get { + return ResourceManager.GetString("Rwanda", resourceCulture); } } /// - /// Looks up a localized string similar to North Macedonia. + /// Looks up a localized string similar to Saint Barthélemy. /// - internal static string North_Macedonia { + internal static string Saint_Barthélemy { get { - return ResourceManager.GetString("North Macedonia", resourceCulture); + return ResourceManager.GetString("Saint Barthélemy", resourceCulture); } } /// - /// Looks up a localized string similar to Northern Cyprus. + /// Looks up a localized string similar to Saint Helena. /// - internal static string Northern_Cyprus { + internal static string Saint_Helena { get { - return ResourceManager.GetString("Northern Cyprus", resourceCulture); + return ResourceManager.GetString("Saint Helena", resourceCulture); } } /// - /// Looks up a localized string similar to Northwest Territories (Canada). + /// Looks up a localized string similar to Saint Kitts and Nevis. /// - internal static string Northwest_Territories__Canada_ { + internal static string Saint_Kitts_and_Nevis { get { - return ResourceManager.GetString("Northwest Territories (Canada)", resourceCulture); + return ResourceManager.GetString("Saint Kitts and Nevis", resourceCulture); } } /// - /// Looks up a localized string similar to Norway. + /// Looks up a localized string similar to Saint Lucia. /// - internal static string Norway { + internal static string Saint_Lucia { get { - return ResourceManager.GetString("Norway", resourceCulture); + return ResourceManager.GetString("Saint Lucia", resourceCulture); } } /// - /// Looks up a localized string similar to Nova Scotia (Canada). + /// Looks up a localized string similar to Saint Martin. /// - internal static string Nova_Scotia__Canada_ { + internal static string Saint_Martin { get { - return ResourceManager.GetString("Nova Scotia (Canada)", resourceCulture); + return ResourceManager.GetString("Saint Martin", resourceCulture); } } /// - /// Looks up a localized string similar to November Time Zone. + /// Looks up a localized string similar to Saint Paul Island (French Southern and Antarctic Lands). /// - internal static string November_Time_Zone { + internal static string Saint_Paul_Island__French_Southern_and_Antarctic_Lands_ { get { - return ResourceManager.GetString("November Time Zone", resourceCulture); + return ResourceManager.GetString("Saint Paul Island (French Southern and Antarctic Lands)", resourceCulture); } } /// - /// Looks up a localized string similar to Nunavut (central, Canada). + /// Looks up a localized string similar to Saint Pierre and Miquelon. /// - internal static string Nunavut__central__Canada_ { + internal static string Saint_Pierre_and_Miquelon { get { - return ResourceManager.GetString("Nunavut (central, Canada)", resourceCulture); + return ResourceManager.GetString("Saint Pierre and Miquelon", resourceCulture); } } /// - /// Looks up a localized string similar to Nunavut (east, Canada). + /// Looks up a localized string similar to Saint Pierre and Miquelon Daylight Time. /// - internal static string Nunavut__east__Canada_ { + internal static string Saint_Pierre_and_Miquelon_Daylight_Time { get { - return ResourceManager.GetString("Nunavut (east, Canada)", resourceCulture); + return ResourceManager.GetString("Saint Pierre and Miquelon Daylight Time", resourceCulture); } } /// - /// Looks up a localized string similar to Nunavut (west, Canada). + /// Looks up a localized string similar to Saint Pierre and Miquelon Standard Time. /// - internal static string Nunavut__west__Canada_ { + internal static string Saint_Pierre_and_Miquelon_Standard_Time { get { - return ResourceManager.GetString("Nunavut (west, Canada)", resourceCulture); + return ResourceManager.GetString("Saint Pierre and Miquelon Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Offset. + /// Looks up a localized string similar to Saint Vincent and the Grenadines. /// - internal static string Offset { + internal static string Saint_Vincent_and_the_Grenadines { get { - return ResourceManager.GetString("Offset", resourceCulture); + return ResourceManager.GetString("Saint Vincent and the Grenadines", resourceCulture); } } /// - /// Looks up a localized string similar to Ohio (United States). + /// Looks up a localized string similar to Sakha (central-east, Russia). /// - internal static string Ohio__United_States_ { + internal static string Sakha__central_east__Russia_ { get { - return ResourceManager.GetString("Ohio (United States)", resourceCulture); + return ResourceManager.GetString("Sakha (central-east, Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Oklahoma, United States. + /// Looks up a localized string similar to Sakha (east, Russia). /// - internal static string Oklahoma__United_States { + internal static string Sakha__east__Russia_ { get { - return ResourceManager.GetString("Oklahoma, United States", resourceCulture); + return ResourceManager.GetString("Sakha (east, Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Ontario (most, Canada). + /// Looks up a localized string similar to Sakha (most, Russia). /// - internal static string Ontario__most__Canada_ { + internal static string Sakha__most__Russia_ { get { - return ResourceManager.GetString("Ontario (most, Canada)", resourceCulture); + return ResourceManager.GetString("Sakha (most, Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Ontario (west, Canada). + /// Looks up a localized string similar to Sakhalin (Russia). /// - internal static string Ontario__west__Canada_ { + internal static string Sakhalin__Russia_ { get { - return ResourceManager.GetString("Ontario (west, Canada)", resourceCulture); + return ResourceManager.GetString("Sakhalin (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Oregon (most, United States). + /// Looks up a localized string similar to Sakhalin Island Time. /// - internal static string Oregon__most__United_States_ { + internal static string Sakhalin_Island_Time { get { - return ResourceManager.GetString("Oregon (most, United States)", resourceCulture); + return ResourceManager.GetString("Sakhalin Island Time", resourceCulture); } } /// - /// Looks up a localized string similar to Oscar Time Zone. + /// Looks up a localized string similar to Samara (Russia). /// - internal static string Oscar_Time_Zone { + internal static string Samara__Russia_ { get { - return ResourceManager.GetString("Oscar Time Zone", resourceCulture); + return ResourceManager.GetString("Samara (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Pacific Daylight Time. + /// Looks up a localized string similar to Samara Time. /// - internal static string Pacific_Daylight_Time { + internal static string Samara_Time { get { - return ResourceManager.GetString("Pacific Daylight Time", resourceCulture); + return ResourceManager.GetString("Samara Time", resourceCulture); } } /// - /// Looks up a localized string similar to Pacific Standard Time. + /// Looks up a localized string similar to Samoa. /// - internal static string Pacific_Standard_Time { + internal static string Samoa { get { - return ResourceManager.GetString("Pacific Standard Time", resourceCulture); + return ResourceManager.GetString("Samoa", resourceCulture); } } /// - /// Looks up a localized string similar to Pacific Time Zone. + /// Looks up a localized string similar to Samoa Daylight Time. /// - internal static string Pacific_Time_Zonev { + internal static string Samoa_Daylight_Time { get { - return ResourceManager.GetString("Pacific Time Zonev", resourceCulture); + return ResourceManager.GetString("Samoa Daylight Time", resourceCulture); } } /// - /// Looks up a localized string similar to Palestine. + /// Looks up a localized string similar to Samoa Standard Time. /// - internal static string Palestine { + internal static string Samoa_Standard_Time { get { - return ResourceManager.GetString("Palestine", resourceCulture); + return ResourceManager.GetString("Samoa Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Palmyra Atoll. + /// Looks up a localized string similar to Samoa Time Zone. /// - internal static string Palmyra_Atoll { + internal static string Samoa_Time_Zone { get { - return ResourceManager.GetString("Palmyra Atoll", resourceCulture); + return ResourceManager.GetString("Samoa Time Zone", resourceCulture); } } /// - /// Looks up a localized string similar to Panama. + /// Looks up a localized string similar to San Marino. /// - internal static string Panama { + internal static string San_Marino { get { - return ResourceManager.GetString("Panama", resourceCulture); + return ResourceManager.GetString("San Marino", resourceCulture); } } /// - /// Looks up a localized string similar to Papa Time Zone. + /// Looks up a localized string similar to São Tomé and Príncipe. /// - internal static string Papa_Time_Zone { + internal static string São_Tomé_and_Príncipe { get { - return ResourceManager.GetString("Papa Time Zone", resourceCulture); + return ResourceManager.GetString("São Tomé and Príncipe", resourceCulture); } } /// - /// Looks up a localized string similar to Paraguay. + /// Looks up a localized string similar to Saratov (Russia). /// - internal static string Paraguay { + internal static string Saratov__Russia_ { get { - return ResourceManager.GetString("Paraguay", resourceCulture); + return ResourceManager.GetString("Saratov (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Paraguay Summer Time. + /// Looks up a localized string similar to Saskatchewan (most, Canada). /// - internal static string Paraguay_Summer_Time { + internal static string Saskatchewan__most__Canada_ { get { - return ResourceManager.GetString("Paraguay Summer Time", resourceCulture); + return ResourceManager.GetString("Saskatchewan (most, Canada)", resourceCulture); } } /// - /// Looks up a localized string similar to Paraguay Time. + /// Looks up a localized string similar to Saudi Arabia. /// - internal static string Paraguay_Time { + internal static string Saudi_Arabia { get { - return ResourceManager.GetString("Paraguay Time", resourceCulture); + return ResourceManager.GetString("Saudi Arabia", resourceCulture); } } /// - /// Looks up a localized string similar to Pennsylvania (United States). + /// Looks up a localized string similar to Scattered Islands (French Southern and Antarctic Lands). /// - internal static string Pennsylvania__United_States_ { + internal static string Scattered_Islands__French_Southern_and_Antarctic_Lands_ { get { - return ResourceManager.GetString("Pennsylvania (United States)", resourceCulture); + return ResourceManager.GetString("Scattered Islands (French Southern and Antarctic Lands)", resourceCulture); } } /// - /// Looks up a localized string similar to Peru. + /// Looks up a localized string similar to Senegal. /// - internal static string Peru { + internal static string Senegal { get { - return ResourceManager.GetString("Peru", resourceCulture); + return ResourceManager.GetString("Senegal", resourceCulture); } } /// - /// Looks up a localized string similar to Peru Time. + /// Looks up a localized string similar to Serbia. /// - internal static string Peru_Time { + internal static string Serbia { get { - return ResourceManager.GetString("Peru Time", resourceCulture); + return ResourceManager.GetString("Serbia", resourceCulture); } } /// - /// Looks up a localized string similar to Pitcairn Islands. + /// Looks up a localized string similar to Seychelles. /// - internal static string Pitcairn_Islands { + internal static string Seychelles { get { - return ResourceManager.GetString("Pitcairn Islands", resourceCulture); + return ResourceManager.GetString("Seychelles", resourceCulture); } } /// - /// Looks up a localized string similar to Gets the the current time of a time zone. + /// Looks up a localized string similar to Seychelles Time. /// - internal static string PluginDescription { + internal static string Seychelles_Time { get { - return ResourceManager.GetString("PluginDescription", resourceCulture); + return ResourceManager.GetString("Seychelles Time", resourceCulture); } } /// - /// Looks up a localized string similar to Time zone. + /// Looks up a localized string similar to Shortcuts. /// - internal static string PluginTitle { + internal static string Shortcuts { get { - return ResourceManager.GetString("PluginTitle", resourceCulture); + return ResourceManager.GetString("Shortcuts", resourceCulture); } } /// - /// Looks up a localized string similar to Poland. + /// Looks up a localized string similar to Showa Station Time. /// - internal static string Poland { + internal static string Showa_Station_Time { get { - return ResourceManager.GetString("Poland", resourceCulture); + return ResourceManager.GetString("Showa Station Time", resourceCulture); } } /// - /// Looks up a localized string similar to Portugal (most). + /// Looks up a localized string similar to Show military time zone names. /// - internal static string Portugal__most_ { + internal static string ShowMilitaryTimeZoneNames { get { - return ResourceManager.GetString("Portugal (most)", resourceCulture); + return ResourceManager.GetString("ShowMilitaryTimeZoneNames", resourceCulture); } } /// - /// Looks up a localized string similar to Prince Edward Island (Canada). + /// Looks up a localized string similar to Show time names. /// - internal static string Prince_Edward_Island__Canada_ { + internal static string ShowTimeNames { get { - return ResourceManager.GetString("Prince Edward Island (Canada)", resourceCulture); + return ResourceManager.GetString("ShowTimeNames", resourceCulture); } } /// - /// Looks up a localized string similar to Prince Edward Islands (South Africa). + /// Looks up a localized string similar to Show time zone names. /// - internal static string Prince_Edward_Islands__South_Africa_ { + internal static string ShowTimeZoneNames { get { - return ResourceManager.GetString("Prince Edward Islands (South Africa)", resourceCulture); + return ResourceManager.GetString("ShowTimeZoneNames", resourceCulture); } } /// - /// Looks up a localized string similar to Puerto Rico. + /// Looks up a localized string similar to Sierra Leone. /// - internal static string Puerto_Rico { + internal static string Sierra_Leone { get { - return ResourceManager.GetString("Puerto Rico", resourceCulture); + return ResourceManager.GetString("Sierra Leone", resourceCulture); } } /// - /// Looks up a localized string similar to Qatar. + /// Looks up a localized string similar to Sierra Time Zone. /// - internal static string Qatar { + internal static string Sierra_Time_Zone { get { - return ResourceManager.GetString("Qatar", resourceCulture); + return ResourceManager.GetString("Sierra Time Zone", resourceCulture); } } /// - /// Looks up a localized string similar to Quebec (east, Canada). + /// Looks up a localized string similar to Sinaloa (Mexico). /// - internal static string Quebec__east__Canada_ { + internal static string Sinaloa__Mexico_ { get { - return ResourceManager.GetString("Quebec (east, Canada)", resourceCulture); + return ResourceManager.GetString("Sinaloa (Mexico)", resourceCulture); } } /// - /// Looks up a localized string similar to Quebec (most, Canada). + /// Looks up a localized string similar to Singapore. /// - internal static string Quebec__most__Canada_ { + internal static string Singapore { get { - return ResourceManager.GetString("Quebec (most, Canada)", resourceCulture); + return ResourceManager.GetString("Singapore", resourceCulture); } } /// - /// Looks up a localized string similar to Quebec Time Zone. + /// Looks up a localized string similar to Singapore Standard Time. /// - internal static string Quebec_Time_Zone { + internal static string Singapore_Standard_Time { get { - return ResourceManager.GetString("Quebec Time Zone", resourceCulture); + return ResourceManager.GetString("Singapore Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Quintana Roo (Mexico). + /// Looks up a localized string similar to Singapore Time. /// - internal static string Quintana_Roo__Mexico_ { + internal static string Singapore_Time { get { - return ResourceManager.GetString("Quintana Roo (Mexico)", resourceCulture); + return ResourceManager.GetString("Singapore Time", resourceCulture); } } /// - /// Looks up a localized string similar to Rat Islands (Aleutian Islands, Alaska, United States). + /// Looks up a localized string similar to Sint Maarten. /// - internal static string Rat_Islands__Aleutian_Islands__Alaska__United_States_ { + internal static string Sint_Maarten { get { - return ResourceManager.GetString("Rat Islands (Aleutian Islands, Alaska, United States)", resourceCulture); + return ResourceManager.GetString("Sint Maarten", resourceCulture); } } /// - /// Looks up a localized string similar to Rhode Island (United States). + /// Looks up a localized string similar to Slovakia. /// - internal static string Rhode_Island__United_States_ { + internal static string Slovakia { get { - return ResourceManager.GetString("Rhode Island (United States)", resourceCulture); + return ResourceManager.GetString("Slovakia", resourceCulture); } } /// - /// Looks up a localized string similar to Romania. + /// Looks up a localized string similar to Slovenia. + /// + internal static string Slovenia { + get { + return ResourceManager.GetString("Slovenia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Solomon Islands. + /// + internal static string Solomon_Islands { + get { + return ResourceManager.GetString("Solomon Islands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Solomon Islands Time. + /// + internal static string Solomon_Islands_Time { + get { + return ResourceManager.GetString("Solomon Islands Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Somalia. + /// + internal static string Somalia { + get { + return ResourceManager.GetString("Somalia", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Somaliland. /// - internal static string Romania { + internal static string Somaliland { get { - return ResourceManager.GetString("Romania", resourceCulture); + return ResourceManager.GetString("Somaliland", resourceCulture); } } /// - /// Looks up a localized string similar to Romeo Time Zone. + /// Looks up a localized string similar to Sonora (Mexico). /// - internal static string Romeo_Time_Zone { + internal static string Sonora__Mexico_ { get { - return ResourceManager.GetString("Romeo Time Zone", resourceCulture); + return ResourceManager.GetString("Sonora (Mexico)", resourceCulture); } } /// - /// Looks up a localized string similar to Rondônia (Brazil). + /// Looks up a localized string similar to South Africa (most). /// - internal static string Rondônia__Brazil_ { + internal static string South_Africa__most_ { get { - return ResourceManager.GetString("Rondônia (Brazil)", resourceCulture); + return ResourceManager.GetString("South Africa (most)", resourceCulture); } } /// - /// Looks up a localized string similar to Roraima (Brazil). + /// Looks up a localized string similar to South African Standard Time. /// - internal static string Roraima__Brazil_ { + internal static string South_African_Standard_Time { get { - return ResourceManager.GetString("Roraima (Brazil)", resourceCulture); + return ResourceManager.GetString("South African Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Rothera Research Station Time. + /// Looks up a localized string similar to South Australia (Australia). /// - internal static string Rothera_Research_Station_Time { + internal static string South_Australia__Australia_ { get { - return ResourceManager.GetString("Rothera Research Station Time", resourceCulture); + return ResourceManager.GetString("South Australia (Australia)", resourceCulture); } } /// - /// Looks up a localized string similar to Russia (most of European part). + /// Looks up a localized string similar to South Carolina (United States). /// - internal static string Russia__most_of_European_part_ { + internal static string South_Carolina__United_States_ { get { - return ResourceManager.GetString("Russia (most of European part)", resourceCulture); + return ResourceManager.GetString("South Carolina (United States)", resourceCulture); } } /// - /// Looks up a localized string similar to Rwanda. + /// Looks up a localized string similar to South Dakota (most, United States). /// - internal static string Rwanda { + internal static string South_Dakota__most__United_States_ { get { - return ResourceManager.GetString("Rwanda", resourceCulture); + return ResourceManager.GetString("South Dakota (most, United States)", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Barthélemy. + /// Looks up a localized string similar to South East Island (New Zealand). /// - internal static string Saint_Barthélemy { + internal static string South_East_Island__New_Zealand_ { get { - return ResourceManager.GetString("Saint Barthélemy", resourceCulture); + return ResourceManager.GetString("South East Island (New Zealand)", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Helena. + /// Looks up a localized string similar to South Georgia and the South Sandwich Islands. /// - internal static string Saint_Helena { + internal static string South_Georgia_and_the_South_Sandwich_Islands { get { - return ResourceManager.GetString("Saint Helena", resourceCulture); + return ResourceManager.GetString("South Georgia and the South Sandwich Islands", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Kitts and Nevis. + /// Looks up a localized string similar to South Georgia and the South Sandwich Islands Time. /// - internal static string Saint_Kitts_and_Nevis { + internal static string South_Georgia_and_the_South_Sandwich_Islands_Time { get { - return ResourceManager.GetString("Saint Kitts and Nevis", resourceCulture); + return ResourceManager.GetString("South Georgia and the South Sandwich Islands Time", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Lucia. + /// Looks up a localized string similar to South Kalimantan (Indonesia). /// - internal static string Saint_Lucia { + internal static string South_Kalimantan__Indonesia_ { get { - return ResourceManager.GetString("Saint Lucia", resourceCulture); + return ResourceManager.GetString("South Kalimantan (Indonesia)", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Martin. + /// Looks up a localized string similar to South Korea. /// - internal static string Saint_Martin { + internal static string South_Korea { get { - return ResourceManager.GetString("Saint Martin", resourceCulture); + return ResourceManager.GetString("South Korea", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Pierre and Miquelon. + /// Looks up a localized string similar to South Ossetia. /// - internal static string Saint_Pierre_and_Miquelon { + internal static string South_Ossetia { get { - return ResourceManager.GetString("Saint Pierre and Miquelon", resourceCulture); + return ResourceManager.GetString("South Ossetia", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Pierre and Miquelon Daylight Time. + /// Looks up a localized string similar to South Sudan. /// - internal static string Saint_Pierre_and_Miquelon_Daylight_Time { + internal static string South_Sudan { get { - return ResourceManager.GetString("Saint Pierre and Miquelon Daylight Time", resourceCulture); + return ResourceManager.GetString("South Sudan", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Pierre and Miquelon Standard Time. + /// Looks up a localized string similar to Southampton Island (Canada). /// - internal static string Saint_Pierre_and_Miquelon_Standard_Time { + internal static string Southampton_Island__Canada_ { get { - return ResourceManager.GetString("Saint Pierre and Miquelon Standard Time", resourceCulture); + return ResourceManager.GetString("Southampton Island (Canada)", resourceCulture); } } /// - /// Looks up a localized string similar to Saint Vincent and the Grenadines. + /// Looks up a localized string similar to Spain (most). /// - internal static string Saint_Vincent_and_the_Grenadines { + internal static string Spain__most_ { get { - return ResourceManager.GetString("Saint Vincent and the Grenadines", resourceCulture); + return ResourceManager.GetString("Spain (most)", resourceCulture); } } /// - /// Looks up a localized string similar to Samoa Standard Time. + /// Looks up a localized string similar to Srednekolymsk Time. /// - internal static string Samoa_Standard_Time { + internal static string Srednekolymsk_Time { get { - return ResourceManager.GetString("Samoa Standard Time", resourceCulture); + return ResourceManager.GetString("Srednekolymsk Time", resourceCulture); } } /// - /// Looks up a localized string similar to Samoa Time Zone. + /// Looks up a localized string similar to Sri Lanka. /// - internal static string Samoa_Time_Zone { + internal static string Sri_Lanka { get { - return ResourceManager.GetString("Samoa Time Zone", resourceCulture); + return ResourceManager.GetString("Sri Lanka", resourceCulture); } } /// - /// Looks up a localized string similar to San Marino. + /// Looks up a localized string similar to Sri Lanka Standard Time. /// - internal static string San_Marino { + internal static string Sri_Lanka_Standard_Time { get { - return ResourceManager.GetString("San Marino", resourceCulture); + return ResourceManager.GetString("Sri Lanka Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to São Tomé and Príncipe. + /// Looks up a localized string similar to Standard Time. /// - internal static string São_Tomé_and_Príncipe { + internal static string StandardTime { get { - return ResourceManager.GetString("São Tomé and Príncipe", resourceCulture); + return ResourceManager.GetString("StandardTime", resourceCulture); } } /// - /// Looks up a localized string similar to Saskatchewan (most, Canada). + /// Looks up a localized string similar to ST. /// - internal static string Saskatchewan__most__Canada_ { + internal static string StandardTimeShortcut { get { - return ResourceManager.GetString("Saskatchewan (most, Canada)", resourceCulture); + return ResourceManager.GetString("StandardTimeShortcut", resourceCulture); } } /// - /// Looks up a localized string similar to Saudi Arabia. + /// Looks up a localized string similar to Star Keys (New Zealand). /// - internal static string Saudi_Arabia { + internal static string Star_Keys__New_Zealand_ { get { - return ResourceManager.GetString("Saudi Arabia", resourceCulture); + return ResourceManager.GetString("Star Keys (New Zealand)", resourceCulture); } } /// - /// Looks up a localized string similar to Scattered Islands (French Southern and Antarctic Lands). + /// Looks up a localized string similar to Sud-Ubangi (Democratic Republic of the Congo). /// - internal static string Scattered_Islands__French_Southern_and_Antarctic_Lands_ { + internal static string Sud_Ubangi__Democratic_Republic_of_the_Congo_ { get { - return ResourceManager.GetString("Scattered Islands (French Southern and Antarctic Lands)", resourceCulture); + return ResourceManager.GetString("Sud-Ubangi (Democratic Republic of the Congo)", resourceCulture); } } /// - /// Looks up a localized string similar to Senegal. + /// Looks up a localized string similar to Sudan. /// - internal static string Senegal { + internal static string Sudan { get { - return ResourceManager.GetString("Senegal", resourceCulture); + return ResourceManager.GetString("Sudan", resourceCulture); } } /// - /// Looks up a localized string similar to Serbia. + /// Looks up a localized string similar to Sulawesi (Indonesia). /// - internal static string Serbia { + internal static string Sulawesi__Indonesia_ { get { - return ResourceManager.GetString("Serbia", resourceCulture); + return ResourceManager.GetString("Sulawesi (Indonesia)", resourceCulture); } } /// - /// Looks up a localized string similar to Shortcuts. + /// Looks up a localized string similar to Sumatra (Indonesia). /// - internal static string Shortcuts { + internal static string Sumatra__Indonesia_ { get { - return ResourceManager.GetString("Shortcuts", resourceCulture); + return ResourceManager.GetString("Sumatra (Indonesia)", resourceCulture); } } /// - /// Looks up a localized string similar to Showa Station Time. + /// Looks up a localized string similar to SuriName. /// - internal static string Showa_Station_Time { + internal static string SuriName { get { - return ResourceManager.GetString("Showa Station Time", resourceCulture); + return ResourceManager.GetString("SuriName", resourceCulture); } } /// - /// Looks up a localized string similar to Show military time zone names. + /// Looks up a localized string similar to Suriname Time. /// - internal static string ShowMilitaryTimeZoneNames { + internal static string Suriname_Time { get { - return ResourceManager.GetString("ShowMilitaryTimeZoneNames", resourceCulture); + return ResourceManager.GetString("Suriname Time", resourceCulture); } } /// - /// Looks up a localized string similar to Show time names. + /// Looks up a localized string similar to Sverdlovsk (Russia). /// - internal static string ShowTimeNames { + internal static string Sverdlovsk__Russia_ { get { - return ResourceManager.GetString("ShowTimeNames", resourceCulture); + return ResourceManager.GetString("Sverdlovsk (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Show time zone names. + /// Looks up a localized string similar to Sweden. /// - internal static string ShowTimeZoneNames { + internal static string Sweden { get { - return ResourceManager.GetString("ShowTimeZoneNames", resourceCulture); + return ResourceManager.GetString("Sweden", resourceCulture); } } /// - /// Looks up a localized string similar to Sierra Leone. + /// Looks up a localized string similar to Switzerland. /// - internal static string Sierra_Leone { + internal static string Switzerland { get { - return ResourceManager.GetString("Sierra Leone", resourceCulture); + return ResourceManager.GetString("Switzerland", resourceCulture); } } /// - /// Looks up a localized string similar to Sierra Time Zone. + /// Looks up a localized string similar to Syria. /// - internal static string Sierra_Time_Zone { + internal static string Syria { get { - return ResourceManager.GetString("Sierra Time Zone", resourceCulture); + return ResourceManager.GetString("Syria", resourceCulture); } } /// - /// Looks up a localized string similar to Sinaloa (Mexico). + /// Looks up a localized string similar to Tahiti Time. /// - internal static string Sinaloa__Mexico_ { + internal static string Tahiti_Time { get { - return ResourceManager.GetString("Sinaloa (Mexico)", resourceCulture); + return ResourceManager.GetString("Tahiti Time", resourceCulture); } } /// - /// Looks up a localized string similar to Sint Maarten. + /// Looks up a localized string similar to Taiwan. /// - internal static string Sint_Maarten { + internal static string Taiwan { get { - return ResourceManager.GetString("Sint Maarten", resourceCulture); + return ResourceManager.GetString("Taiwan", resourceCulture); } } /// - /// Looks up a localized string similar to Slovakia. + /// Looks up a localized string similar to Tajikistan. /// - internal static string Slovakia { + internal static string Tajikistan { get { - return ResourceManager.GetString("Slovakia", resourceCulture); + return ResourceManager.GetString("Tajikistan", resourceCulture); } } /// - /// Looks up a localized string similar to Slovenia. + /// Looks up a localized string similar to Tajikistan Time. /// - internal static string Slovenia { + internal static string Tajikistan_Time { get { - return ResourceManager.GetString("Slovenia", resourceCulture); + return ResourceManager.GetString("Tajikistan Time", resourceCulture); } } /// - /// Looks up a localized string similar to Somalia. + /// Looks up a localized string similar to Tango Time Zone. /// - internal static string Somalia { + internal static string Tango_Time_Zone { get { - return ResourceManager.GetString("Somalia", resourceCulture); + return ResourceManager.GetString("Tango Time Zone", resourceCulture); } } /// - /// Looks up a localized string similar to Somaliland. + /// Looks up a localized string similar to Tanzania. /// - internal static string Somaliland { + internal static string Tanzania { get { - return ResourceManager.GetString("Somaliland", resourceCulture); + return ResourceManager.GetString("Tanzania", resourceCulture); } } /// - /// Looks up a localized string similar to Sonora (Mexico). + /// Looks up a localized string similar to Tasmania (Australia). /// - internal static string Sonora__Mexico_ { + internal static string Tasmania__Australia_ { get { - return ResourceManager.GetString("Sonora (Mexico)", resourceCulture); + return ResourceManager.GetString("Tasmania (Australia)", resourceCulture); } } /// - /// Looks up a localized string similar to South Africa (most). + /// Looks up a localized string similar to Tennessee (most, United States). /// - internal static string South_Africa__most_ { + internal static string Tennessee__most__United_States_ { get { - return ResourceManager.GetString("South Africa (most)", resourceCulture); + return ResourceManager.GetString("Tennessee (most, United States)", resourceCulture); } } /// - /// Looks up a localized string similar to South African Standard Time. + /// Looks up a localized string similar to Texas (most, United States). /// - internal static string South_African_Standard_Time { + internal static string Texas__most__United_States_ { get { - return ResourceManager.GetString("South African Standard Time", resourceCulture); + return ResourceManager.GetString("Texas (most, United States)", resourceCulture); } } /// - /// Looks up a localized string similar to South Carolina (United States). + /// Looks up a localized string similar to Thailand. /// - internal static string South_Carolina__United_States_ { + internal static string Thailand { get { - return ResourceManager.GetString("South Carolina (United States)", resourceCulture); + return ResourceManager.GetString("Thailand", resourceCulture); } } /// - /// Looks up a localized string similar to South Dakota (most, United States). + /// Looks up a localized string similar to Thailand Standard Time. /// - internal static string South_Dakota__most__United_States_ { + internal static string Thailand_Standard_Time { get { - return ResourceManager.GetString("South Dakota (most, United States)", resourceCulture); + return ResourceManager.GetString("Thailand Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to South Georgia and the South Sandwich Islands. + /// Looks up a localized string similar to The Fort (New Zealand). /// - internal static string South_Georgia_and_the_South_Sandwich_Islands { + internal static string The_Fort__New_Zealand_ { get { - return ResourceManager.GetString("South Georgia and the South Sandwich Islands", resourceCulture); + return ResourceManager.GetString("The Fort (New Zealand)", resourceCulture); } } /// - /// Looks up a localized string similar to South Georgia and the South Sandwich Islands Time. + /// Looks up a localized string similar to The Sisters (New Zealand). /// - internal static string South_Georgia_and_the_South_Sandwich_Islands_Time { + internal static string The_Sisters__New_Zealand_ { get { - return ResourceManager.GetString("South Georgia and the South Sandwich Islands Time", resourceCulture); + return ResourceManager.GetString("The Sisters (New Zealand)", resourceCulture); } } /// - /// Looks up a localized string similar to South Ossetia. + /// Looks up a localized string similar to Thule Air Base (Greenland). /// - internal static string South_Ossetia { + internal static string Thule_Air_Base__Greenland_ { get { - return ResourceManager.GetString("South Ossetia", resourceCulture); + return ResourceManager.GetString("Thule Air Base (Greenland)", resourceCulture); } } /// - /// Looks up a localized string similar to South Sudan. + /// Looks up a localized string similar to Time. /// - internal static string South_Sudan { + internal static string Time { get { - return ResourceManager.GetString("South Sudan", resourceCulture); + return ResourceManager.GetString("Time", resourceCulture); } } /// - /// Looks up a localized string similar to Southampton Island (Canada). + /// Looks up a localized string similar to T. /// - internal static string Southampton_Island__Canada_ { + internal static string TimeShortcut { get { - return ResourceManager.GetString("Southampton Island (Canada)", resourceCulture); + return ResourceManager.GetString("TimeShortcut", resourceCulture); } } /// - /// Looks up a localized string similar to Spain (most). + /// Looks up a localized string similar to Time Zone. /// - internal static string Spain__most_ { + internal static string TimeZone { get { - return ResourceManager.GetString("Spain (most)", resourceCulture); + return ResourceManager.GetString("TimeZone", resourceCulture); } } /// - /// Looks up a localized string similar to Standard Time. + /// Looks up a localized string similar to TZ. /// - internal static string StandardTime { + internal static string TimeZoneShortcut { get { - return ResourceManager.GetString("StandardTime", resourceCulture); + return ResourceManager.GetString("TimeZoneShortcut", resourceCulture); } } /// - /// Looks up a localized string similar to ST. + /// Looks up a localized string similar to Timor Leste Time. /// - internal static string StandardTimeShortcut { + internal static string Timor_Leste_Time { get { - return ResourceManager.GetString("StandardTimeShortcut", resourceCulture); + return ResourceManager.GetString("Timor Leste Time", resourceCulture); } } /// - /// Looks up a localized string similar to Sud-Ubangi (Democratic Republic of the Congo). + /// Looks up a localized string similar to Togo. /// - internal static string Sud_Ubangi__Democratic_Republic_of_the_Congo_ { + internal static string Togo { get { - return ResourceManager.GetString("Sud-Ubangi (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Togo", resourceCulture); } } /// - /// Looks up a localized string similar to Sudan. + /// Looks up a localized string similar to Tokelau. /// - internal static string Sudan { + internal static string Tokelau { get { - return ResourceManager.GetString("Sudan", resourceCulture); + return ResourceManager.GetString("Tokelau", resourceCulture); } } /// - /// Looks up a localized string similar to SuriName. + /// Looks up a localized string similar to Tokelau Time. /// - internal static string SuriName { + internal static string Tokelau_Time { get { - return ResourceManager.GetString("SuriName", resourceCulture); + return ResourceManager.GetString("Tokelau Time", resourceCulture); } } /// - /// Looks up a localized string similar to Suriname Time. + /// Looks up a localized string similar to Tomsk (Russia). /// - internal static string Suriname_Time { + internal static string Tomsk__Russia_ { get { - return ResourceManager.GetString("Suriname Time", resourceCulture); + return ResourceManager.GetString("Tomsk (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Sweden. + /// Looks up a localized string similar to Tonga. /// - internal static string Sweden { + internal static string Tonga { get { - return ResourceManager.GetString("Sweden", resourceCulture); + return ResourceManager.GetString("Tonga", resourceCulture); } } /// - /// Looks up a localized string similar to Switzerland. + /// Looks up a localized string similar to Tonga Time. /// - internal static string Switzerland { + internal static string Tonga_Time { get { - return ResourceManager.GetString("Switzerland", resourceCulture); + return ResourceManager.GetString("Tonga Time", resourceCulture); } } /// - /// Looks up a localized string similar to Syria. + /// Looks up a localized string similar to Transnistria. /// - internal static string Syria { + internal static string Transnistria { get { - return ResourceManager.GetString("Syria", resourceCulture); + return ResourceManager.GetString("Transnistria", resourceCulture); } } /// - /// Looks up a localized string similar to Tahiti Time. + /// Looks up a localized string similar to Trinidad and Tobago. /// - internal static string Tahiti_Time { + internal static string Trinidad_and_Tobago { get { - return ResourceManager.GetString("Tahiti Time", resourceCulture); + return ResourceManager.GetString("Trinidad and Tobago", resourceCulture); } } /// - /// Looks up a localized string similar to Tango Time Zone. + /// Looks up a localized string similar to Tshuapa (Democratic Republic of the Congo). /// - internal static string Tango_Time_Zone { + internal static string Tshuapa__Democratic_Republic_of_the_Congo_ { get { - return ResourceManager.GetString("Tango Time Zone", resourceCulture); + return ResourceManager.GetString("Tshuapa (Democratic Republic of the Congo)", resourceCulture); } } /// - /// Looks up a localized string similar to Tanzania. + /// Looks up a localized string similar to Tunisia. /// - internal static string Tanzania { + internal static string Tunisia { get { - return ResourceManager.GetString("Tanzania", resourceCulture); + return ResourceManager.GetString("Tunisia", resourceCulture); } } /// - /// Looks up a localized string similar to Tennessee (most, United States). + /// Looks up a localized string similar to Turkey. /// - internal static string Tennessee__most__United_States_ { + internal static string Turkey { get { - return ResourceManager.GetString("Tennessee (most, United States)", resourceCulture); + return ResourceManager.GetString("Turkey", resourceCulture); } } /// - /// Looks up a localized string similar to Texas (most, United States). + /// Looks up a localized string similar to Turkey Time. /// - internal static string Texas__most__United_States_ { + internal static string Turkey_Time { get { - return ResourceManager.GetString("Texas (most, United States)", resourceCulture); + return ResourceManager.GetString("Turkey Time", resourceCulture); } } /// - /// Looks up a localized string similar to Thule Air Base (Greenland). + /// Looks up a localized string similar to Turkmenistan. /// - internal static string Thule_Air_Base__Greenland_ { + internal static string Turkmenistan { get { - return ResourceManager.GetString("Thule Air Base (Greenland)", resourceCulture); + return ResourceManager.GetString("Turkmenistan", resourceCulture); } } /// - /// Looks up a localized string similar to Time. + /// Looks up a localized string similar to Turkmenistan Time. /// - internal static string Time { + internal static string Turkmenistan_Time { get { - return ResourceManager.GetString("Time", resourceCulture); + return ResourceManager.GetString("Turkmenistan Time", resourceCulture); } } /// - /// Looks up a localized string similar to T. + /// Looks up a localized string similar to Turks and Caicos Islands. /// - internal static string TimeShortcut { + internal static string Turks_and_Caicos_Islands { get { - return ResourceManager.GetString("TimeShortcut", resourceCulture); + return ResourceManager.GetString("Turks and Caicos Islands", resourceCulture); } } /// - /// Looks up a localized string similar to Time Zone. + /// Looks up a localized string similar to Tuva (Russia). /// - internal static string TimeZone { + internal static string Tuva__Russia_ { get { - return ResourceManager.GetString("TimeZone", resourceCulture); + return ResourceManager.GetString("Tuva (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to TZ. + /// Looks up a localized string similar to Tuvalu. /// - internal static string TimeZoneShortcut { + internal static string Tuvalu { get { - return ResourceManager.GetString("TimeZoneShortcut", resourceCulture); + return ResourceManager.GetString("Tuvalu", resourceCulture); } } /// - /// Looks up a localized string similar to Togo. + /// Looks up a localized string similar to Tuvalu Time. /// - internal static string Togo { + internal static string Tuvalu_Time { get { - return ResourceManager.GetString("Togo", resourceCulture); + return ResourceManager.GetString("Tuvalu Time", resourceCulture); } } /// - /// Looks up a localized string similar to Transnistria. + /// Looks up a localized string similar to Tyumen (Russia). /// - internal static string Transnistria { + internal static string Tyumen__Russia_ { get { - return ResourceManager.GetString("Transnistria", resourceCulture); + return ResourceManager.GetString("Tyumen (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Trinidad and Tobago. + /// Looks up a localized string similar to U.S. Virgin Islands. /// - internal static string Trinidad_and_Tobago { + internal static string U_S__Virgin_Islands { get { - return ResourceManager.GetString("Trinidad and Tobago", resourceCulture); + return ResourceManager.GetString("U.S. Virgin Islands", resourceCulture); } } /// - /// Looks up a localized string similar to Tshuapa (Democratic Republic of the Congo). + /// Looks up a localized string similar to Udmurtia (Russia). /// - internal static string Tshuapa__Democratic_Republic_of_the_Congo_ { + internal static string Udmurtia__Russia_ { get { - return ResourceManager.GetString("Tshuapa (Democratic Republic of the Congo)", resourceCulture); + return ResourceManager.GetString("Udmurtia (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to Tunisia. + /// Looks up a localized string similar to Uganda. /// - internal static string Tunisia { + internal static string Uganda { get { - return ResourceManager.GetString("Tunisia", resourceCulture); + return ResourceManager.GetString("Uganda", resourceCulture); } } /// - /// Looks up a localized string similar to Turkey. + /// Looks up a localized string similar to Ulaanbaatar Standard Time. /// - internal static string Turkey { + internal static string Ulaanbaatar_Standard_Time { get { - return ResourceManager.GetString("Turkey", resourceCulture); + return ResourceManager.GetString("Ulaanbaatar Standard Time", resourceCulture); } } /// - /// Looks up a localized string similar to Turkey Time. + /// Looks up a localized string similar to Ulaanbaatar Summer Time. /// - internal static string Turkey_Time { + internal static string Ulaanbaatar_Summer_Time { get { - return ResourceManager.GetString("Turkey Time", resourceCulture); + return ResourceManager.GetString("Ulaanbaatar Summer Time", resourceCulture); } } /// - /// Looks up a localized string similar to Turks and Caicos Islands. + /// Looks up a localized string similar to Ulyanovsk (Russia). /// - internal static string Turks_and_Caicos_Islands { + internal static string Ulyanovsk__Russia_ { get { - return ResourceManager.GetString("Turks and Caicos Islands", resourceCulture); + return ResourceManager.GetString("Ulyanovsk (Russia)", resourceCulture); } } /// - /// Looks up a localized string similar to U.S. Virgin Islands. + /// Looks up a localized string similar to Uniform Time Zone. /// - internal static string U_S__Virgin_Islands { + internal static string Uniform_Time_Zone { get { - return ResourceManager.GetString("U.S. Virgin Islands", resourceCulture); + return ResourceManager.GetString("Uniform Time Zone", resourceCulture); } } /// - /// Looks up a localized string similar to Uganda. + /// Looks up a localized string similar to United Arab Emirates. /// - internal static string Uganda { + internal static string United_Arab_Emirates { get { - return ResourceManager.GetString("Uganda", resourceCulture); + return ResourceManager.GetString("United Arab Emirates", resourceCulture); } } /// - /// Looks up a localized string similar to Uniform Time Zone. + /// Looks up a localized string similar to United Arab Emirates Standard Time. /// - internal static string Uniform_Time_Zone { + internal static string United_Arab_Emirates_Standard_Time { get { - return ResourceManager.GetString("Uniform Time Zone", resourceCulture); + return ResourceManager.GetString("United Arab Emirates Standard Time", resourceCulture); } } @@ -3903,6 +6189,51 @@ internal static string UTC { } } + /// + /// Looks up a localized string similar to Uvs (Mongolia). + /// + internal static string Uvs__Mongolia_ { + get { + return ResourceManager.GetString("Uvs (Mongolia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uzbekistan. + /// + internal static string Uzbekistan { + get { + return ResourceManager.GetString("Uzbekistan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uzbekistan Time. + /// + internal static string Uzbekistan_Time { + get { + return ResourceManager.GetString("Uzbekistan Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vanuatu. + /// + internal static string Vanuatu { + get { + return ResourceManager.GetString("Vanuatu", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vanuatu Time. + /// + internal static string Vanuatu_Time { + get { + return ResourceManager.GetString("Vanuatu Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Vatican City. /// @@ -3948,6 +6279,24 @@ internal static string Victor_Time_Zone { } } + /// + /// Looks up a localized string similar to Victoria (Australia). + /// + internal static string Victoria__Australia_ { + get { + return ResourceManager.GetString("Victoria (Australia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vietnam. + /// + internal static string Vietnam { + get { + return ResourceManager.GetString("Vietnam", resourceCulture); + } + } + /// /// Looks up a localized string similar to Virginia (United States). /// @@ -3957,6 +6306,60 @@ internal static string Virginia__United_States_ { } } + /// + /// Looks up a localized string similar to Vladivostok Time. + /// + internal static string Vladivostok_Time { + get { + return ResourceManager.GetString("Vladivostok Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Volgograd Time. + /// + internal static string Volgograd_Time { + get { + return ResourceManager.GetString("Volgograd Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Vostok Station Time. + /// + internal static string Vostok_Station_Time { + get { + return ResourceManager.GetString("Vostok Station Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wake Island. + /// + internal static string Wake_Island { + get { + return ResourceManager.GetString("Wake Island", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wake Island Time. + /// + internal static string Wake_Island_Time { + get { + return ResourceManager.GetString("Wake Island Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wallis and Futuna. + /// + internal static string Wallis_and_Futuna { + get { + return ResourceManager.GetString("Wallis and Futuna", resourceCulture); + } + } + /// /// Looks up a localized string similar to Washington (United States). /// @@ -4002,6 +6405,42 @@ internal static string West_Greenland_Time { } } + /// + /// Looks up a localized string similar to West Kalimantan (Indonesia). + /// + internal static string West_Kalimantan__Indonesia_ { + get { + return ResourceManager.GetString("West Kalimantan (Indonesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to West Kazakhstan (Kazakhstan). + /// + internal static string West_Kazakhstan__Kazakhstan_ { + get { + return ResourceManager.GetString("West Kazakhstan (Kazakhstan)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to West Nusa Tenggara (Indonesia). + /// + internal static string West_Nusa_Tenggara__Indonesia_ { + get { + return ResourceManager.GetString("West Nusa Tenggara (Indonesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to West Papua (Indonesia). + /// + internal static string West_Papua__Indonesia_ { + get { + return ResourceManager.GetString("West Papua (Indonesia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to West Virginia (United States). /// @@ -4020,6 +6459,15 @@ internal static string Weste { } } + /// + /// Looks up a localized string similar to Western Australia Standard Time. + /// + internal static string Western_Australia_Standard_Time { + get { + return ResourceManager.GetString("Western Australia Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Western European Summer Time. /// @@ -4038,6 +6486,24 @@ internal static string Western_European_Time { } } + /// + /// Looks up a localized string similar to Western Indonesian Time. + /// + internal static string Western_Indonesian_Time { + get { + return ResourceManager.GetString("Western Indonesian Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Western Standard Time. + /// + internal static string Western_Standard_Time { + get { + return ResourceManager.GetString("Western Standard Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Whiskey Time Zone. /// @@ -4074,6 +6540,24 @@ internal static string X_ray_Time_Zone { } } + /// + /// Looks up a localized string similar to Yakutsk Time. + /// + internal static string Yakutsk_Time { + get { + return ResourceManager.GetString("Yakutsk Time", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yamalia (Russia). + /// + internal static string Yamalia__Russia_ { + get { + return ResourceManager.GetString("Yamalia (Russia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Yankee Time Zone. /// @@ -4083,6 +6567,24 @@ internal static string Yankee_Time_Zone { } } + /// + /// Looks up a localized string similar to Yap (Micronesia). + /// + internal static string Yap__Micronesia_ { + get { + return ResourceManager.GetString("Yap (Micronesia)", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yekaterinburg Time. + /// + internal static string Yekaterinburg_Time { + get { + return ResourceManager.GetString("Yekaterinburg Time", resourceCulture); + } + } + /// /// Looks up a localized string similar to Yemen. /// @@ -4110,6 +6612,15 @@ internal static string Yukon__Canada_ { } } + /// + /// Looks up a localized string similar to Zabaykalsky (Russia). + /// + internal static string Zabaykalsky__Russia_ { + get { + return ResourceManager.GetString("Zabaykalsky (Russia)", resourceCulture); + } + } + /// /// Looks up a localized string similar to Zambia. /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx index fb1cb501609..ca8770e1db5 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Properties/Resources.resx @@ -126,9 +126,18 @@ Acre Time + + Afghanistan + + + Afghanistan Time + Akrotiri and Dhekelia + + Aktobe (Kazakhstan) + Alabama (United States) @@ -153,10 +162,19 @@ Algeria + + Alma-Ata Time + Alpha Time Zone Military time zone name + + Altai Krai (Russia) + + + Altai Republic (Russia) + Amazon Summer Time @@ -169,6 +187,15 @@ American Samoa + + Amsterdam Island (French Southern and Antarctic Lands) + + + Amur (Russia) + + + Anadyr Time + Andorra @@ -184,6 +211,9 @@ Antigua and Barbuda + + Aqtobe Time + Arabia Standard Time @@ -199,12 +229,27 @@ Arkansas (United States) + + Armenia + + + Armenia Time + + + Artsakh + Aruba Ascension and Tristan da Cunha + + ASEAN Common Time + + + Astrakhan (Russia) + Atikokan (Canada) @@ -217,9 +262,45 @@ Atlantic Time Zone + + Atyrau (Kazakhstan) + + + Australia: Western Australia (most) + + + Australian Capital Territory (Australia) + + + Australian Central Daylight Saving Time + + + Australian Central Standard Time + + + Australian Central Western Standard Time + + + Australian Eastern Daylight Saving Time + + + Australian Eastern Standard Time + + + Australian Eastern Time + + + Australian Western Standard Time + Austria + + Azerbaijan + + + Azerbaijan Time + Azores (Portugal) @@ -235,6 +316,9 @@ Bahrain + + Baikonur (Kazakhstan) + Baja California (Mexico) @@ -247,9 +331,24 @@ Baker Island Time + + Bali (Indonesia) + + + Bangladesh + + + Bangladesh Standard Time + Barbados + + Bashkortostan (Russia) + + + Bayan-Ölgii (Mongolia) + Belarus @@ -265,18 +364,33 @@ Bermuda + + Bhutan + + + Bhutan Time + Bolivia Bolivia Time + + Border Village (Australia) + Bosnia and Herzegovina Botswana + + Bougainville (Papua New Guinea) + + + Bougainville Standard Time + Brasília Summer Time @@ -299,12 +413,24 @@ British Columbia (southeast, Canada) + + British Indian Ocean Territory + + + British Indian Ocean Time + British Summer Time British Virgin Islands + + Brunei + + + Brunei Time + Bulgaria @@ -314,9 +440,18 @@ Burundi + + Buryatia (Russia) + + + Caiguna (Australia) + California (United States) + + Cambodia + Cameroon @@ -350,19 +485,46 @@ Central European Time + + Central Indonesian Time + + + Central Kalimantan (Indonesia) + Central Standard Time Central Time Zone + + Central Western Standard Time + Chad + + Chamorro Standard Time + + + Chamorro Time Zone + Charlie Time Zone Military time zone name + + Chatham Daylight Time + + + Chatham Islands (New Zealand) + + + Chatham Standard Time + + + Chelyabinsk (Russia) + Chihuahua (Mexico) @@ -372,9 +534,48 @@ Chile Summer Time + + China + + + China Standard Time + + + Choibalsan Standard Time + + + Choibalsan Summer Time + + + Christmas Island + + + Christmas Island Time + + + Chukotka (Russia) + + + Chuuk (Micronesia) + + + Chuuk Time + Clipperton Island + + Clipperton Island Standard Time + + + Cocklebiddy (Australia) + + + Cocos Islands + + + Cocos Islands Time + Colombia @@ -420,6 +621,9 @@ Croatia + + Crozet Islands (French Southern and Antarctic Lands) + Cuba @@ -441,6 +645,9 @@ Danmarkshavn + + Davis Time + Daylight Time @@ -451,6 +658,10 @@ Delaware (United States) + + Delta Time Zone + Military time zone name + Democratic Republic of the Congo (most) @@ -472,9 +683,21 @@ Donetsk PR + + Dumont d'Urville Time + East Africa Time + + East Kalimantan (Indonesia) + + + East Nusa Tenggara (Indonesia) + + + East Timor + Easter Island (Chile) @@ -502,12 +725,19 @@ Eastern Greenland Time + + Eastern Indonesian Time + Eastern Standard Time Eastern Time Zone + + Echo Time Zone + Military time zone name + Ecuador (most) @@ -538,6 +768,9 @@ Ethiopia + + Eucla (Australia) + Falkland Islands @@ -556,12 +789,25 @@ Fernando de Noronha Time + + Fiji + + + Fiji Time + Finland Florida (most, United States) + + Forty-Fours (New Zealand) + + + Foxtrot Time Zone + Military time zone name + France (metropolitan) @@ -574,6 +820,9 @@ French Polynesia (most) + + French Southern and Antarctic Time + Further-eastern European Time @@ -592,9 +841,15 @@ Gambier Islands Time + + Georgia + Georgia (United States) + + Georgia Standard Time + Germany @@ -604,6 +859,16 @@ Gibraltar + + Gilbert Island Time + + + Gilbert Islands (Kiribati) + + + Golf Time Zone + Military time zone name + Greece @@ -619,6 +884,9 @@ Guadeloupe + + Guam + Guatemala @@ -631,6 +899,9 @@ Guinea-Bissau + + Gulf Standard Time + Guyana @@ -643,14 +914,20 @@ Hawaii (United States) - - Hawaii–Aleutian Daylight Time + + Hawaii-Aleutian Daylight Time + + + Hawaii-Aleutian Standard Time - - Hawaii–Aleutian Standard Time + + Hawaii-Aleutian Time Zone - - Hawaii–Aleutian Time Zone + + Heard and McDonald Islands Time + + + Heard Island and McDonald Islands Heure Avancée d'Europe Centrale @@ -658,6 +935,19 @@ Honduras + + Hong Kong + + + Hong Kong Time + + + Hotel Time Zone + Military time zone name + + + Hovd Time + Howland Island @@ -676,12 +966,25 @@ Illinois (United States) + + India + + + India Time Zone + Military time zone name + Indian Ocean Time + + Indian Standard Time + Indiana (most, United States) + + Indochina Time + International Date Line West time zone @@ -706,6 +1009,12 @@ Irish Standard Time + + Irkutsk (Russia) + + + Irkutsk Time + Islands of Four Mountains (United States) @@ -733,12 +1042,27 @@ Jamaica + + Japan + + + Japan Standard Time + Jarvis Island + + Java (Indonesia) + Jersey + + Jervis Bay Territory (Australia) + + + Jewish (Russia) + Johnston Atoll @@ -751,15 +1075,46 @@ Kaliningrad Time + + Kamchatka (Russia) + + + Kamchatka Time + Kansas (most, United States) + + Kazakhstan (most) + + + Kemerovo (Russia) + Kentucky (most, United States) Kenya + + Kerguelen Islands (French Southern and Antarctic Lands) + + + Khabarovsk (Russia) + + + Khakassia (Russia) + + + Khanty-Mansi (Russia) + + + Khovd (Mongolia) + + + Kilo Time Zone + Military time zone name + Kingman Reef @@ -769,9 +1124,27 @@ Kongo Central (Democratic Republic of the Congo) + + Korea Standard Time + Kosovo + + Kosrae (Micronesia) + + + Kosrae Time + + + Krasnoyarsk (Russia) + + + Krasnoyarsk Time + + + Kurgan (Russia) + Kuwait @@ -781,12 +1154,24 @@ Kwilu (Democratic Republic of the Congo) + + Kyrgyzstan + + + Kyrgyzstan Time + + + Kyzylorda (Kazakhstan) + Labrador (most, Canada) Labrador (southeast, Canada) + + Laos + Latvia @@ -805,9 +1190,31 @@ Liechtenstein + + Lima Time Zone + Military time zone name + + + Line Islands (Kiribati) + + + Line Islands Time + Lithuania + + Little Mangere Island (New Zealand) + + + Lord Howe Island (Australia) + + + Lord Howe Standard Time + + + Lord Howe Summer Time + Louisiana (United States) @@ -817,9 +1224,24 @@ Luxembourg + + Macau + + + Macquarie Island Station Time + Madagascar + + Madura (Australia) + + + Magadan (Russia) + + + Magadan Time + Magallanes (Chile) @@ -832,12 +1254,33 @@ Malawi + + Malaysia + + + Malaysia Standard Time + + + Malaysia Time + + + Maldives + + + Maldives Time + Mali Malta + + Maluku (Indonesia) + + + Mangystau (Kazakhstan) + Manitoba (Canada) @@ -847,6 +1290,12 @@ Marquesas Islands Time + + Marshall Islands + + + Marshall Islands Time + Martinique @@ -865,6 +1314,15 @@ Mauritania + + Mauritius + + + Mauritius Time + + + Mawson Station Time + Mayotte @@ -883,6 +1341,10 @@ Midway Atoll + + Mike Time Zone + Military time zone name + Minnesota (United States) @@ -904,6 +1366,9 @@ Mongala (Democratic Republic of the Congo) + + Mongolia (most) + Montana (United States) @@ -931,12 +1396,24 @@ Mozambique + + Mundrabilla (Australia) + + + Myanmar + + + Myanmar Standard Time + Names Namibia + + Nauru + Navassa Island @@ -949,6 +1426,12 @@ Nebraska (most, United States) + + Nepal + + + Nepal Standard Time + Netherlands (European) @@ -958,6 +1441,12 @@ New Brunswick (Canada) + + New Caledonia + + + New Caledonia Time + New Hampshire (United States) @@ -967,9 +1456,21 @@ New Mexico (United States) + + New South Wales (most, Australia) + New York (United States) + + New Zealand + + + New Zealand Daylight Time + + + New Zealand Standard Time + Newfoundland (Canada) @@ -1003,18 +1504,39 @@ Nord-Ubangi (Democratic Republic of the Congo) + + Norfolk Island + + + Norfolk Island Time + North Carolina (United States) North Dakota (most, United States) + + North Kalimantan (Indonesia) + + + North Korea + North Macedonia + + North Maluku (Indonesia) + Northern Cyprus + + Northern Mariana Islands + + + Northern Territory + Northwest Territories (Canada) @@ -1028,6 +1550,12 @@ November Time Zone Military time zone name + + Novosibirsk (Russia) + + + Novosibirsk Time + Nunavut (central, Canada) @@ -1046,15 +1574,30 @@ Oklahoma, United States + + Oman + + + Omsk (Russia) + + + Omsk Time + Ontario (most, Canada) Ontario (west, Canada) + + Oral Time + Oregon (most, United States) + + Orenburg (Russia) + Oscar Time Zone Military time zone name @@ -1065,9 +1608,24 @@ Pacific Standard Time + + Pacific Time Zone + Pacific Time Zone + + Pakistan + + + Pakistan Standard Time + + + Palau + + + Palau Time + Palestine @@ -1081,6 +1639,15 @@ Papa Time Zone Military time zone name + + Papua (Indonesia) + + + Papua New Guinea (most) + + + Papua New Guinea Time + Paraguay @@ -1093,27 +1660,57 @@ Pennsylvania (United States) + + Perm (Russia) + Peru Peru Time + + Philippine Standard Time + + + Philippine Time + + + Philippines + + + Phoenix Island Time + + + Phoenix Islands (Kiribati) + Pitcairn Islands + + Pitt Islands (New Zealand) + Gets the the current time of a time zone Time zone + + Pohnpei (Micronesia) + + + Pohnpei Standard Time + Poland Portugal (most) + + Primorsky (Russia) + Prince Edward Island (Canada) @@ -1136,6 +1733,9 @@ Quebec Time Zone Military time zone name + + Queensland (Australia) + Quintana Roo (Mexico) @@ -1167,6 +1767,12 @@ Rwanda + + Réunion + + + Réunion Time + Saint Barthélemy @@ -1182,6 +1788,9 @@ Saint Martin + + Saint Paul Island (French Southern and Antarctic Lands) + Saint Pierre and Miquelon @@ -1194,6 +1803,33 @@ Saint Vincent and the Grenadines + + Sakha (central-east, Russia) + + + Sakha (east, Russia) + + + Sakha (most, Russia) + + + Sakhalin (Russia) + + + Sakhalin Island Time + + + Samara (Russia) + + + Samara Time + + + Samoa + + + Samoa Daylight Time + Samoa Standard Time @@ -1203,6 +1839,9 @@ San Marino + + Saratov (Russia) + Saskatchewan (most, Canada) @@ -1218,6 +1857,12 @@ Serbia + + Seychelles + + + Seychelles Time + Shortcuts @@ -1246,6 +1891,15 @@ Sinaloa (Mexico) + + Singapore + + + Singapore Standard Time + + + Singapore Time + Sint Maarten @@ -1255,6 +1909,12 @@ Slovenia + + Solomon Islands + + + Solomon Islands Time + Somalia @@ -1270,18 +1930,30 @@ South African Standard Time + + South Australia (Australia) + South Carolina (United States) South Dakota (most, United States) + + South East Island (New Zealand) + South Georgia and the South Sandwich Islands South Georgia and the South Sandwich Islands Time + + South Kalimantan (Indonesia) + + + South Korea + South Ossetia @@ -1294,6 +1966,15 @@ Spain (most) + + Srednekolymsk Time + + + Sri Lanka + + + Sri Lanka Standard Time + Standard Time @@ -1301,18 +1982,30 @@ ST Short for "Standard Time" + + Star Keys (New Zealand) + Sud-Ubangi (Democratic Republic of the Congo) Sudan + + Sulawesi (Indonesia) + + + Sumatra (Indonesia) + SuriName Suriname Time + + Sverdlovsk (Russia) + Sweden @@ -1328,6 +2021,15 @@ Tahiti Time + + Taiwan + + + Tajikistan + + + Tajikistan Time + Tango Time Zone Military time zone name @@ -1335,12 +2037,27 @@ Tanzania + + Tasmania (Australia) + Tennessee (most, United States) Texas (most, United States) + + Thailand + + + Thailand Standard Time + + + The Fort (New Zealand) + + + The Sisters (New Zealand) + Thule Air Base (Greenland) @@ -1358,9 +2075,27 @@ TZ Short for "Time Zone" + + Timor Leste Time + Togo + + Tokelau + + + Tokelau Time + + + Tomsk (Russia) + + + Tonga + + + Tonga Time + Transnistria @@ -1379,19 +2114,55 @@ Turkey Time + + Turkmenistan + + + Turkmenistan Time + Turks and Caicos Islands + + Tuva (Russia) + + + Tuvalu + + + Tuvalu Time + + + Tyumen (Russia) + U.S. Virgin Islands + + Udmurtia (Russia) + Uganda + + Ulaanbaatar Standard Time + + + Ulaanbaatar Summer Time + + + Ulyanovsk (Russia) + Uniform Time Zone Military time zone name + + United Arab Emirates + + + United Arab Emirates Standard Time + United Kingdom @@ -1414,6 +2185,21 @@ UTC Short for "Coordinated Universal Time" + + Uvs (Mongolia) + + + Uzbekistan + + + Uzbekistan Time + + + Vanuatu + + + Vanuatu Time + Vatican City @@ -1430,9 +2216,33 @@ Victor Time Zone Military time zone name + + Victoria (Australia) + + + Vietnam + Virginia (United States) + + Vladivostok Time + + + Volgograd Time + + + Vostok Station Time + + + Wake Island + + + Wake Island Time + + + Wallis and Futuna + Washington (United States) @@ -1448,18 +2258,39 @@ West Greenland Time + + West Kalimantan (Indonesia) + + + West Kazakhstan (Kazakhstan) + + + West Nusa Tenggara (Indonesia) + + + West Papua (Indonesia) + West Virginia (United States) Weste + + Western Australia Standard Time + Western European Summer Time Western European Time + + Western Indonesian Time + + + Western Standard Time + Whiskey Time Zone Military time zone name @@ -1474,10 +2305,22 @@ X-ray Time Zone Military time zone name + + Yakutsk Time + + + Yamalia (Russia) + Yankee Time Zone Military time zone name + + Yap (Micronesia) + + + Yekaterinburg Time + Yemen @@ -1487,6 +2330,9 @@ Yukon (Canada) + + Zabaykalsky (Russia) + Zambia diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json index 8b2b2f6cf10..fcef0af599a 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/timezones.json @@ -50,10 +50,10 @@ }, { "Offset": "-10:00", - "Name": "Hawaii_Aleutian Time Zone", + "Name": "Hawaii-Aleutian Time Zone", "MilitaryName": "Whiskey Time Zone", "TimeNamesStandard": [ - "Hawaii_Aleutian Standard Time", + "Hawaii-Aleutian Standard Time", "Tahiti Time" ], "ShortcutsStandard": [ @@ -61,7 +61,7 @@ "TAHT" ], "TimeNamesDaylight": [ - "Hawaii–Aleutian Daylight Time" + "Hawaii-Aleutian Daylight Time" ], "ShortcutsDaylight": [ "HDT" From 67b2671510779b7654c70608dd37c6c708db97ea Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Mon, 10 Jan 2022 09:23:50 +0100 Subject: [PATCH 46/67] XML Doc --- .../Classes/OneTimeZone.cs | 10 ++++++++++ .../Classes/TimeZoneList.cs | 13 +++++++++++++ .../Extensions/StringBuilderExtensions.cs | 5 +++++ .../Helper/JsonHelper.cs | 4 +--- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs index 983e4f9dcb3..a06a6d743b1 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/OneTimeZone.cs @@ -5,11 +5,21 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json; namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Classes { + /// + /// A time zone + /// public sealed class OneTimeZone { + /// + /// Initializes a new instance of the class with empty properties. + /// + /// + /// The standard constructor is need by the -Method. + /// public OneTimeZone() { Offset = "00:00"; diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs index d058f5b0633..820c793c322 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Classes/TimeZoneList.cs @@ -4,16 +4,29 @@ using System.Collections.Generic; using System.Linq; +using System.Text.Json; namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Classes { + /// + /// A class that contains all time zones. + /// public sealed class TimeZoneList { + /// + /// Initializes a new instance of the class with empty properties. + /// + /// + /// The standard constructor is need by the -Method. + /// public TimeZoneList() { TimeZones = Enumerable.Empty(); } + /// + /// Gets or sets a list with all time zones. + /// public IEnumerable TimeZones { get; set; } } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs index 082fbc239de..0b0fbfb58a1 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Extensions/StringBuilderExtensions.cs @@ -29,6 +29,11 @@ internal static void SaveAppend(this StringBuilder stringBuilder, string value, } } + /// + /// Cut too long texts to the given length and add three dots at the end of the text. + /// + /// The that contain the text. + /// The maximum length for the text, inclusive the three dots. internal static void CutTooLong(this StringBuilder stringBuilder, int maxLength) { if (stringBuilder.Length <= maxLength) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs index fa9a3d1f2b3..5f657d737a4 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/JsonHelper.cs @@ -3,8 +3,6 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Generic; -using System.ComponentModel; using System.IO; using System.Reflection; using System.Text.Json; @@ -14,7 +12,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { /// - /// Helper class to easier work with the JSON files + /// Helper class to easier work with the JSON files. /// internal static class JsonHelper { From dc2d781075bb79c807c29af3334f20e0a1891cba Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Mon, 10 Jan 2022 09:24:04 +0100 Subject: [PATCH 47/67] Fix plugin name (type) --- .../Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json index 2e417990883..a50e19278d0 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/plugin.json @@ -2,7 +2,7 @@ "ID": "BADD1B06EF0A4B61AD95395F24241D69", "ActionKeyword": "&", "IsGlobal": false, - "Name": "TimeZone", + "Name": "Time zone", "Author": "TobiasSekan", "Version": "1.0.0", "Language": "csharp", From edf7f2d2de276277231c7c0dc98f2cb4ed0110db Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 19 Jan 2022 15:46:31 +0100 Subject: [PATCH 48/67] Fix Typos --- .github/actions/spell-check/expect.txt | 96 +++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 2 deletions(-) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index a255f24927c..0279bb0f2c9 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -34,6 +34,8 @@ AFX AGGREGATABLE AHybrid Aissue +Akrotiri +Aktobe ALarger alekhyareddy alignas @@ -49,6 +51,7 @@ Amicrosoft AModifier AMPROPERTY AMPROPSETID +Andreanof anges angularsen ansicolor @@ -80,6 +83,7 @@ appx appxmanifest APSTUDIO AQS +Aqtobe arcosh ARemapped argb @@ -95,6 +99,7 @@ ARRAYSIZE arsinh artanh Artboard +Artsakh asdf AShortcut ASingle @@ -103,6 +108,7 @@ aspnet ASSOCCHANGED ASYNCWINDOWPLACEMENT ASYNCWINDOWPOS +Atikokan atl atlbase atlcom @@ -112,6 +118,7 @@ atlstr atop Attribs attrs +Atyrau aumid Aut Authenticode @@ -134,11 +141,16 @@ azurecr backend backtracer BADD +BAEC +BAF bak +Bashkortostan +Bayan bbwe bck Bcl BEEE +Belarus betadele betsegaw BFB @@ -197,8 +209,11 @@ BUILDARCH buildcommand buildtools buildtransitive +Burkina +Buryatia BValue bytearray +Caiguna CALG callbackptr cameligo @@ -231,12 +246,16 @@ ChaseKnowlden chdir CHILDACTIVATE CHILDWINDOW +Choibalsan chrdavis chromaticities chrono chrzan Chrzan +Chrzan CHT +Chukotka +Chuuk cielab ciexyz CImage @@ -254,6 +273,7 @@ CLIENTEDGE CLIENTPULL clientside CLIPCHILDREN +Clipperton CLIPSIBLINGS cljs clrcall @@ -273,6 +293,7 @@ CMONITORS cmp cmyk cnt +Cocklebiddy coclass codebase codecvt @@ -296,6 +317,7 @@ comhost cominterop commandline commctrl +Comoros companding Compat COMPOSITIONFULL @@ -363,6 +385,7 @@ CTRLALTDEL Ctrls Ctx CUI +Cunha currentculture CURSORINFO cursorpos @@ -382,6 +405,7 @@ czf cziplib Dac dacl +Danmarkshavn DARKPURPLE DARKTEAL DARKYELLOW @@ -566,8 +590,10 @@ esize esrp estdir etcore +Eswatini etl etw +Eucla EUQ eventlog everytime @@ -602,6 +628,7 @@ fancyzones FANCYZONESDRAWLAYOUTTEST FANCYZONESEDITOR Farbraum +Faroe FARPROC FBF FCCD @@ -631,6 +658,7 @@ findfast findstr Firefox FIXEDFILEINFO +FIXME FLASHZONES FLASHZONESONQUICKSWITCH flt @@ -656,6 +684,7 @@ fstream FTYPE func Functiondiscoverykeys +Futuna fwlink fwrite fxcop @@ -725,6 +754,7 @@ hdrop HEB Heiko helptext +Heure HEVC hfile hglobal @@ -765,6 +795,7 @@ hotkeycontrol hotkeys hotlight hotspot +Hovd HPAINTBUFFER HRAWINPUT hread @@ -993,6 +1024,7 @@ ith IThrottled ithumbnail ITrigger +Ittoqqortoormiit IUI IUnknown IUri @@ -1051,14 +1083,23 @@ keystokes Keystool Keytool keyup +Khakassia +Khanty +Khovd KILLFOCUS +Kitts Knowlden Knownfolders kotlin KSPROPERTY ktm kts +Krai +Kwango +Kwilu Kybd +Kyrgyzstan +Kyzylorda LAlt Lambson lamotile @@ -1068,6 +1109,7 @@ LASTEXITCODE Laute laute Laute +Laute laviusmotileng LAYOUTRTL LBUTTON @@ -1083,14 +1125,17 @@ Ldone ldx LEFTSCROLLBAR lego +lemy len LEQ LError Lessthan LEVELID LExit +lgii lhs lhwnd +lia LIBID LIGHTORANGE LIGHTTURQUOISE @@ -1159,10 +1204,14 @@ lstrcmpi lstrlen LTRB LTRREADING +Luhansk LWA lwin LZero lzw +Maarten +Macquarie +Magadan MAINICON Mainwindow majortype @@ -1173,13 +1222,18 @@ MAKEINTRESOURCEW MAKELPARAM makepri malloc +Mangere +Mangystau manifestdependency +Mansi MAPPEDTOSAMEKEY MAPTOSAMESHORTCUT MAPVK Markdig +Marquesas martinchrzan martinmoene +Mato MAXIMIZEBOX MAXSHORTCUTSIZE maxversiontested @@ -1226,6 +1280,7 @@ miniz minlevel Miracast mirophone +Mishkeegogamang mjpg mkdir mlcfg @@ -1238,6 +1293,8 @@ MODECHANGE moderncop modernwpf modulekey +Moldova +Mongala MONITORINFO MONITORINFOEX MONITORINFOEXW @@ -1291,6 +1348,7 @@ MULTIPLEUSE Multiselect multiset multizone +Mundrabilla mutex mutexes muxc @@ -1302,12 +1360,14 @@ nameof namespace namings NATIVEFNTCTL +Navassa NCACTIVATE ncc NCCALCSIZE NCCREATE NCDESTROY NCHITTEST +ncipe NCLBUTTONDBLCLK NCLBUTTONDOWN NCLBUTTONUP @@ -1322,6 +1382,7 @@ NCRBUTTONDBLCLK NCRBUTTONDOWN NCRBUTTONUP NDEBUG +Ndombe ndp NEEDDISPATCH neq @@ -1342,6 +1403,7 @@ newitem newpath newrow Newtonsoft +nia niels nielslaute NIF @@ -1378,6 +1440,7 @@ NOREPEAT NOREPOSITION NORMALDISPLAY NORMALUSER +Noronha NOSEARCH NOSENDCHANGING NOSIZE @@ -1406,6 +1469,8 @@ nullptr numberbox NUMLOCK NUMPAD +Nunavut +Nusa Nvidia nwc NWSE @@ -1458,6 +1523,7 @@ Overridable Oversampling OWNDC PACL +pagos PAINTSTRUCT PAIT PALEBLUE @@ -1480,8 +1546,9 @@ pch PCIDLIST PCWSTR pdb -Pdb pdb +Pdb +Pdb pdbonly pdfpreviewhandler pdo @@ -1511,6 +1578,7 @@ pinfo pinvoke Pipelinhttps pipename +Pitcairn PKBDLLHOOKSTRUCT PKEY plib @@ -1524,6 +1592,7 @@ plx PMSIHANDLE policheck popd +Pohnpei popup POPUPWINDOW posix @@ -1568,6 +1637,7 @@ PREVIOUSVERSIONSINSTALLED prevpane prgms pri +Primorsky PRINTCLIENT printf prm @@ -1622,6 +1692,7 @@ qit QITAB QITABENT qps +quateur Queryable QUERYENDSESSION QUERYOPEN @@ -1733,6 +1804,7 @@ roadmap robocopy Roboto roslyn +Rothera royvou Rpc RRF @@ -1860,6 +1932,7 @@ signtool SINGLEKEY singlekeyremapcontrol singletones +Sint sipolicy SIZEBOX sizeg @@ -1904,6 +1977,7 @@ spsv sqlite SRCCOPY sre +Srednekolymsk sregex SResize SRGB @@ -1973,7 +2047,9 @@ subkey SUBLANG subquery substr +Sul Superbar +Suri sut SVE SVGIn @@ -2011,6 +2087,8 @@ systemverilog Tadele tadele Tadele +Tadele +Tajikistan talynone TApp TApplication @@ -2037,6 +2115,7 @@ telem tellg Templated templatenamespace +Tenggara testcase testhost testprocess @@ -2067,8 +2146,9 @@ Toolchain toolkitcontrols toolkitconverters toolset -Toolset toolset +Toolset +Toolset toolstrip toolwindow TOPDOWNDIB @@ -2082,14 +2162,18 @@ tracelogging trackpad traies transcoded +Transnistria transparrent TRAYMOUSEMESSAGE triaging TRK trl trunc +Tshuapa tspan TStr +Tuva +TValue TYMED typedef TYPEKEY @@ -2104,6 +2188,7 @@ UAC UAL uap udit +Udmurtia Udp uefi UIA @@ -2113,6 +2198,7 @@ uintptr UIPI UIs UITo +Ulaanbaatar ULARGE ULLONG ulong @@ -2154,6 +2240,7 @@ Uptool upvote uri URLs +Urville Usb USEDEFAULT USEFILEATTRIBUTES @@ -2167,9 +2254,11 @@ ushort USRDLL utc Utc +Utc utf utils uuidof +Uvs uwp UWPUI uxtheme @@ -2384,6 +2473,7 @@ XResource xsi XStr XVIRTUALSCREEN +Yamalia YIncrement yinwang YOffset @@ -2394,6 +2484,7 @@ YUYV YVIRTUALSCREEN YVU YVYU +Zabaykalsky ZEROINIT ZIndex zonable @@ -2402,4 +2493,5 @@ ZONEHIGHLIGHTCOLOR zoneset ZONESETCHANGE Zoneszonabletester +Zonev zzz \ No newline at end of file From 7295a0ab3ecc7e1cdcae99a703d7936f5c40c9d6 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 19 Jan 2022 15:57:49 +0100 Subject: [PATCH 49/67] Add TimeZone Plugint to WXS --- installer/PowerToysSetup/Product.wxs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/installer/PowerToysSetup/Product.wxs b/installer/PowerToysSetup/Product.wxs index d3fdde365ef..6f020009277 100644 --- a/installer/PowerToysSetup/Product.wxs +++ b/installer/PowerToysSetup/Product.wxs @@ -410,6 +410,10 @@ + + + + @@ -1108,7 +1112,7 @@ - + @@ -1347,6 +1351,12 @@ Directory="Resource$(var.IdSafeLanguage)SystemPluginFolder"> + + + + + + + + + + + + + + From f5228fa48e30b1a0809f7793be502b1a1462c9fc Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 19 Jan 2022 16:05:28 +0100 Subject: [PATCH 50/67] Add TimeZone plugin to sign pipeline --- .pipelines/ESRPSigning_core.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.pipelines/ESRPSigning_core.json b/.pipelines/ESRPSigning_core.json index f1af7d7688d..3de4df72f3b 100644 --- a/.pipelines/ESRPSigning_core.json +++ b/.pipelines/ESRPSigning_core.json @@ -94,6 +94,7 @@ "modules\\launcher\\Plugins\\VSCodeWorkspaces\\Community.PowerToys.Run.Plugin.VSCodeWorkspaces.dll", "modules\\launcher\\Plugins\\Service\\Microsoft.PowerToys.Run.Plugin.Service.dll", "modules\\launcher\\Plugins\\System\\Microsoft.PowerToys.Run.Plugin.System.dll", + "modules\\launcher\\Plugins\\TimeZone\\Microsoft.PowerToys.Run.Plugin.TimeZone.dll", "modules\\launcher\\Plugins\\WebSearch\\Community.PowerToys.Run.Plugin.WebSearch.dll", "modules\\launcher\\Plugins\\WindowsTerminal\\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.dll", From 5f557146be1b6b272356080183e4e5cb745d0f40 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 19 Jan 2022 16:24:18 +0100 Subject: [PATCH 51/67] Add Documentation --- .../modules/launcher/plugins/timeZone.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 doc/devdocs/modules/launcher/plugins/timeZone.md diff --git a/doc/devdocs/modules/launcher/plugins/timeZone.md b/doc/devdocs/modules/launcher/plugins/timeZone.md new file mode 100644 index 00000000000..3bee5671b33 --- /dev/null +++ b/doc/devdocs/modules/launcher/plugins/timeZone.md @@ -0,0 +1,145 @@ +# Time Zone Plugin + +The Time Zone plugin allows users to search a time zone. + +## Special functions (differ from the regular functions) + +* Search for a country, like Kamchatka, Prince Edward Island, France +* Search for a shortcuts, like WEST, UTC, PST +* Search for a offset, like -12:00, -7, 5, 9:30 +* Search for a military time zone name (must activate in plugin settings) + +## How to add a new time zone or change one + +All time zones are located in `TimeZone.json` in root folder of the project. +The `TimeZone.json` use a JSON schema file that make it easier to edit it. + +| Key | Optional | Value type | +| ------------------- | -------- | ----------------- | +| `Offset` | **No** | String | +| `Name` | Yes | String | +| `MilitaryName` | Yes | String | +| `Shortcut` | Yes | String | +| `TimeNamesStandard` | Yes | List with strings | +| `TimeNamesDaylight` | Yes | List with strings | +| `ShortcutsStandard` | Yes | List with strings | +| `ShortcutsDaylight` | Yes | List with strings | +| `CountriesStandard` | Yes | List with strings | +| `CountriesDaylight` | Yes | List with strings | + +A minimum entry for the `TimeZone.json` looks like: + +```json + { + "Offset": "11:55", + "Name": "My crazy time zone", + } +``` + +A full entry for the `TimeZone.json` looks like: + +```json + { + "Offset": "11:55", + "Name": "My crazy time zone", + "Shortcut" : "MYTZ", + "MilitaryName" : "Order Time Zone", + "TimeNamesStandard": [ + "My crazy standard time" + ], + "ShortcutsStandard": [ + "MCST" + ], + "TimeNamesDaylight": [ + "My crazy daylight time" + ], + "ShortcutsDaylight": [ + "MCDT" + ], + "CountriesStandard": [ + "Crazy Land East" + ], + "CountriesDaylight": [ + "Crazy Land West" + ] + } +``` + +### Remarks + +* At minimum one of the optional value should be filled. + +## Scores + +* Scores are not used + +## Important for developers + +### General + +* The assembly name is cached into `_assemblyName` (to avoid to many calls of `Assembly.GetExecutingAssembly()`) + +## Microsoft.PowerToys.Run.Plugin.TimeZone project + +### Important plugin values (meta-data) + +| Name | Value | +| --------------- | ---------------------------------------------------- | +| ActionKeyword | `&` | +| ExecuteFileName | `Microsoft.PowerToys.Run.Plugin.TimeZone.dll` | +| ID | `BADD1B06EF0A4B61AD95395F24241D69` | + +### Interfaces used by this plugin + +The plugin use only these interfaces (all inside the `Main.cs`): + +* `Wox.Plugin.IPlugin` +* `Wox.Plugin.IContextMenu` +* `Wox.Plugin.IPluginI18n` +* `Wox.Plugin.ISettingProvider` +* `IDisposable` + +### Program files + +| File | Content | +| ------------------------------------- | ----------------------------------------------------------------------- | +| `Classes\OneTimeZone.cs` | A class that represent one time zone | +| `Classes\TimeZones.cs` | A wrapper class that only contains a list with time zones (see 1) | +| `Helper\ContextMenuHelper.cs` | All functions to build the context menu (for each result entry) | +| `Helper\JsonSettingsListHelper.cs` | All functions to load the time zones from a JSON file | +| `Helper\ResultHelper.cs` | All functions to convert internal results into WOX results | +| `Helper\TranslationHelper.cs` | All functions to translate the result in the surface language | +| `Images\timeZone.dark.png` | Symbol for the results for the dark theme | +| `Images\timeZone.light.png` | Symbol for the results for the light theme | +| `Properties\Resources.Designer.resx` | File that contain all translatable keys | +| `Properties\Resources.resx` | File that contain all translatable strings in the neutral language | +| `GlobalSuppressions.cs` | Code suppressions (no real file, linked via *.csproj) | +| `Main.cs` | Main class, the only place that implement the WOX interfaces | +| `plugin.json` | All meta-data for this plugin | +| `StyleCop.json` | Code style (no real file, linked via *.csproj) | + +1. We need this extra wrapper class to make it possible that the JSON file can have and use a JSON schema file. +Because the JSON file must have a object as root type, instead of a array. + +### Important project values (*.csproj) + +| Name | Value | +| --------------- | -------------------------------------------------------------------------------------------- | +| TargetFramework | `netcoreapp3.1` (means .NET Core 3.1) | +| Platforms | `x64` | +| Output | `..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeZone\` | +| RootNamespace | `Microsoft.PowerToys.Run.Plugin.TimeZone` | +| AssemblyName | `Microsoft.PowerToys.Run.Plugin.TimeZone` | + +### Project dependencies + +#### Packages + +| Package | Version | +| ------------------------------------------------------------------------------------- | ------- | +| [`StyleCop.Analyzers`](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) | 1.1.118 | + +#### Projects + +* `Wox.Infrastructure` +* `Wox.Plugin` From 0b496ab08d3cefcc267956bf5eefd31c5ef4ecc9 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 19 Jan 2022 16:30:02 +0100 Subject: [PATCH 52/67] Remove double spell entries --- .github/actions/spell-check/expect.txt | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 0279bb0f2c9..ac980ed635e 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -250,8 +250,6 @@ Choibalsan chrdavis chromaticities chrono -chrzan -Chrzan Chrzan CHT Chukotka @@ -1107,9 +1105,6 @@ langword Lastdevice LASTEXITCODE Laute -laute -Laute -Laute laviusmotileng LAYOUTRTL LBUTTON @@ -1547,8 +1542,6 @@ PCIDLIST PCWSTR pdb pdb -Pdb -Pdb pdbonly pdfpreviewhandler pdo @@ -2085,9 +2078,6 @@ systemd SYSTEMTIME systemverilog Tadele -tadele -Tadele -Tadele Tajikistan talynone TApp @@ -2146,9 +2136,6 @@ Toolchain toolkitcontrols toolkitconverters toolset -toolset -Toolset -Toolset toolstrip toolwindow TOPDOWNDIB @@ -2253,8 +2240,7 @@ USESTDHANDLES ushort USRDLL utc -Utc -Utc +UTC utf utils uuidof From e391be26523ee37732affeba5278ae3fc12dc9d4 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Wed, 19 Jan 2022 16:31:12 +0100 Subject: [PATCH 53/67] Remove TODO leftovers --- .../Helper/ResultHelper.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 1d546f4b0a1..c5d67929cf9 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -13,9 +13,6 @@ using Mono.Collections.Generic; using Wox.Plugin; -// FIXME: sometimes daylight countries in tool tips are empty -// TODO: revisited time zone names (use German Wikipedia sites as second reference) -// TODO: revisited countries (use German Wikipedia sites as second reference) namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Helper { /// From 1f10468f0cfda5963fad034de059e8bca8361a42 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 27 Jan 2022 18:21:03 +0100 Subject: [PATCH 54/67] Fix for results with no countries --- .../Helper/ResultHelper.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index c5d67929cf9..9a978a61cb8 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -94,6 +94,12 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim || MatchStandardTimeNames(oneTimeZone, query) || MatchStandardCountries(oneTimeZone, query)) { + var hasCountires = GetStandardCountries(oneTimeZone, null, int.MaxValue).Length > 0; + if (!hasCountires) + { + return results; + } + results.Add(new Result { ContextData = GetTimeInTimeZone(oneTimeZone, dateTime, false), @@ -108,6 +114,12 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim || MatchDaylightTimeNames(oneTimeZone, query) || MatchDaylightCountries(oneTimeZone, query)) { + var hasCountires = GetDaylightCountries(oneTimeZone, null, int.MaxValue).Length > 0; + if (!hasCountires) + { + return results; + } + results.Add(new Result { ContextData = GetTimeInTimeZone(oneTimeZone, dateTime, true), From 54d2f0d3703283857f41b5153a2abde284a3b568 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 27 Jan 2022 18:38:20 +0100 Subject: [PATCH 55/67] Fix typos --- .github/actions/spell-check/expect.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index ac980ed635e..0cae1d64bc4 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -1237,6 +1237,8 @@ MBUTTON MBUTTONDBLCLK MBUTTONDOWN MBUTTONUP +MCDT +MCST MDICHILD MDL mdpreviewhandler @@ -1350,6 +1352,7 @@ muxc mvvm myfile MYICON +MYTZ NAMECHANGE nameof namespace From 3416eed67ef2cd3677cf0872f1e0831c0d1e70ea Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Thu, 27 Jan 2022 18:52:16 +0100 Subject: [PATCH 56/67] fix typos --- .github/actions/spell-check/expect.txt | 16 ++++++++++------ .../Helper/ResultHelper.cs | 8 ++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 0cae1d64bc4..85506416e67 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -131,6 +131,7 @@ AUTOMATIONPROPERTIES Autorun AUTOUPDATE AValid +Avanc Awaitable awakeness awakeversion @@ -275,8 +276,8 @@ Clipperton CLIPSIBLINGS cljs clrcall -Cls cls +Cls CLSCTX clsid cmder @@ -587,8 +588,8 @@ ESettings esize esrp estdir -etcore Eswatini +etcore etl etw Eucla @@ -662,8 +663,8 @@ FLASHZONESONQUICKSWITCH flt flyout fmtlib -FOF fof +FOF FOFX FOLDERID folderpath @@ -1089,10 +1090,10 @@ Kitts Knowlden Knownfolders kotlin +Krai KSPROPERTY ktm kts -Krai Kwango Kwilu Kybd @@ -1544,7 +1545,7 @@ pch PCIDLIST PCWSTR pdb -pdb +Pdb pdbonly pdfpreviewhandler pdo @@ -1586,9 +1587,9 @@ plugin pluginsmodel plx PMSIHANDLE +Pohnpei policheck popd -Pohnpei popup POPUPWINDOW posix @@ -2127,6 +2128,7 @@ timediff Timeline timeunion timeutil +timezone Titlecase TLayout tlb @@ -2139,6 +2141,7 @@ Toolchain toolkitcontrols toolkitconverters toolset +Toolset toolstrip toolwindow TOPDOWNDIB @@ -2243,6 +2246,7 @@ USESTDHANDLES ushort USRDLL utc +Utc UTC utf utils diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs index 9a978a61cb8..f6d3e94581d 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Helper/ResultHelper.cs @@ -94,8 +94,8 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim || MatchStandardTimeNames(oneTimeZone, query) || MatchStandardCountries(oneTimeZone, query)) { - var hasCountires = GetStandardCountries(oneTimeZone, null, int.MaxValue).Length > 0; - if (!hasCountires) + var hasCountries = GetStandardCountries(oneTimeZone, null, int.MaxValue).Length > 0; + if (!hasCountries) { return results; } @@ -114,8 +114,8 @@ private static IEnumerable GetResults(in OneTimeZone oneTimeZone, in Tim || MatchDaylightTimeNames(oneTimeZone, query) || MatchDaylightCountries(oneTimeZone, query)) { - var hasCountires = GetDaylightCountries(oneTimeZone, null, int.MaxValue).Length > 0; - if (!hasCountires) + var hasCountries = GetDaylightCountries(oneTimeZone, null, int.MaxValue).Length > 0; + if (!hasCountries) { return results; } From b5c2f66cf6e2735ab19d83e7db0919b6d436a211 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Sun, 30 Jan 2022 21:38:13 +0100 Subject: [PATCH 57/67] Fix broken siolution after rebase --- PowerToys.sln | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/PowerToys.sln b/PowerToys.sln index d57774572b8..ebbbcb9df2c 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -388,7 +388,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlwaysOnTopModuleInterface" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.PowerToys.Run.Plugin.WebSearch", "src\modules\launcher\Plugins\Community.PowerToys.Run.Plugin.WebSearch\Community.PowerToys.Run.Plugin.WebSearch.csproj", "{9F94B303-5E21-4364-9362-64426F8DB932}" EndProject -<<<<<<< HEAD Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MousePointerCrosshairs", "src\modules\MouseUtils\MousePointerCrosshairs\MousePointerCrosshairs.vcxproj", "{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StlThumbnailProvider", "src\modules\previewpane\StlThumbnailProvider\StlThumbnailProvider.csproj", "{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}" @@ -396,9 +395,8 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests-StlThumbnailProvider", "src\modules\previewpane\UnitTests-StlThumbnailProvider\UnitTests-StlThumbnailProvider.csproj", "{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonacoPreviewHandler", "src\modules\previewpane\MonacoPreviewHandler\MonacoPreviewHandler.csproj", "{04B193D7-3E21-46B8-A958-89B63A8A69DE}" -======= +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.TimeZone", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeZone\Microsoft.PowerToys.Run.Plugin.TimeZone.csproj", "{F44934A8-36F3-49B0-9465-3831BE041CDE}" ->>>>>>> f5e943784 (Initial commit - simple idea for a time zone plugin) EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1065,8 +1063,6 @@ Global {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x64.ActiveCfg = Release|x64 {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x64.Build.0 = Release|x64 {9F94B303-5E21-4364-9362-64426F8DB932}.Release|x86.ActiveCfg = Release|x64 -<<<<<<< HEAD -<<<<<<< HEAD {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x64.ActiveCfg = Debug|x64 {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x64.Build.0 = Debug|x64 {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x86.ActiveCfg = Debug|x64 @@ -1091,14 +1087,10 @@ Global {04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x64.ActiveCfg = Release|x64 {04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x64.Build.0 = Release|x64 {04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x86.ActiveCfg = Release|Any CPU -======= {F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x64.ActiveCfg = Debug|x64 {F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x64.Build.0 = Debug|x64 {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.ActiveCfg = Release|x64 {F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.Build.0 = Release|x64 ->>>>>>> f5e943784 (Initial commit - simple idea for a time zone plugin) -======= ->>>>>>> 6811ff503 (Use timezone Data only from JSON) EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1226,14 +1218,11 @@ Global {1DC3BE92-CE89-43FB-8110-9C043A2FE7A2} = {60CD2D4F-C3B9-4897-9821-FCA5098B41CE} {48A0A19E-A0BE-4256-ACF8-CC3B80291AF9} = {60CD2D4F-C3B9-4897-9821-FCA5098B41CE} {9F94B303-5E21-4364-9362-64426F8DB932} = {4AFC9975-2456-4C70-94A4-84073C1CED93} -<<<<<<< HEAD {EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E} = {322566EF-20DC-43A6-B9F8-616AF942579A} {F7C8C0F1-5431-4347-89D0-8E5354F93CF2} = {2F305555-C296-497E-AC20-5FA1B237996A} {F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC} = {2F305555-C296-497E-AC20-5FA1B237996A} {04B193D7-3E21-46B8-A958-89B63A8A69DE} = {2F305555-C296-497E-AC20-5FA1B237996A} -======= {F44934A8-36F3-49B0-9465-3831BE041CDE} = {4AFC9975-2456-4C70-94A4-84073C1CED93} ->>>>>>> f5e943784 (Initial commit - simple idea for a time zone plugin) EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0} From 3f2d9608e1e933c713098164a873e6fd86b90147 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Mon, 31 Jan 2022 07:20:22 +0100 Subject: [PATCH 58/67] Update target framework to make build happy --- doc/devdocs/modules/launcher/plugins/timeZone.md | 2 +- .../Microsoft.PowerToys.Run.Plugin.TimeZone.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/devdocs/modules/launcher/plugins/timeZone.md b/doc/devdocs/modules/launcher/plugins/timeZone.md index 3bee5671b33..41bad0fc9e7 100644 --- a/doc/devdocs/modules/launcher/plugins/timeZone.md +++ b/doc/devdocs/modules/launcher/plugins/timeZone.md @@ -125,7 +125,7 @@ Because the JSON file must have a object as root type, instead of a array. | Name | Value | | --------------- | -------------------------------------------------------------------------------------------- | -| TargetFramework | `netcoreapp3.1` (means .NET Core 3.1) | +| TargetFramework | `net5.0-windows` (.NET 5) or `net5.0-windows10.0.18362.0` (OS version specific) | | Platforms | `x64` | | Output | `..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeZone\` | | RootNamespace | `Microsoft.PowerToys.Run.Plugin.TimeZone` | diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj index f3bc9ea643b..3282ebfe0ae 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeZone/Microsoft.PowerToys.Run.Plugin.TimeZone.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5.0-windows Microsoft.PowerToys.Run.Plugin.TimeZone Microsoft.PowerToys.Run.Plugin.TimeZone $(Version).0 From 5809b656983bfc753b943049e8e030cea5f4d4d3 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 1 Feb 2022 07:40:02 +0100 Subject: [PATCH 59/67] fix wrong guid count in WXS --- installer/PowerToysSetup/Product.wxs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/PowerToysSetup/Product.wxs b/installer/PowerToysSetup/Product.wxs index 6f020009277..305b5314452 100644 --- a/installer/PowerToysSetup/Product.wxs +++ b/installer/PowerToysSetup/Product.wxs @@ -1359,14 +1359,14 @@