Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-07-28 13:28:52 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-07-29 17:40:06 +0300
commit7907d24ba16fc5a80930c1aabf5144e684ff7f29 (patch)
tree7f4a9500a0167f4ea5b9c41a1113288ffb8f1c95 /common
parent726fe9c3c97a9c979dc7862e7f226fc5ec1341de (diff)
tpl/lang: Add new localized versions of lang.FormatNumber etc.
Fixes #8820
Diffstat (limited to 'common')
-rw-r--r--common/htime/time_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/htime/time_test.go b/common/htime/time_test.go
index 383027755..e8aec0153 100644
--- a/common/htime/time_test.go
+++ b/common/htime/time_test.go
@@ -28,7 +28,7 @@ func TestTimeFormatter(t *testing.T) {
june06 = june06.Add(7777 * time.Second)
c.Run("Norsk nynorsk", func(c *qt.C) {
- f := NewTimeFormatter(translators.Get("nn"))
+ f := NewTimeFormatter(translators.GetTranslator("nn"))
c.Assert(f.Format(june06, "Monday Jan 2 2006"), qt.Equals, "onsdag juni 6 2018")
c.Assert(f.Format(june06, "Mon January 2 2006"), qt.Equals, "on. juni 6 2018")
@@ -36,7 +36,7 @@ func TestTimeFormatter(t *testing.T) {
})
c.Run("Custom layouts Norsk nynorsk", func(c *qt.C) {
- f := NewTimeFormatter(translators.Get("nn"))
+ f := NewTimeFormatter(translators.GetTranslator("nn"))
c.Assert(f.Format(june06, ":date_full"), qt.Equals, "onsdag 6. juni 2018")
c.Assert(f.Format(june06, ":date_long"), qt.Equals, "6. juni 2018")
@@ -51,7 +51,7 @@ func TestTimeFormatter(t *testing.T) {
})
c.Run("Custom layouts English", func(c *qt.C) {
- f := NewTimeFormatter(translators.Get("en"))
+ f := NewTimeFormatter(translators.GetTranslator("en"))
c.Assert(f.Format(june06, ":date_full"), qt.Equals, "Wednesday, June 6, 2018")
c.Assert(f.Format(june06, ":date_long"), qt.Equals, "June 6, 2018")
@@ -66,7 +66,7 @@ func TestTimeFormatter(t *testing.T) {
})
c.Run("English", func(c *qt.C) {
- f := NewTimeFormatter(translators.Get("en"))
+ f := NewTimeFormatter(translators.GetTranslator("en"))
c.Assert(f.Format(june06, "Monday Jan 2 2006"), qt.Equals, "Wednesday Jun 6 2018")
c.Assert(f.Format(june06, "Mon January 2 2006"), qt.Equals, "Wed June 6 2018")
@@ -88,7 +88,7 @@ func BenchmarkTimeFormatter(b *testing.B) {
})
b.Run("Localized", func(b *testing.B) {
- f := NewTimeFormatter(translators.Get("nn"))
+ f := NewTimeFormatter(translators.GetTranslator("nn"))
b.ResetTimer()
for i := 0; i < b.N; i++ {
got := f.Format(june06, "Monday Jan 2 2006")
@@ -99,7 +99,7 @@ func BenchmarkTimeFormatter(b *testing.B) {
})
b.Run("Localized Custom", func(b *testing.B) {
- f := NewTimeFormatter(translators.Get("nn"))
+ f := NewTimeFormatter(translators.GetTranslator("nn"))
b.ResetTimer()
for i := 0; i < b.N; i++ {
got := f.Format(june06, ":date_medium")