mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-07-09 03:04:26 -04:00
Simplify frontend title
This commit is contained in:
parent
a63984bc9f
commit
c963594971
@ -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-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-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-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 |
|
| --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-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 |
|
| --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 |
|
||||||
|
@ -33,7 +33,6 @@ from libretranslate.locales import (
|
|||||||
gettext_html,
|
gettext_html,
|
||||||
lazy_swag,
|
lazy_swag,
|
||||||
)
|
)
|
||||||
from libretranslate.default_values import DEFAULT_FRONTEND_TITLE
|
|
||||||
|
|
||||||
from .api_keys import Database, RemoteDatabase
|
from .api_keys import Database, RemoteDatabase
|
||||||
from .suggestions import Database as SuggestionsDatabase
|
from .suggestions import Database as SuggestionsDatabase
|
||||||
@ -449,7 +448,6 @@ def create_app(args):
|
|||||||
under_attack=args.under_attack,
|
under_attack=args.under_attack,
|
||||||
hide_api=args.hide_api,
|
hide_api=args.hide_api,
|
||||||
frontend_title=args.frontend_title,
|
frontend_title=args.frontend_title,
|
||||||
use_custom_title=args.frontend_title != DEFAULT_FRONTEND_TITLE,
|
|
||||||
))
|
))
|
||||||
|
|
||||||
if args.require_api_key_secret:
|
if args.require_api_key_secret:
|
||||||
|
@ -2,7 +2,6 @@ import os
|
|||||||
|
|
||||||
_prefix = 'LT_'
|
_prefix = 'LT_'
|
||||||
|
|
||||||
DEFAULT_FRONTEND_TITLE = 'LibreTranslate'
|
|
||||||
|
|
||||||
def _get_value_str(name, default_value):
|
def _get_value_str(name, default_value):
|
||||||
env_value = os.environ.get(name)
|
env_value = os.environ.get(name)
|
||||||
@ -129,7 +128,7 @@ _default_options_objects = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'FRONTEND_TITLE',
|
'name': 'FRONTEND_TITLE',
|
||||||
'default_value': DEFAULT_FRONTEND_TITLE,
|
'default_value': '',
|
||||||
'value_type': 'str'
|
'value_type': 'str'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<title>LibreTranslate - {{ _h("Free and Open Source Machine Translation API") }} 🌐</title>
|
<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="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') }}">
|
<meta name="keywords" content="{{ _h('translation') }},{{ _h('api') }}">
|
||||||
{% else %}
|
{% elif frontend_title %}
|
||||||
<title>{{ frontend_title }}</title>
|
<title>{{ frontend_title }}</title>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@ -182,7 +182,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h3 class="header center">
|
<h3 class="header center">
|
||||||
{% if use_custom_title %}
|
{% if frontend_title %}
|
||||||
{{ frontend_title }}
|
{{ frontend_title }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ _h("Translation API") }}
|
{{ _h("Translation API") }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user