Skip to content

Commit

Permalink
Localize the new notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
KazWolfe committed Apr 23, 2024
1 parent 50400b1 commit 99279ec
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
31 changes: 31 additions & 0 deletions FFXIVPlugin/Resources/Localization/UIStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions FFXIVPlugin/Resources/Localization/UIStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,17 @@ This will not re-enable the plugin.</value>
<data name="SetupNag_BypassHint" xml:space="preserve">
<value>Don't care? Hold CTRL to bypass this dialog!</value>
</data>
<data name="WSInitOpcode_PluginUpdateAvailableNotificationTitle" xml:space="preserve">
<value>Plugin Update Available</value>
</data>
<data name="WSInitOpcode_SDPluginUpdateBody" xml:space="preserve">
<value>Some features may not be available or work properly.

Click this notification to </value>
</data>
<data name="WSInitOpcode_SDPluginUpdateNotificationBody" xml:space="preserve">
<value>Version {0} of the XIVDeck Stream Deck Plugin is currently outdated. Some features may not be available or work properly.

Click this notification to go to the version {1} download page.</value>
</data>
</root>
13 changes: 6 additions & 7 deletions FFXIVPlugin/Server/Messages/Inbound/WSInitOpcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Game.Chat;
using XIVDeck.FFXIVPlugin.Resources.Localization;
using XIVDeck.FFXIVPlugin.Resources.Localization;

Check warning on line 11 in FFXIVPlugin/Server/Messages/Inbound/WSInitOpcode.cs

View workflow job for this annotation

GitHub Actions / Build XIVDeck FFXIV Plugin

The using directive for 'XIVDeck.FFXIVPlugin.Resources.Localization' appeared previously in this namespace

Check warning on line 11 in FFXIVPlugin/Server/Messages/Inbound/WSInitOpcode.cs

View workflow job for this annotation

GitHub Actions / Build XIVDeck FFXIV Plugin

The using directive for 'XIVDeck.FFXIVPlugin.Resources.Localization' appeared previously in this namespace
using XIVDeck.FFXIVPlugin.Server.Helpers;
using XIVDeck.FFXIVPlugin.Server.Messages.Outbound;
using XIVDeck.FFXIVPlugin.UI.Windows;
Expand Down Expand Up @@ -52,14 +53,12 @@ await context.WebSocket.CloseAsync(CloseStatusCode.ProtocolError,
// version check behavior
if (this.Mode is PluginMode.Plugin) {
if (Injections.PluginInterface is {IsTesting: true, IsDev: false} && sdPluginVersion < xivPluginVersion) {
TestingUpdateNag.Show();
TestingUpdateNag.Show();
} else if (sdPluginVersion < xivPluginVersion) {
var n = Injections.NotificationManager.AddNotification(new Notification
{
Title = "Plugin Update Available",
Content = $"Version {sdPluginVersion} of the XIVDeck Stream Deck Plugin is currently outdated. " +
$"Some features may not be available or work properly.\n\nClick this notification to " +
$"go to the version {xivPluginVersion} download page.",
Title = UIStrings.WSInitOpcode_PluginUpdateAvailableNotificationTitle,
Content = string.Format(UIStrings.WSInitOpcode_SDPluginUpdateNotificationBody, sdPluginVersion, xivPluginVersion),
Type = NotificationType.Warning,
Minimized = false,
RespectUiHidden = false,
Expand All @@ -74,7 +73,7 @@ await context.WebSocket.CloseAsync(CloseStatusCode.ProtocolError,
} else if (sdPluginVersion > xivPluginVersion) {
var n = Injections.NotificationManager.AddNotification(new Notification
{
Title = "Plugin Update Available",
Title = UIStrings.WSInitOpcode_PluginUpdateAvailableNotificationTitle,
Content = UIStrings.WSInitOpcode_GamePluginOutdated,
Type = NotificationType.Warning,
Minimized = false,
Expand All @@ -96,4 +95,4 @@ await context.WebSocket.CloseAsync(CloseStatusCode.ProtocolError,
XIVDeckPlugin.Instance.Configuration.Save();
}
}
}
}

0 comments on commit 99279ec

Please sign in to comment.