i18nify some commands

This replaces several strings with i18n-friendly variants so that they
can be internationalized.

Sometimes, the command in English has been reworded, because it was
dumb.

I stopped at GrabUserUserInfo, mostly because I was tired. My
rationale/thinking is that rather than doing a huge commit with the
entire file (which may take a while to build up) it would be better to
get more strings to translators faster. This is because these strings,
in particular, are some of the most important ones to translate.
This commit is contained in:
Lucas Nicodemus 2022-10-21 23:41:50 -07:00
parent 32b2441efc
commit 4632536efb
No known key found for this signature in database
2 changed files with 177 additions and 179 deletions

View file

@ -78,7 +78,7 @@ namespace TShockAPI
set
{
if (value <= 0)
throw new ArgumentException("The value has to be greater than zero.");
throw new ArgumentException(GetString("The value has to be greater than zero."));
this.maxLinesPerPage = value;
}
@ -92,7 +92,7 @@ namespace TShockAPI
set
{
if (value < 0)
throw new ArgumentException("The value has to be greater than or equal to zero.");
throw new ArgumentException(GetString("The value has to be greater than or equal to zero."));
this.pageLimit = value;
}
@ -182,7 +182,7 @@ namespace TShockAPI
catch (Exception ex)
{
throw new InvalidOperationException(
"The method referenced by LineFormatter has thrown an exception. See inner exception for details.", ex);
GetString("The method referenced by LineFormatter has thrown an exception. See inner exception for details."), ex);
}
}
else
@ -244,7 +244,7 @@ namespace TShockAPI
catch (Exception ex)
{
throw new ArgumentException(
"The method represented by termFormatter has thrown an exception. See inner exception for details.", ex);
GetString("The method represented by termFormatter has thrown an exception. See inner exception for details."), ex);
}
}
else
@ -280,7 +280,7 @@ namespace TShockAPI
if (!int.TryParse(pageNumberRaw, out pageNumber) || pageNumber < 1)
{
if (errorMessageReceiver != null)
errorMessageReceiver.SendErrorMessage("\"{0}\" is not a valid page number.", pageNumberRaw);
errorMessageReceiver.SendErrorMessage(GetString("\"{0}\" is not a valid page number.", pageNumberRaw));
pageNumber = 1;
return false;
@ -289,4 +289,4 @@ namespace TShockAPI
return true;
}
}
}
}