From 0135904f7d3e1c0e763adaefe267c736616e3d26 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 16 Nov 2016 19:28:52 -0500 Subject: Upgrading server dependancies (#4566) --- .../nicksnyder/go-i18n/i18n/example_test.go | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'vendor/github.com/nicksnyder/go-i18n/i18n/example_test.go') diff --git a/vendor/github.com/nicksnyder/go-i18n/i18n/example_test.go b/vendor/github.com/nicksnyder/go-i18n/i18n/example_test.go index d2d9706a7..305c5b3df 100644 --- a/vendor/github.com/nicksnyder/go-i18n/i18n/example_test.go +++ b/vendor/github.com/nicksnyder/go-i18n/i18n/example_test.go @@ -30,6 +30,15 @@ func Example() { fmt.Println(T("person_unread_email_count", 1, bobStruct)) fmt.Println(T("person_unread_email_count", 2, bobStruct)) + type Count struct{ Count int } + fmt.Println(T("your_unread_email_count", Count{0})) + fmt.Println(T("your_unread_email_count", Count{1})) + fmt.Println(T("your_unread_email_count", Count{2})) + + fmt.Println(T("your_unread_email_count", map[string]interface{}{"Count": 0})) + fmt.Println(T("your_unread_email_count", map[string]interface{}{"Count": "1"})) + fmt.Println(T("your_unread_email_count", map[string]interface{}{"Count": "3.14"})) + fmt.Println(T("person_unread_email_count_timeframe", 3, map[string]interface{}{ "Person": "Bob", "Timeframe": T("d_days", 0), @@ -43,6 +52,22 @@ func Example() { "Timeframe": T("d_days", 2), })) + fmt.Println(T("person_unread_email_count_timeframe", 1, map[string]interface{}{ + "Count": 30, + "Person": "Bob", + "Timeframe": T("d_days", 0), + })) + fmt.Println(T("person_unread_email_count_timeframe", 2, map[string]interface{}{ + "Count": 20, + "Person": "Bob", + "Timeframe": T("d_days", 1), + })) + fmt.Println(T("person_unread_email_count_timeframe", 3, map[string]interface{}{ + "Count": 10, + "Person": "Bob", + "Timeframe": T("d_days", 2), + })) + // Output: // Hello world // Hello Bob @@ -57,7 +82,16 @@ func Example() { // Bob has 0 unread emails. // Bob has 1 unread email. // Bob has 2 unread emails. + // You have 0 unread emails. + // You have 1 unread email. + // You have 2 unread emails. + // You have 0 unread emails. + // You have 1 unread email. + // You have 3.14 unread emails. // Bob has 3 unread emails in the past 0 days. // Bob has 3 unread emails in the past 1 day. // Bob has 3 unread emails in the past 2 days. + // Bob has 1 unread email in the past 0 days. + // Bob has 2 unread emails in the past 1 day. + // Bob has 3 unread emails in the past 2 days. } -- cgit v1.2.3-1-g7c22