From 7b03b1df0efab201b48001200b17ed3390fa83da Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 9 Oct 2014 18:35:09 -0400 Subject: [PATCH] Allow custom locale --- cmd/web.go | 12 +++++++----- public/ng/css/gogs.css | 1 + public/ng/less/gogs/base.less | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmd/web.go b/cmd/web.go index 9f2ec8b824..77260b7241 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -67,7 +67,7 @@ func checkVersion() { log.Fatal(4, "Macaron version is too old, did you forget to update?(github.com/Unknwon/macaron)") } i18nVer := git.MustParseVersion(i18n.Version()) - if i18nVer.LessThan(git.MustParseVersion("0.0.1")) { + if i18nVer.LessThan(git.MustParseVersion("0.0.2")) { log.Fatal(4, "i18n version is too old, did you forget to update?(github.com/macaron-contrib/i18n)") } } @@ -92,10 +92,12 @@ func newMacaron() *macaron.Macaron { IndentJSON: macaron.Env != macaron.PROD, })) m.Use(i18n.I18n(i18n.Options{ - SubURL: setting.AppSubUrl, - Langs: setting.Langs, - Names: setting.Names, - Redirect: true, + SubURL: setting.AppSubUrl, + Directory: path.Join(setting.ConfRootPath, "locale"), + CustomDirectory: path.Join(setting.CustomPath, "conf/locale"), + Langs: setting.Langs, + Names: setting.Names, + Redirect: true, })) m.Use(cache.Cacher(cache.Options{ Adapter: setting.CacheAdapter, diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css index feb21c97c2..af95092f95 100644 --- a/public/ng/css/gogs.css +++ b/public/ng/css/gogs.css @@ -88,6 +88,7 @@ img.avatar-100 { z-index: 100; font-size: 12px; width: 120%; + min-width: 100px; } #footer-lang .drop-down li > a { padding: 3px 9px; diff --git a/public/ng/less/gogs/base.less b/public/ng/less/gogs/base.less index f715ed0630..de1781a449 100644 --- a/public/ng/less/gogs/base.less +++ b/public/ng/less/gogs/base.less @@ -102,6 +102,7 @@ clear: both; z-index: 100; font-size: 12px; width: 120%; + min-width: 100px; li > a { padding: 3px 9px; }