Commits

Anonymous committed baa4e56

Looking for better fix to EXP-1693 - date localization

Backed out changeset: 4f3024e9d629

Comments (0)

Files changed (5)

indra/llcommon/llstring.cpp

 		struct tm * gmt = gmtime (&loc_seconds);
 		replacement = LLStringOps::sMonthList[gmt->tm_mon];
 	}
-	else if(LLStringOps::sMonthShortList.size() == 12 && code == "%b")
-	{
-		struct tm * gmt = gmtime (&loc_seconds);
-		replacement = LLStringOps::sMonthShortList[gmt->tm_mon];
-	}
 	else if( !LLStringOps::sDayFormat.empty() && code == "%d" )
 	{
 		struct tm * gmt = gmtime (&loc_seconds);

indra/llui/llscrolllistcell.cpp

 
 #include "llscrolllistcell.h"
 
-#include "lltrans.h"
-
 #include "llcheckboxctrl.h"
 #include "llui.h"	// LLUIImage
 #include "lluictrlfactory.h"
 void LLScrollListDate::setValue(const LLSD& value)
 {
 	mDate = value.asDate();
-
-	std::string date_str = LLTrans::getString("ScrollListCellDateFormat");
-	LLSD substitution;
-	substitution["datetime"] = mDate.secondsSinceEpoch();
-	LLStringUtil::format(date_str, substitution);
-
-	LLScrollListText::setValue(date_str);
+	LLScrollListText::setValue(mDate.asRFC1123());
 }
 
 const LLSD LLScrollListDate::getValue() const

indra/newview/llappviewer.cpp

 
 	LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match;
 
-	LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames"));
-	LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames"));
-	LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames"));
-	LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames"));
-	LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat"));
-
-	LLStringOps::sAM = LLTrans::getString("dateTimeAM");
-	LLStringOps::sPM = LLTrans::getString("dateTimePM");
+	//EXT-7013 - On windows for some locale (Japanese) standard 
+	//datetime formatting functions didn't support some parameters such as "weekday".
+	//Names for days and months localized in xml are also useful for Polish locale(STORM-107).
+	std::string language = gSavedSettings.getString("Language");
+	if(language == "ja" || language == "pl")
+	{
+		LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames"));
+		LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames"));
+		LLStringOps::setupMonthNames(LLTrans::getString("dateTimeMonthNames"));
+		LLStringOps::setupMonthShortNames(LLTrans::getString("dateTimeMonthShortNames"));
+		LLStringOps::setupDayFormat(LLTrans::getString("dateTimeDayFormat"));
+
+		LLStringOps::sAM = LLTrans::getString("dateTimeAM");
+		LLStringOps::sPM = LLTrans::getString("dateTimePM");
+	}
 
 	LLAgentLanguage::init();
 

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

   <string name="dateTimeDayFormat">[MDAY]</string>
   <string name="dateTimeAM">AM</string>
   <string name="dateTimePM">PM</string>
-  
-  <!-- Format string for displaying a localized date in a scroll list cell of type "date" -->
-  <string name="ScrollListCellDateFormat">[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]</string>
 
   <!--  currency formatting -->
   <string name="LocalEstimateUSD">US$ [AMOUNT]</string>

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

 		Le propriétaire peut :
 	</panel.string>
 	<panel.string name="acquiredDate">
-		[wkday,datetime,local] [day,datetime,local] [mth,datetime,local] [year,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local]
+		[wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]
 	</panel.string>
 	<panel.string name="origin_inventory">
 		(inventaire)