Repository: nextcloud/appstore

Issue:
Document Transifex translation process
In addition to the current translation documentation there should be a better guide on how to join the translator team and where to translate the app



Discussion:

Resolving patch:
diff --git a/nextcloudappstore/core/views.py b/nextcloudappstore/core/views.py
--- a/nextcloudappstore/core/views.py
+++ b/nextcloudappstore/core/views.py
@@ -54,27 +54,29 @@ def post(self, request, id):
 
     def get_context_data(self, **kwargs):
         context = super().get_context_data(**kwargs)
-        try:
-            app_rating = AppRating.objects.get(user=self.request.user,
-                                               app=context['app'])
-            # when accessing an empty comment django-parler tries to fall back
-            # to the default language. However for comments the default
-            # (English) does not always exist. Unfortunately it throws the
-            # same exception as non existing models, so we need to access it
-            # beforehand
+        context['rating_form'] = AppRatingForm()
+        context['user_has_rated_app'] = False
+        if self.request.user.is_authenticated():
             try:
-                comment = app_rating.comment
+                app_rating = AppRating.objects.get(user=self.request.user,
+                                                   app=context['app'])
+                # when accessing an empty comment django-parler tries to
+                # fall back to the default language. However for comments
+                # the default (English) does not always exist. Unfortunately
+                # it throws the same exception as non existing models,
+                # so we need to access it beforehand
+                try:
+                    comment = app_rating.comment
+                except AppRating.DoesNotExist:
+                    comment = ''
+
+                context['rating_form'] = AppRatingForm(initial={
+                    'rating': app_rating.rating,
+                    'comment': comment
+                })
+                context['user_has_rated_app'] = True
             except AppRating.DoesNotExist:
-                comment = ''
-
-            context['rating_form'] = AppRatingForm(initial={
-                'rating': app_rating.rating,
-                'comment': comment
-            })
-            context['user_has_rated_app'] = True
-        except AppRating.DoesNotExist:
-            context['rating_form'] = AppRatingForm()
-            context['user_has_rated_app'] = False
+                pass
         context['categories'] = Category.objects.all()
         context['latest_releases_by_platform_v'] = \
             self.object.latest_releases_by_platform_v()
diff --git a/nextcloudappstore/settings/base.py b/nextcloudappstore/settings/base.py
--- a/nextcloudappstore/settings/base.py
+++ b/nextcloudappstore/settings/base.py
@@ -153,9 +153,10 @@
 USE_L10N = True
 USE_TZ = True
 
+EXCLUDED_LANGS = ('en-au', 'en-gb')
+LANGUAGES = [lang for lang in LANGUAGES if lang[0] not in EXCLUDED_LANGS]
 PARLER_LANGUAGES = {
-    1: [{'code': code} for code, trans in LANGUAGES
-        if code not in ('en-au', 'en-gb')],
+    1: [{'code': code} for code, trans in LANGUAGES],
     'default': {
         'fallbacks': ['en'],
         'hide_untranslated': False,


Test patch: