Permalink
Browse files

Just a comment.

  • Loading branch information...
1 parent d338380 commit 4d8b3bf7c4f35a1715e7238c1371354f1ee31e5d @krisb78 committed Sep 18, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 simple_translation/translation_pool.py
@@ -86,6 +86,7 @@ def annotate_with_translations(self, list_or_instance):
translations = list(getattr(instance, \
info.translations_of_accessor).filter(**{'%s__in' % info.language_field: languages}))
+ # Helper function that sorts translations according to settings.LANGUAGES
def language_key(translation):
l = getattr(translation, info.language_field)
try:
@@ -123,6 +124,7 @@ def language_key(translation):
new_result_list.append(result_list[index])
result_list = new_result_list
+ # Helper function that sorts translations according to settings.LANGUAGES
def language_key(translation):
l = getattr(translation, info.language_field)
try:
@@ -132,8 +134,7 @@ def language_key(translation):
for result in result_list:
result.translations = sorted(result.translations, key=language_key)
-
-
+
return result_list
def is_registered_translation(self, model):

0 comments on commit 4d8b3bf

Please sign in to comment.