Simplify frontend title

This commit is contained in:
Piero Toffanin 2025-06-15 12:29:39 +02:00
parent a63984bc9f
commit c963594971
4 changed files with 4 additions and 7 deletions

View file

@ -221,7 +221,7 @@ Arguments passed to the process or set via environment variables are split into
| --frontend-language-source | Set frontend default language - source | `auto` | LT_FRONTEND_LANGUAGE_SOURCE |
| --frontend-language-target | Set frontend default language - target | `locale` (match site's locale) | LT_FRONTEND_LANGUAGE_TARGET |
| --frontend-language | Set frontend web interface language | `(empty)` (auto-detect) | LT_FRONTEND_LANGUAGE |
| --frontend-title | Set frontend web interface title | `LibreTranslate` | LT_FRONTEND_TITLE |
| --frontend-title | Set frontend web interface title | `(empty)` | LT_FRONTEND_TITLE |
| --frontend-timeout | Set frontend translation timeout | `500` | LT_FRONTEND_TIMEOUT |
| --api-keys-db-path | Use a specific path inside the container for the local database. Can be absolute or relative | `db/api_keys.db` | LT_API_KEYS_DB_PATH |
| --api-keys-remote | Use this remote endpoint to query for valid API keys instead of using the local database | `Empty (use local db instead)` | LT_API_KEYS_REMOTE |

View file

@ -33,7 +33,6 @@ from libretranslate.locales import (
gettext_html,
lazy_swag,
)
from libretranslate.default_values import DEFAULT_FRONTEND_TITLE
from .api_keys import Database, RemoteDatabase
from .suggestions import Database as SuggestionsDatabase
@ -449,7 +448,6 @@ def create_app(args):
under_attack=args.under_attack,
hide_api=args.hide_api,
frontend_title=args.frontend_title,
use_custom_title=args.frontend_title != DEFAULT_FRONTEND_TITLE,
))
if args.require_api_key_secret:

View file

@ -2,7 +2,6 @@ import os
_prefix = 'LT_'
DEFAULT_FRONTEND_TITLE = 'LibreTranslate'
def _get_value_str(name, default_value):
env_value = os.environ.get(name)
@ -129,7 +128,7 @@ _default_options_objects = [
},
{
'name': 'FRONTEND_TITLE',
'default_value': DEFAULT_FRONTEND_TITLE,
'default_value': '',
'value_type': 'str'
},
{

View file

@ -9,7 +9,7 @@
<title>LibreTranslate - {{ _h("Free and Open Source Machine Translation API") }} 🌐</title>
<meta name="description" content="{{ _h('Free and Open Source Machine Translation API. Free to download, offline capable and easy to setup. Run your own API server in just a few minutes.') }}">
<meta name="keywords" content="{{ _h('translation') }},{{ _h('api') }}">
{% else %}
{% elif frontend_title %}
<title>{{ frontend_title }}</title>
{% endif %}
@ -182,7 +182,7 @@
</div>
{% endif %}
<h3 class="header center">
{% if use_custom_title %}
{% if frontend_title %}
{{ frontend_title }}
{% else %}
{{ _h("Translation API") }}