mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-07-09 03:04:26 -04:00
Show custom frontend title also above textareas when defined and != LibreTranslate (the default value)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
769a447f8f
commit
44326591df
@ -33,6 +33,7 @@ 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
|
||||
@ -448,6 +449,7 @@ 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:
|
||||
|
@ -2,6 +2,7 @@ import os
|
||||
|
||||
_prefix = 'LT_'
|
||||
|
||||
DEFAULT_FRONTEND_TITLE = 'LibreTranslate'
|
||||
|
||||
def _get_value_str(name, default_value):
|
||||
env_value = os.environ.get(name)
|
||||
@ -128,7 +129,7 @@ _default_options_objects = [
|
||||
},
|
||||
{
|
||||
'name': 'FRONTEND_TITLE',
|
||||
'default_value': 'LibreTranslate',
|
||||
'default_value': DEFAULT_FRONTEND_TITLE,
|
||||
'value_type': 'str'
|
||||
},
|
||||
{
|
||||
|
@ -181,7 +181,13 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<h3 class="header center">{{ _h("Translation API") }}</h3>
|
||||
<h3 class="header center">
|
||||
{% if use_custom_title %}
|
||||
{{ frontend_title }}
|
||||
{% else %}
|
||||
{{ _h("Translation API") }}
|
||||
{% endif %}
|
||||
</h3>
|
||||
<div id="translation-type-btns" class="s12 center" v-if="filesTranslation === true">
|
||||
<button type="button" class="btn btn-switch-type" @click="switchType('text')" :class="{'active': translationType === 'text'}" :disabled="disableInput">
|
||||
<i aria-hidden="true" class="material-icons">title</i>
|
||||
|
Loading…
x
Reference in New Issue
Block a user