Commit 1e3e524c authored by Adam Leyshon's avatar Adam Leyshon
Browse files

Replaced most hard coded text with translatable strings.

parent a764879f
......@@ -124,7 +124,7 @@ namespace Glitterworld_Prime
break;
case DownloadStatus.Failed:
Messages.Message("GlitterWorld Prime Unavailable.", MessageTypeDefOf.NegativeEvent);
Messages.Message("GWPUnavailable".Translate(), MessageTypeDefOf.NegativeEvent);
Close();
break;
}
......@@ -204,10 +204,10 @@ namespace Glitterworld_Prime
private Dialog_MessageBox AskRenew(Action confirm, Action cancel)
{
var text1 = $"Resubscribe? This will cost {_subscriptionMeta.SubscriptionCost} Silver for 1 Quadrum.";
var text1 = $"{"GWPDialogSubscribe1".Translate()} {_subscriptionMeta.SubscriptionCost} {"GWPCurrency".Translate()} {"GWPDialogSubscribe2".Translate()} {"GWPSubscriptionDuration".Translate()}";
var text2 = "Confirm".Translate();
var text3 = "GoBack".Translate();
var text4 = "GlitterWorld Prime Subscription";
var text4 = "GWPDialogSubscribeTitle".Translate();
return new Dialog_MessageBox(text1, text2, confirm, text3, cancel, text4, false);
}
......@@ -215,10 +215,10 @@ namespace Glitterworld_Prime
private Dialog_MessageBox CannotAffordSub()
{
var s = new StringBuilder();
s.AppendLine("Your GlitterWorld Prime Subscription has ended");
s.AppendLine("But you cannot afford to renew, The cost is: ");
s.AppendLine($"{_subscriptionMeta.SubscriptionCost} Silver");
return new Dialog_MessageBox(s.ToString(), title: "Not enough Silver");
s.AppendLine("GWPDialgoCantAffordSubscription1".Translate());
s.AppendLine("GWPDialgoCantAffordSubscription2".Translate());
s.AppendLine($"{_subscriptionMeta.SubscriptionCost} {"GWPCurrency".Translate()}");
return new Dialog_MessageBox(s.ToString(), title: "GWPDialgoCantAffordSubscriptionTitle".Translate());
}
#endregion
......
......@@ -93,7 +93,7 @@ namespace Glitterworld_Prime
break;
case DownloadStatus.Failed:
Messages.Message("There was an error downloading the data", MessageTypeDefOf.NegativeEvent);
Messages.Message("GWPCantGetMarketData".Translate(), MessageTypeDefOf.NegativeEvent);
Close();
break;
}
......@@ -139,4 +139,4 @@ namespace Glitterworld_Prime
#endregion
}
}
\ No newline at end of file
}
......@@ -122,7 +122,7 @@ namespace Glitterworld_Prime
// Add Silver
var thing = Utilities.CreateThing("Silver", _costOfSubscription);
TradeUtility.SpawnDropPod(DropCellFinder.TradeDropSpot(_player.Map), _player.Map, thing);
Messages.Message("There was an error when subscribing, Your Silver was refunded.",
Messages.Message("GWPCantSubscribe".Translate(),
MessageTypeDefOf.NegativeEvent);
}
......@@ -139,4 +139,4 @@ namespace Glitterworld_Prime
#endregion
}
}
\ No newline at end of file
}
......@@ -61,12 +61,12 @@ namespace Glitterworld_Prime
var dropHadErrors = Utilities.TryDropGoodsOnMap(ThingsOnOrder, MapOrderWasPlaced, out lastDropLocationVec3);
var globalTargetInfo = new GlobalTargetInfo(lastDropLocationVec3, MapOrderWasPlaced);
Messages.Message("Your GlitterWorld Prime order has arrived!", globalTargetInfo,
Messages.Message("GWPOrderArrived".Translate(), globalTargetInfo,
MessageTypeDefOf.PositiveEvent);
if (dropHadErrors)
{
Messages.Message($"Looks like some items didn't make it, please report the issue.",
Messages.Message("GWPOrderFailed".Translate(),
MessageTypeDefOf.NegativeEvent);
// Update the Order status to failed via the API.
NewStatus = "failed";
......@@ -89,4 +89,4 @@ namespace Glitterworld_Prime
#endregion
}
}
\ No newline at end of file
}
......@@ -145,7 +145,7 @@ namespace Glitterworld_Prime
GlitterWorldApi.UpdateOrderStatus(_component.ColonyId, order.Hash, "failed");
order.Status = "failed";
LogWriter.WriteErrorMessage($"Failed to process delivery data for order {order.Hash}");
Messages.Message("There was an error processing the order.", MessageTypeDefOf.NegativeEvent);
Messages.Message("GWPNoOrderMetadata".Translate(), MessageTypeDefOf.NegativeEvent);
}
}
catch (Exception e)
......@@ -243,12 +243,12 @@ namespace Glitterworld_Prime
// Refund thier goods since there was an error.
IntVec3 landingZone;
var dropHasErrors = Utilities.TryDropGoodsOnMap(trader.ThingsSoldToGwp, trader.Map, out landingZone);
Messages.Message("There was an error processing the order, Your items have been returned.",
Messages.Message("GWPProcessingError".Translate(),
new GlobalTargetInfo(landingZone, trader.Map),
MessageTypeDefOf.NegativeEvent);
if (dropHasErrors)
Messages.Message("We had an issue refunding your goods, Sorry :(",
Messages.Message("GWPCantRefund".Translate(),
MessageTypeDefOf.NegativeEvent);
return false;
......@@ -258,7 +258,7 @@ namespace Glitterworld_Prime
CheckForOrdersAsync();
// If there are any items to deliver, send order message.
Messages.Message("Thanks for trading with Glitterworld Prime! Your order will be processed in 24 hours.",
Messages.Message("GWPThanksForOrder".Translate(),
MessageTypeDefOf.PositiveEvent);
return true;
......
......@@ -2,4 +2,21 @@
<LanguageData>
<GWPNeedBaseName>Base name has been set or Map not owned by Player</GWPNeedBaseName>
<GWPNeedUplink>You must construct the GlitterWorld Uplink before using the console.</GWPNeedUplink>
<GWPUnavailable>GlitterWorld Prime Unavailable</GWPUnavailable>
<GWPOrderArrived>Your GlitterWorld Prime order has arrived!</GWPOrderArrived>
<GWPOrderFailed>Looks like some items burned up on re-entry, Please file a bug report</GWPOrderFailed>
<GWPProcessingError>There was an error transmitting your order, Your items have been returned.</GWPProcessingError>
<GWPNoOrderMetadata>We couldn't find the shipping manifest for your order. Please file a bug report</GWPNoOrderMetadata>
<GWPCantRefund>We had an issue refunding your goods, Please file a bug report</GWPCantRefund>
<GWPCantSubscribe>There was an error when subscribing, Your Silver was refunded.</GWPCantSubscribe>
<GWPCantGetMarketData>There was an error downloading the market data, Please try again later</GWPCantGetMarketData>
<GWPThanksForOrder>Thanks for trading with GlitterWorld Prime! We'll keep you updated on your order.</GWPThanksForOrder>
<GWPDialogSubscribeTitle>GlitterWorld Prime Subscription</GWPDialogSubscribeTitle>
<GWPDialogSubscribe1>Resubscribe? This will cost</GWPDialogSubscribe1>
<GWPDialogSubscribe2>for</GWPDialogSubscribe2>
<GWPSubscriptionDuration>1 Quadrum</GWPSubscriptionDuration>
<GWPDialgoCantAffordSubscriptionTitle>Not enough resources</GWPDialgoCantAffordSubscriptionTitle>
<GWPDialgoCantAffordSubscription1>Your GlitterWorld Prime Subscription has ended</GWPDialgoCantAffordSubscription1>
<GWPDialgoCantAffordSubscription2>But you cannot afford to renew, The cost is:</GWPDialgoCantAffordSubscription2>
<GWPCurrency>Silver</GWPCurrency>
</LanguageData>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment