forked from goodsign/monday
-
Notifications
You must be signed in to change notification settings - Fork 1
/
format_pt_pt.go
72 lines (64 loc) · 1.78 KB
/
format_pt_pt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package monday
import "strings"
// ============================================================
// Format rules for "pt_PT" locale: Portuguese (Portugal)
// ============================================================
var longDayNamesPtPT = map[string]string{
"Sunday": "Domingo",
"Monday": "Segunda-feira",
"Tuesday": "Terça-feira",
"Wednesday": "Quarta-feira",
"Thursday": "Quinta-feira",
"Friday": "Sexta-feira",
"Saturday": "Sábado",
}
var shortDayNamesPtPT = map[string]string{
"Sun": "dom",
"Mon": "seg",
"Tue": "ter",
"Wed": "qua",
"Thu": "qui",
"Fri": "sex",
"Sat": "sáb",
}
var longMonthNamesPtPT = map[string]string{
"January": "Janeiro",
"February": "Fevereiro",
"March": "Março",
"April": "Abril",
"May": "Maio",
"June": "Junho",
"July": "Julho",
"August": "Agosto",
"September": "Setembro",
"October": "Outubro",
"November": "Novembro",
"December": "Dezembro",
}
var shortMonthNamesPtPT = map[string]string{
"Jan": "Jan",
"Feb": "Fev",
"Mar": "Mar",
"Apr": "Abr",
"May": "Mai",
"Jun": "Jun",
"Jul": "Jul",
"Aug": "Ago",
"Sep": "Set",
"Oct": "Out",
"Nov": "Nov",
"Dec": "Dez",
}
func parseFuncPtCommon(locale Locale) internalParseFunc {
return func(layout, value string) string {
// This special case is needed because Pt_PT/Pt_BR/... contains day-of-week names
// that consist of two words and a delimiter (like 'terça-feira'). These
// should be replaced before using the standard procedure correctly.
for k, v := range knownDaysLongReverse[locale] {
value = strings.Replace(value, k, v, -1)
}
return commonFormatFunc(value, layout,
knownDaysShortReverse[locale], knownDaysLongReverse[locale],
knownMonthsShortReverse[locale], knownMonthsLongReverse[locale], knownPeriods[locale])
}
}