mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Help messages correctly formatted (79 chars)
Help messages are formatted programmatically with FormatParagraph in order not to break existing strings in Transifex. The new format works even if the translation of the strings modifies the lenght of the message. Sqashed 6 commits in a single one. Help messages correctly formatted for SVGA text mode (132 chars) Help messages are formatted programmatically with FormatParagraph in order not to break existing strings in Transifex. The new format should work even if the translation of the strings modifies the lenght of the message. Fix - syntax error Correct formatting for 79 chars Correctly based on C++ functions Removed spare spaces from option strings Fix - syntax error
This commit is contained in:
parent
8cbe1f4f58
commit
1fdb9fa3f9
5 changed files with 187 additions and 155 deletions
15
src/util.cpp
15
src/util.cpp
|
|
@ -346,6 +346,21 @@ bool SoftSetBoolArg(const std::string& strArg, bool fValue)
|
|||
return SoftSetArg(strArg, std::string("0"));
|
||||
}
|
||||
|
||||
static const int screenWidth = 79;
|
||||
static const int optIndent = 2;
|
||||
static const int msgIndent = 7;
|
||||
|
||||
std::string HelpMessageGroup(const std::string &message) {
|
||||
return std::string(message) + std::string("\n\n");
|
||||
}
|
||||
|
||||
std::string HelpMessageOpt(const std::string &option, const std::string &message) {
|
||||
return std::string(optIndent,' ') + std::string(option) +
|
||||
std::string("\n") + std::string(msgIndent,' ') +
|
||||
FormatParagraph(message, screenWidth - msgIndent, msgIndent) +
|
||||
std::string("\n\n");
|
||||
}
|
||||
|
||||
static std::string FormatException(const std::exception* pex, const char* pszThread)
|
||||
{
|
||||
#ifdef WIN32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue