From 6efb1e5626b8ef5578d56f81ca898fb666bbbe89 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Mon, 27 Jun 2016 13:22:30 -0300 Subject: [PATCH] Localize collaboration settings. (#3100) Closes #2764 --- conf/locale/locale_en-US.ini | 4 ++++ models/repo_collaboration.go | 11 ++++++----- templates/repo/settings/collaboration.tmpl | 8 ++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index 636a1b28f..e7d12ea5e 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -561,6 +561,10 @@ wiki.last_updated = Last updated %s settings = Settings settings.options = Options settings.collaboration = Collaboration +settings.collaboration.admin = Admin +settings.collaboration.write = Write +settings.collaboration.read = Read +settings.collaboration.undefined = Undefined settings.hooks = Webhooks settings.githooks = Git Hooks settings.basic_settings = Basic Settings diff --git a/models/repo_collaboration.go b/models/repo_collaboration.go index b1c5f925a..3da5cf5a0 100644 --- a/models/repo_collaboration.go +++ b/models/repo_collaboration.go @@ -16,16 +16,17 @@ type Collaboration struct { Mode AccessMode `xorm:"DEFAULT 2 NOT NULL"` } -func (c *Collaboration) ModeName() string { +func (c *Collaboration) ModeI18nKey() string { switch c.Mode { case ACCESS_MODE_READ: - return "Read" + return "repo.settings.collaboration.read" case ACCESS_MODE_WRITE: - return "Write" + return "repo.settings.collaboration.write" case ACCESS_MODE_ADMIN: - return "Admin" + return "repo.settings.collaboration.admin" + default: + return "repo.settings.collaboration.undefined" } - return "Undefined" } // AddCollaborator adds new collaboration relation between an individual and a repository. diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index 0ad48f8c9..104e92ceb 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -21,12 +21,12 @@