Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization 1006 #490

Merged
merged 5 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions pootle/apps/pootle_translationproject/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,46 @@
urlpatterns = [
# Admin views
url(
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/]*)" r"/admin/permissions/",
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/><]*)" r"/admin/permissions/",
admin_permissions,
name="pootle-tp-admin-permissions",
),
# Translation
url(
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/]*)/"
r"translate/(?P<dir_path>(.*/)*)?$",
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/><]*)/"
r"translate/(?P<dir_path>([^<>]*/)*)?$",
TPTranslateView.as_view(),
name="pootle-tp-translate",
),
url(
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/]*)/"
r"translate/(?P<dir_path>(.*/)*)(?P<filename>.*\.*)$",
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/><]*)/"
r"translate/(?P<dir_path>([^<>]*/)*)(?P<filename>.*\.*)$",
TPTranslateStoreView.as_view(),
name="pootle-tp-store-translate",
),
# Export view
url(
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/]*)/"
r"export-view/(?P<dir_path>(.*/)*)?$",
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/><]*)/"
r"export-view/(?P<dir_path>([^<>]*/)*)?$",
TPExportView.as_view(),
name="pootle-tp-export",
),
url(
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/]*)/"
r"export-view/(?P<dir_path>(.*/)*)(?P<filename>.*\.*)$",
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/><]*)/"
r"export-view/(?P<dir_path>([^<>]*/)*)(?P<filename>.*\.*)$",
TPExportStoreView.as_view(),
name="pootle-tp-store-export",
),
# Browser
url(
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/]*)/" r"(?P<dir_path>(.*/)*)?$",
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/><]*)/"
r"(?P<dir_path>([^<>]*/)*)?$",
TPBrowseView.as_view(),
name="pootle-tp-browse",
),
url(
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/]*)/"
r"(?P<dir_path>(.*/)*)(?P<filename>.*\.*)?$",
r"^(?P<language_code>[^/]*)/(?P<project_code>[^/><]*)/"
r"(?P<dir_path>([^<>]*/)*)(?P<filename>.*\.*)?$",
TPBrowseStoreView.as_view(),
name="pootle-tp-store-browse",
),
Expand Down
4 changes: 2 additions & 2 deletions pootle/middleware/errorpages.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def log_exception(request, exception, tb):

try:
request_repr = repr(request)
except:
except Exception:
request_repr = "Request repr() unavailable"

msg_args = (str(exception.args[0]), tb, request_repr)
Expand Down Expand Up @@ -93,7 +93,7 @@ def handle_exception(request, exception, template_name):
return HttpResponseServerError(
render_to_string(template_name, context=ctx, request=request)
)
except:
except Exception:
# Let's not confuse things by throwing an exception here
pass

Expand Down
2 changes: 1 addition & 1 deletion requirements/_lint.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Linting tools

black==19.10b0
flake8==3.4.1
flake8==4.0.1
isort==4.3.21
pylint==2.4.4
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def build_mo(self):
command = ["msgfmt", "--strict", "-o", mo_filename, po_filename]
try:
subprocess.check_call(command, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
except subprocess.CalledProcessError:
error_occured = True
except Exception as e:
log.warn("%s: skipping, running msgfmt failed: %s", lang, e)
Expand Down