Skip to content

Commit

Permalink
[MSI] Check validity of translated strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Aug 8, 2022
1 parent 75ab58d commit 0857d7b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/KKS_MoreStoreItems/Features/EroDetectorFeat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,21 @@ public bool ApplyFeature(ref CompositeDisposable disp, MoreShopItemsPlugin inst)
_notifyMast = inst.Config.Bind(itemName, "Notification on masturbation", true, "If the item is purchased, show a notification whenever any NPC starts a masturbation action.");
_notifyLesb = inst.Config.Bind(itemName, "Notification on lesbian", true, "If the item is purchased, show a notification whenever any NPC starts a lesbian action.");

TranslationHelper.TranslateAsync(_infoTextPrefixGeneral, s => _infoTextPrefixGeneral = s);
TranslationHelper.TranslateAsync(_infoTextPrefixMast, s => _infoTextPrefixMast = s);
TranslationHelper.TranslateAsync(_infoTextPrefixLesb, s => _infoTextPrefixLesb = s);
TranslationHelper.TranslateAsync(_infoTextPrefixGeneral, s =>
{
if (s.Contains("{0}")) _infoTextPrefixGeneral = s;
else MoreShopItemsPlugin.Logger.LogWarning($"Invalid format of translation of {_infoTextPrefixGeneral} -> {s}");
});
TranslationHelper.TranslateAsync(_infoTextPrefixMast, s =>
{
if (s.Contains("{0}") && s.Contains("{1}")) _infoTextPrefixMast = s;
else MoreShopItemsPlugin.Logger.LogWarning($"Invalid format of translation of {_infoTextPrefixMast} -> {s}");
});
TranslationHelper.TranslateAsync(_infoTextPrefixLesb, s =>
{
if (s.Contains("{0}") && s.Contains("{1}")) _infoTextPrefixLesb = s;
else MoreShopItemsPlugin.Logger.LogWarning($"Invalid format of translation of {_infoTextPrefixLesb} -> {s}");
});

return true;
}
Expand Down

0 comments on commit 0857d7b

Please sign in to comment.