From 159953050a9c4fb700bbde79042ead4843b0bea5 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 2 Jun 2016 16:47:26 -0300 Subject: PLT-1800 Load server side locale from the config.json (#3202) * PLT-1800 Load server side locale from the config.json * Add support for locales with country specifics * Fix localization on served locale file as plain/text * Remove github.com/cloudfoundry/jibber_jabber as vendor dependency * Fix get locale on login_controller --- .../jibber_jabber/jibber_jabber_unix_test.go | 104 --------------------- 1 file changed, 104 deletions(-) delete mode 100644 vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go (limited to 'vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go') diff --git a/vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go b/vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go deleted file mode 100644 index a5e3074a2..000000000 --- a/vendor/github.com/cloudfoundry/jibber_jabber/jibber_jabber_unix_test.go +++ /dev/null @@ -1,104 +0,0 @@ -// +build darwin freebsd linux netbsd openbsd - -package jibber_jabber_test - -import ( - "os" - - . "github.com/cloudfoundry/jibber_jabber" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Unix", func() { - AfterEach(func() { - os.Setenv("LC_ALL", "") - os.Setenv("LANG", "en_US.UTF-8") - }) - - Describe("#DetectIETF", func() { - Context("Returns IETF encoded locale", func() { - It("should return the locale set to LC_ALL", func() { - os.Setenv("LC_ALL", "fr_FR.UTF-8") - result, _ := DetectIETF() - Ω(result).Should(Equal("fr-FR")) - }) - - It("should return the locale set to LANG if LC_ALL isn't set", func() { - os.Setenv("LANG", "fr_FR.UTF-8") - - result, _ := DetectIETF() - Ω(result).Should(Equal("fr-FR")) - }) - - It("should return an error if it cannot detect a locale", func() { - os.Setenv("LANG", "") - - _, err := DetectIETF() - Ω(err.Error()).Should(Equal(COULD_NOT_DETECT_PACKAGE_ERROR_MESSAGE)) - }) - }) - - Context("when the locale is simply 'fr'", func() { - BeforeEach(func() { - os.Setenv("LANG", "fr") - }) - - It("should return the locale without a territory", func() { - language, err := DetectIETF() - Ω(err).ShouldNot(HaveOccurred()) - Ω(language).Should(Equal("fr")) - }) - }) - }) - - Describe("#DetectLanguage", func() { - Context("Returns encoded language", func() { - It("should return the language set to LC_ALL", func() { - os.Setenv("LC_ALL", "fr_FR.UTF-8") - result, _ := DetectLanguage() - Ω(result).Should(Equal("fr")) - }) - - It("should return the language set to LANG if LC_ALL isn't set", func() { - os.Setenv("LANG", "fr_FR.UTF-8") - - result, _ := DetectLanguage() - Ω(result).Should(Equal("fr")) - }) - - It("should return an error if it cannot detect a language", func() { - os.Setenv("LANG", "") - - _, err := DetectLanguage() - Ω(err.Error()).Should(Equal(COULD_NOT_DETECT_PACKAGE_ERROR_MESSAGE)) - }) - }) - }) - - Describe("#DetectTerritory", func() { - Context("Returns encoded territory", func() { - It("should return the territory set to LC_ALL", func() { - os.Setenv("LC_ALL", "fr_FR.UTF-8") - result, _ := DetectTerritory() - Ω(result).Should(Equal("FR")) - }) - - It("should return the territory set to LANG if LC_ALL isn't set", func() { - os.Setenv("LANG", "fr_FR.UTF-8") - - result, _ := DetectTerritory() - Ω(result).Should(Equal("FR")) - }) - - It("should return an error if it cannot detect a territory", func() { - os.Setenv("LANG", "") - - _, err := DetectTerritory() - Ω(err.Error()).Should(Equal(COULD_NOT_DETECT_PACKAGE_ERROR_MESSAGE)) - }) - }) - }) - -}) -- cgit v1.2.3-1-g7c22