diff --git a/trans/models.py b/trans/models.py index f18341890..69178a9dc 100644 --- a/trans/models.py +++ b/trans/models.py @@ -84,6 +84,9 @@ class SubProject(models.Model): except: return git.Repo.init(p) + def get_repoweb_link(self, filename, line): + return self.repoweb % {'file': filename, 'line': line} + def configure_repo(self): ''' Ensures repository is correctly configured and points to current remote. @@ -377,7 +380,7 @@ class Unit(models.Model): for location in self.location.split(','): location = location.strip() filename, line = location.split(':') - link = '%s%s#L%s' % (self.translation.subproject.repoweb, filename, line) + link = self.translation.subproject.get_repoweb_link(filename, line) ret.append('%s' % (link, location)) return mark_safe('\n'.join(ret))