From e6bcad803430cc45b8074e723cf6f1f0a5306ca1 Mon Sep 17 00:00:00 2001 From: febrezo Date: Wed, 14 Feb 2024 23:12:06 +0100 Subject: [PATCH] Change url_for static URLs to relative ones Considering the way in which LibreTranslate uses the Base Path, specifically, with the `--url-prefix` option, we have observed that deployments under https://example.com/libretranslate are not redirected correctly in Flask. In our deployments: - Only paths specified locally were reachable as `http://example.com/libretranslate/js/app.js?v=1.3.10` - Paths containing the `url_for` clause were being constructed as `http://example.com/favicon.ico` when it SHOULD be sth like `http://example.com/libretranslate/favicon.ico`. Probably, this can be addressed also in a better way using in a different way the `static` path from Flask. --- libretranslate/templates/index.html | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/libretranslate/templates/index.html b/libretranslate/templates/index.html index f53f14b..7213a04 100644 --- a/libretranslate/templates/index.html +++ b/libretranslate/templates/index.html @@ -11,18 +11,18 @@ {% endif %} - + - - - - + + + + - - - - + + + + @@ -30,7 +30,7 @@ - + {% if gaId %} @@ -45,10 +45,10 @@ {% endif %} - - - - + + + + @@ -57,7 +57,7 @@ - + - +