Skip to content

Commit

Permalink
add lang file
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGalbreath committed Sep 17, 2023
1 parent fa68905 commit a139058
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions resources/assets/sharablewaypoints/lang/en.json
@@ -0,0 +1,5 @@
{
"cannot-edit": "<font color=\"#7C0A02\">Cannot edit waypoints you do not own!</font>",
"cannot-delete": "<font color=\"#7C0A02\">Cannot delete waypoints you do not own!</font>",
"cannot-save": "<font color=\"#7C0A02\">Cannot save waypoints you do not own!</font>"
}
7 changes: 4 additions & 3 deletions src/Client/SharableWaypointsClient.cs
Expand Up @@ -4,6 +4,7 @@
using SharableWaypoints.Common;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Config;
using Vintagestory.API.Util;
using Vintagestory.GameContent;

Expand Down Expand Up @@ -52,7 +53,7 @@ public class SharableWaypointsClient : Common.SharableWaypoints {
return true;
}

capi.ShowChatMessage("Cannot edit waypoints you do not own!");
capi.ShowChatMessage(Lang.Get("sharablewaypoints:cannot-edit"));
capi.Event.RegisterCallback(_ => { __instance.TryClose(); }, 1);

__result = false;
Expand All @@ -67,7 +68,7 @@ public class SharableWaypointsClient : Common.SharableWaypoints {
return true;
}

capi.ShowChatMessage("Cannot delete waypoints you do not own!");
capi.ShowChatMessage(Lang.Get("sharablewaypoints:cannot-delete"));

__result = true;
return false;
Expand All @@ -81,7 +82,7 @@ public class SharableWaypointsClient : Common.SharableWaypoints {
return true;
}

capi.ShowChatMessage("Cannot edit waypoints you do not own!");
capi.ShowChatMessage(Lang.Get("sharablewaypoints:cannot-save"));

__result = true;
return false;
Expand Down

0 comments on commit a139058

Please sign in to comment.