|
@@ -5,9 +5,15 @@ from django import template
|
|
|
from django.utils.safestring import mark_safe
|
|
|
from django.utils.html import escape
|
|
|
from rapid.views import registry, ModelData
|
|
|
+from django.utils.translation import to_locale, get_language
|
|
|
|
|
|
register = template.Library()
|
|
|
|
|
|
+try:
|
|
|
+ locale.setlocale(locale.LC_ALL, str(to_locale(get_language())))
|
|
|
+except:
|
|
|
+ locale.setlocale(locale.LC_ALL, str('C'))
|
|
|
+
|
|
|
def _app_menu(app, request):
|
|
|
models = list(app.models)
|
|
|
models.sort(key=lambda m: ModelData(m).model_name(), cmp=locale.strcoll)
|