@@ -244,8 +244,12 @@ var (
244
244
monthNamesWelsh = []string {"Ionawr" , "Chwefror" , "Mawrth" , "Ebrill" , "Mai" , "Mehefin" , "Gorffennaf" , "Awst" , "Medi" , "Hydref" , "Tachwedd" , "Rhagfyr" }
245
245
// monthNamesWolof list the month names in the Wolof.
246
246
monthNamesWolof = []string {"Samwiye" , "Fewriye" , "Maars" , "Awril" , "Me" , "Suwe" , "Sullet" , "Ut" , "Septàmbar" , "Oktoobar" , "Noowàmbar" , "Desàmbar" }
247
+ // monthNamesWolofAbbr list the month name abbreviations in Wolof, this prevents string concatenation
248
+ monthNamesWolofAbbr = []string {"Sam." , "Few." , "Maa" , "Awr." , "Me" , "Suw" , "Sul." , "Ut" , "Sept." , "Okt." , "Now." , "Des." }
247
249
// monthNamesXhosa list the month names in the Xhosa.
248
- monthNamesXhosa = []string {"Januwari" , "Febuwari" , "Matshi" , "Aprili" , "Meyi" , "Juni" , "Julayi" , "Agasti" , "Septemba" , "Oktobha" , "Novemba" , "Disemba" }
250
+ monthNamesXhosa = []string {"uJanuwari" , "uFebuwari" , "uMatshi" , "uAprili" , "uMeyi" , "uJuni" , "uJulayi" , "uAgasti" , "uSeptemba" , "uOktobha" , "uNovemba" , "uDisemba" }
251
+ // monthNamesXhosaAbbr list the mont abbreviations in the Xhosa, this prevents string concatenation
252
+ monthNamesXhosaAbbr = []string {"uJan." , "uFeb." , "uMat." , "uEpr." , "uMey." , "uJun." , "uJul." , "uAg." , "uSep." , "uOkt." , "uNov." , "uDis." }
249
253
// monthNamesYi list the month names in the Yi.
250
254
monthNamesYi = []string {"\ua2cd " , "\ua44d " , "\ua315 " , "\ua1d6 " , "\ua26c " , "\ua0d8 " , "\ua3c3 " , "\ua246 " , "\ua22c " , "\ua2b0 " , "\ua2b0 \ua2aa " , "\ua2b0 \ua44b " }
251
255
// monthNamesZulu list the month names in the Zulu.
@@ -594,11 +598,11 @@ func localMonthsNameWelsh(t time.Time, abbr int) string {
594
598
if abbr == 3 {
595
599
switch int (t .Month ()) {
596
600
case 2 , 7 :
597
- return string ([] rune ( monthNamesWelsh [int (t .Month ())- 1 ]) [:5 ])
601
+ return monthNamesWelsh [int (t .Month ())- 1 ][:5 ]
598
602
case 8 , 9 , 11 , 12 :
599
- return string ([] rune ( monthNamesWelsh [int (t .Month ())- 1 ]) [:4 ])
603
+ return monthNamesWelsh [int (t .Month ())- 1 ][:4 ]
600
604
default :
601
- return string ([] rune ( monthNamesWelsh [int (t .Month ())- 1 ]) [:3 ])
605
+ return monthNamesWelsh [int (t .Month ())- 1 ][:3 ]
602
606
}
603
607
}
604
608
if abbr == 4 {
@@ -621,39 +625,21 @@ func localMonthsNameVietnamese(t time.Time, abbr int) string {
621
625
// localMonthsNameWolof returns the Wolof name of the month.
622
626
func localMonthsNameWolof (t time.Time , abbr int ) string {
623
627
if abbr == 3 {
624
- switch int (t .Month ()) {
625
- case 3 , 6 :
626
- return string ([]rune (monthNamesWolof [int (t .Month ())- 1 ])[:3 ])
627
- case 5 , 8 :
628
- return string ([]rune (monthNamesWolof [int (t .Month ())- 1 ])[:2 ])
629
- case 9 :
630
- return string ([]rune (monthNamesWolof [int (t .Month ())- 1 ])[:4 ]) + "."
631
- case 11 :
632
- return "Now."
633
- default :
634
- return string ([]rune (monthNamesWolof [int (t .Month ())- 1 ])[:3 ]) + "."
635
- }
628
+ return monthNamesWolofAbbr [int (t .Month ())- 1 ]
636
629
}
637
630
if abbr == 4 {
638
631
return monthNamesWolof [int (t .Month ())- 1 ]
639
632
}
640
- return string ([] rune ( monthNamesWolof [int (t .Month ())- 1 ]) [:1 ])
633
+ return monthNamesWolof [int (t .Month ())- 1 ][:1 ]
641
634
}
642
635
643
636
// localMonthsNameXhosa returns the Xhosa name of the month.
644
637
func localMonthsNameXhosa (t time.Time , abbr int ) string {
645
638
if abbr == 3 {
646
- switch int (t .Month ()) {
647
- case 4 :
648
- return "uEpr."
649
- case 8 :
650
- return "u" + string ([]rune (monthNamesXhosa [int (t .Month ())- 1 ])[:2 ]) + "."
651
- default :
652
- return "u" + string ([]rune (monthNamesXhosa [int (t .Month ())- 1 ])[:3 ]) + "."
653
- }
639
+ return monthNamesXhosaAbbr [int (t .Month ())- 1 ]
654
640
}
655
641
if abbr == 4 {
656
- return "u" + monthNamesXhosa [int (t .Month ())- 1 ]
642
+ return monthNamesXhosa [int (t .Month ())- 1 ]
657
643
}
658
644
return "u"
659
645
}
0 commit comments