1
0
Fork 0
forked from forgejo/forgejo

Localize collaboration settings. (#3100)

Closes #2764
This commit is contained in:
Andrey Nering 2016-06-27 13:22:30 -03:00 committed by 无闻
parent 73b4acbb63
commit 6efb1e5626
3 changed files with 14 additions and 9 deletions

View file

@ -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.