Vadim ProductEngine avatar Vadim ProductEngine committed 633a050

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/

Comments (0)

Files changed (13)

indra/llcommon/llstring.cpp

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02
 		replacement = LLStringOps::sDayFormat;
 		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" )
 	{
 		struct tm * gmt = gmtime (&loc_seconds);

indra/newview/skins/default/xui/da/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/de/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/en/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/es/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/fr/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/fr/panel_landmark_info.xml

 		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 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>
 	<button name="back_btn" tool_tip="Précédent"/>
 	<text name="title" value="Profil du lieu"/>

indra/newview/skins/default/xui/fr/panel_status_bar.xml

 		[hour12, datetime, slt]:[min, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt]
 	</panel.string>
 	<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 name="buycurrencylabel">
 		[AMT] L$

indra/newview/skins/default/xui/it/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/ja/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/nl/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/pl/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02

indra/newview/skins/default/xui/pt/language_settings.xml

 	datetimeToCodes["month"]	= "%B";		// August
 	datetimeToCodes["mthnum"]	= "%m";		// 08
 	datetimeToCodes["day"]		= "%d";		// 31
+	datetimeToCodes["sday"]		= "%-d";	// 9
 	datetimeToCodes["hour24"]	= "%H";		// 14
 	datetimeToCodes["hour"]		= "%H";		// 14
 	datetimeToCodes["hour12"]	= "%I";		// 02
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.