Skip to content
Snippets Groups Projects
Commit b1031415 authored by Vadim Savchuk's avatar Vadim Savchuk
Browse files

EXT-8309 FIXED Incorrect French date format in place profile and status bar.

Changes:
- Added support for formatting day of the month without leading zero ("sday").
- Changed date format in place profile (landmark info) and in the top status bar
  according to bug reporter's request.

Technical details:
Actually implementation of strftime() in Linux and Windows supports stripping the
leading zero (with "%-d" and "%#d" respectively).
But that's not supported in MacOSX, so I had to reimplement it.

Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/842/
parent 35f279a9
No related branches found
No related tags found
No related merge requests found
Showing
with 18 additions and 2 deletions
...@@ -758,6 +758,7 @@ void LLStringOps::setupDatetimeInfo (bool daylight) ...@@ -758,6 +758,7 @@ void LLStringOps::setupDatetimeInfo (bool daylight)
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
...@@ -1127,6 +1128,11 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, ...@@ -1127,6 +1128,11 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
replacement = LLStringOps::sDayFormat; replacement = LLStringOps::sDayFormat;
LLStringUtil::format(replacement, args); LLStringUtil::format(replacement, args);
} }
else if (code == "%-d")
{
struct tm * gmt = gmtime (&loc_seconds);
replacement = llformat ("%d", gmt->tm_mday); // day of the month without leading zero
}
else if( !LLStringOps::sAM.empty() && !LLStringOps::sPM.empty() && code == "%p" ) else if( !LLStringOps::sAM.empty() && !LLStringOps::sPM.empty() && code == "%p" )
{ {
struct tm * gmt = gmtime (&loc_seconds); struct tm * gmt = gmtime (&loc_seconds);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
Les informations sur ce lieu ne sont pas disponibles car l'accès y est restreint. Veuillez vérifier vos droits avec le propriétaire de la parcelle. Les informations sur ce lieu ne sont pas disponibles car l'accès y est restreint. Veuillez vérifier vos droits avec le propriétaire de la parcelle.
</string> </string>
<string name="acquired_date"> <string name="acquired_date">
[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] [weekday,datetime,local] [sday,datetime,local] [month,datetime,local] [year,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local]
</string> </string>
<button name="back_btn" tool_tip="Précédent"/> <button name="back_btn" tool_tip="Précédent"/>
<text name="title" value="Profil du lieu"/> <text name="title" value="Profil du lieu"/>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[hour12, datetime, slt]:[min, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt] [hour12, datetime, slt]:[min, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt]
</panel.string> </panel.string>
<panel.string name="timeTooltip"> <panel.string name="timeTooltip">
[weekday, datetime, slt], [day, datetime, slt] [month, datetime, slt] [year, datetime, slt] [weekday, datetime, slt] [sday, datetime, slt] [month, datetime, slt] [year, datetime, slt]
</panel.string> </panel.string>
<panel.string name="buycurrencylabel"> <panel.string name="buycurrencylabel">
[AMT] L$ [AMT] L$
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
datetimeToCodes["month"] = "%B"; // August datetimeToCodes["month"] = "%B"; // August
datetimeToCodes["mthnum"] = "%m"; // 08 datetimeToCodes["mthnum"] = "%m"; // 08
datetimeToCodes["day"] = "%d"; // 31 datetimeToCodes["day"] = "%d"; // 31
datetimeToCodes["sday"] = "%-d"; // 9
datetimeToCodes["hour24"] = "%H"; // 14 datetimeToCodes["hour24"] = "%H"; // 14
datetimeToCodes["hour"] = "%H"; // 14 datetimeToCodes["hour"] = "%H"; // 14
datetimeToCodes["hour12"] = "%I"; // 02 datetimeToCodes["hour12"] = "%I"; // 02
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment