Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: filters/localise_path.py

Issue 4661048523096064: Issue 2120 - Add support for animations. (Closed)
Patch Set: Created April 9, 2015, 8:38 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: filters/localise_path.py
diff --git a/filters/localise_path.py b/filters/localise_path.py
new file mode 100644
index 0000000000000000000000000000000000000000..eb4be8ed1bd547c92922563eb76a887cd19a263d
--- /dev/null
+++ b/filters/localise_path.py
@@ -0,0 +1,22 @@
+# This file is part of the Adblock Plus website,
+# Copyright (C) 2006-2015 Eyeo GmbH
+#
+# Adblock Plus is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 3 as
+# published by the Free Software Foundation.
+#
+# Adblock Plus is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+
+import os
+
+def localise_path(path, locale):
+ for prefix in (("locales", locale), ("locales", "en"), ("static",)):
+ full_path = os.path.join(*prefix + (path,))
+ if os.path.isfile(full_path):
+ return full_path
« no previous file with comments | « filters/inline_image.py ('k') | static/js/animation.js » ('j') | static/js/animation.js » ('J')

Powered by Google App Engine
This is Rietveld