Win32: Added @uptime template token and MS_UPTIME stringid to goldlang.cfg

This commit is contained in:
Ianos Gnatiuc
2007-01-19 17:38:41 +00:00
parent c265a58103
commit 2c67afec51
17 changed files with 62 additions and 18 deletions

View File

@@ -86,6 +86,8 @@ static LangCrc LangCrcs[] = {
{ CRC_MS_LMNOVEMBER , NULL , "November" },
{ CRC_MS_LMDECEMBER , NULL , "December" },
{ CRC_MS_UPTIME , NULL , "%days day(s) %hours:%minutes:%seconds.%useconds" },
{ CRC_ST_IMPORTFILE , NULL , "Import File" },
{ CRC_WT_IMPORTWHICHFILE , NULL , " Import which file? " },
{ CRC_WT_IMPORTPICK , NULL , " Import " },

View File

@@ -70,6 +70,8 @@ const word CRC_MS_LMOCTOBER = 0x51C9;
const word CRC_MS_LMNOVEMBER = 0x107D;
const word CRC_MS_LMDECEMBER = 0x7733;
const word CRC_MS_UPTIME = 0x383A;
const word CRC_ST_IMPORTFILE = 0x027D;
const word CRC_WT_IMPORTWHICHFILE = 0xF718;
const word CRC_WT_IMPORTTXT = 0xB5DB;

View File

@@ -72,6 +72,8 @@ struct LangGed {
char* LMNovember; // MS_LMNOVEMBER
char* LMDecember; // MS_LMDECEMBER
char* Uptime; // MS_UPTIME
char* ImportFile; // ST_IMPORTFILE
char* ImportWhichFile; // WT_IMPORTWHICHFILE
char* ImportTitle; // WT_IMPORTPICK

View File

@@ -140,6 +140,7 @@ inline bool domain_requested(const char *str, size_t pos)
return strnieql(str+pos, "{domain}", 8);
}
// ------------------------------------------------------------------
void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __origarea)
@@ -682,7 +683,7 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig
continue;
}
#if 0
#ifdef __WIN32__
if (strnieql(it2str(input, dst), "@uptime", 7))
{
size_t days = 0;
@@ -704,21 +705,16 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig
hours = seconds/(60*60); seconds %= 60*60;
minutes = seconds/60; seconds %= 60;
char uptime[1024];
/*
FormatString(
FormatString(
FormatString(
FormatString(
FormatString("%days day(s) %hours:%minutes:%seconds.%useconds",
"%days", days),
"%hours", hours),
"%minutes", minutes),
"%seconds", seconds),
"%useconds", useconds);
*/
std::string uptime(LNG->Uptime);
tokenxchg(input, dst, "@uptime", uptime);
FormatString( FormatString( FormatString( FormatString( FormatString(
uptime, "%days", days),
"%hours", hours),
"%minutes", minutes),
"%seconds", seconds),
"%useconds", useconds);
tokenxchg(input, dst, "@uptime", uptime.c_str());
}
#endif
}