mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-07-09 03:04:26 -04:00
Add user-customizable <title> if not web_version
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
2b3f51a28b
commit
769a447f8f
@ -221,6 +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-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 |
|
||||||
|
@ -447,6 +447,7 @@ def create_app(args):
|
|||||||
alternate_locales=get_alternate_locale_links(),
|
alternate_locales=get_alternate_locale_links(),
|
||||||
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,
|
||||||
))
|
))
|
||||||
|
|
||||||
if args.require_api_key_secret:
|
if args.require_api_key_secret:
|
||||||
|
@ -126,6 +126,11 @@ _default_options_objects = [
|
|||||||
'default_value': 500,
|
'default_value': 500,
|
||||||
'value_type': 'int'
|
'value_type': 'int'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'FRONTEND_TITLE',
|
||||||
|
'default_value': 'LibreTranslate',
|
||||||
|
'value_type': 'str'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': 'API_KEYS',
|
'name': 'API_KEYS',
|
||||||
'default_value': False,
|
'default_value': False,
|
||||||
|
@ -111,6 +111,13 @@ def get_args():
|
|||||||
metavar="<language code>",
|
metavar="<language code>",
|
||||||
help="Set frontend interface language (%(default)s)",
|
help="Set frontend interface language (%(default)s)",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--frontend-title",
|
||||||
|
type=str,
|
||||||
|
default=DEFARGS['FRONTEND_TITLE'],
|
||||||
|
metavar="<title>",
|
||||||
|
help="Set frontend title (%(default)s)",
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--frontend-timeout",
|
"--frontend-timeout",
|
||||||
type=int,
|
type=int,
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
<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 %}
|
||||||
|
<title>{{ frontend_title }}</title>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user