@@ -40,6 +40,36 @@ func (l *Locale) ForumHost() string {
4040 return "www.pathofexile.com"
4141}
4242
43+ var esMonthReplacer = strings .NewReplacer (
44+ "ene" , "Jan" ,
45+ "feb" , "Feb" ,
46+ "mar" , "Mar" ,
47+ "abr" , "Apr" ,
48+ "may" , "May" ,
49+ "jun" , "Jun" ,
50+ "jul" , "Jul" ,
51+ "ago" , "Aug" ,
52+ "sep" , "Sep" ,
53+ "oct" , "Oct" ,
54+ "nov" , "Nov" ,
55+ "dic" , "Dec" ,
56+ )
57+
58+ var brMonthReplacer = strings .NewReplacer (
59+ "de jan de" , "Jan" ,
60+ "de fev de" , "Feb" ,
61+ "de mar de" , "Mar" ,
62+ "de abr de" , "Apr" ,
63+ "de mai de" , "May" ,
64+ "de jun de" , "Jun" ,
65+ "de jul de" , "Jul" ,
66+ "de ago de" , "Aug" ,
67+ "de set de" , "Sep" ,
68+ "de out de" , "Oct" ,
69+ "de nov de" , "Nov" ,
70+ "de dez de" , "Dec" ,
71+ )
72+
4373var thMonthReplacer = strings .NewReplacer (
4474 "ม.ค." , "Jan" ,
4575 "ก.พ." , "Feb" ,
@@ -70,20 +100,35 @@ var frMonthReplacer = strings.NewReplacer(
70100 "déc." , "Dec" ,
71101)
72102
103+ var ruMonthReplacer = strings .NewReplacer (
104+ "янв." , "Jan" ,
105+ "февр." , "Feb" ,
106+ "марта" , "Mar" ,
107+ "апр." , "Apr" ,
108+ "мая" , "May" ,
109+ "июня" , "Jun" ,
110+ "июля" , "Jul" ,
111+ "авг." , "Aug" ,
112+ "сент." , "Sep" ,
113+ "окт." , "Oct" ,
114+ "нояб." , "Nov" ,
115+ "дек." , "Dec" ,
116+ )
117+
73118// TODO: add translations
74119var Locales = []* Locale {
75120 {
76121 IncludeReddit : true ,
77122 Image : "static/images/locales/gb.png" ,
78123 ParseTime : func (s string , tz * time.Location ) (time.Time , error ) {
79- return time .ParseInLocation ("Jan _2, 2006 3:04:05 PM" , s , tz )
124+ return time .ParseInLocation ("Jan _2, 2006, 3:04:05 PM" , s , tz )
80125 },
81126 },
82127 {
83128 Subdomain : "br" ,
84129 Image : "static/images/locales/br.png" ,
85130 ParseTime : func (s string , tz * time.Location ) (time.Time , error ) {
86- return time .ParseInLocation ("2/1/ 2006 15:04:05" , s , tz )
131+ return time .ParseInLocation ("2 Jan 2006 15:04:05" , brMonthReplacer . Replace ( s ) , tz )
87132 },
88133 Translations : map [string ]string {
89134 "Activity" : "Atividade" ,
@@ -97,7 +142,7 @@ var Locales = []*Locale{
97142 Subdomain : "ru" ,
98143 Image : "static/images/locales/ru.png" ,
99144 ParseTime : func (s string , tz * time.Location ) (time.Time , error ) {
100- return time .ParseInLocation ("2.1. 2006 15:04:05" , s , tz )
145+ return time .ParseInLocation ("2 Jan 2006 г., 15:04:05" , ruMonthReplacer . Replace ( s ) , tz )
101146 },
102147 Translations : map [string ]string {
103148 "Activity" : "Активность" ,
@@ -111,14 +156,14 @@ var Locales = []*Locale{
111156 Subdomain : "th" ,
112157 Image : "static/images/locales/th.png" ,
113158 ParseTime : func (s string , tz * time.Location ) (time.Time , error ) {
114- return time .ParseInLocation ("_2 Jan 2006, 15:04:05" , thMonthReplacer .Replace (s ), tz )
159+ return time .ParseInLocation ("_2 Jan 2006 15:04:05" , thMonthReplacer .Replace (s ), tz )
115160 },
116161 },
117162 {
118163 Subdomain : "de" ,
119164 Image : "static/images/locales/de.png" ,
120165 ParseTime : func (s string , tz * time.Location ) (time.Time , error ) {
121- return time .ParseInLocation ("2.1.2006 15:04:05" , s , tz )
166+ return time .ParseInLocation ("2.1.2006, 15:04:05" , s , tz )
122167 },
123168 Translations : map [string ]string {
124169 "Activity" : "Aktivität" ,
@@ -146,7 +191,7 @@ var Locales = []*Locale{
146191 Subdomain : "es" ,
147192 Image : "static/images/locales/es.png" ,
148193 ParseTime : func (s string , tz * time.Location ) (time.Time , error ) {
149- return time .ParseInLocation ("2/1/ 2006 15:04:05" , s , tz )
194+ return time .ParseInLocation ("2 Jan. 2006 15:04:05" , esMonthReplacer . Replace ( s ) , tz )
150195 },
151196 Translations : map [string ]string {
152197 "Activity" : "Actividad" ,
0 commit comments