Commit 1520d46a320e9813b708b456e192bc5bfd6baf5d
1 parent
b3f26560
Exists in
master
and in
34 other branches
Add translated string to Menu text
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Carolina Ramalho <carol15022@hotmail.com> Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
colab/proxy/templatetags/proxy.py
@@ -4,6 +4,7 @@ from django.core.urlresolvers import reverse | @@ -4,6 +4,7 @@ from django.core.urlresolvers import reverse | ||
4 | from django import template | 4 | from django import template |
5 | from django.core.cache import cache | 5 | from django.core.cache import cache |
6 | from django.template.loader import render_to_string | 6 | from django.template.loader import render_to_string |
7 | +from django.utils.translation import ugettext_lazy as _ | ||
7 | 8 | ||
8 | register = template.Library() | 9 | register = template.Library() |
9 | 10 | ||
@@ -24,7 +25,6 @@ def proxy_menu(context): | @@ -24,7 +25,6 @@ def proxy_menu(context): | ||
24 | proxied_apps = context.get('proxy', {}) | 25 | proxied_apps = context.get('proxy', {}) |
25 | 26 | ||
26 | for app_name, app in proxied_apps.items(): | 27 | for app_name, app in proxied_apps.items(): |
27 | - print app | ||
28 | if not app.get('menu'): | 28 | if not app.get('menu'): |
29 | continue | 29 | continue |
30 | 30 | ||
@@ -38,11 +38,11 @@ def proxy_menu(context): | @@ -38,11 +38,11 @@ def proxy_menu(context): | ||
38 | continue | 38 | continue |
39 | 39 | ||
40 | if title not in menu_links: | 40 | if title not in menu_links: |
41 | - menu_links[title] = [] | 41 | + menu_links[_(title)] = [] |
42 | 42 | ||
43 | for text, link in links: | 43 | for text, link in links: |
44 | url = link | 44 | url = link |
45 | - menu_links[title].append((text, url)) | 45 | + menu_links[_(title)].append((_(text), url)) |
46 | 46 | ||
47 | menu = render_to_string('proxy/menu_template.html', | 47 | menu = render_to_string('proxy/menu_template.html', |
48 | {'menu_links': menu_links}) | 48 | {'menu_links': menu_links}) |