mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-07 14:06:40 +00:00
i18n(oci): refine Slovak manager wording
This commit is contained in:
@@ -8,7 +8,7 @@ import sys
|
||||
import textwrap
|
||||
import threading
|
||||
|
||||
from .i18n import BASE_DIR
|
||||
from .i18n import BASE_DIR, translate
|
||||
|
||||
MG = "\033[1;35m"
|
||||
GN = "\033[1;92m"
|
||||
@@ -101,6 +101,7 @@ def ask_yes_no(text: str, default_yes: bool = True) -> bool:
|
||||
width = 74
|
||||
lines = sum(max(1, len(textwrap.wrap(line, width - 6) or [''])) for line in text.splitlines() or [''])
|
||||
widget = ['whiptail', '--backtitle', 'ProxMenux', '--title', 'ProxMenux',
|
||||
'--yes-button', translate('Yes'), '--no-button', translate('No'),
|
||||
'--yesno', text, str(min(lines + 8, 20)), str(width)]
|
||||
if not default_yes:
|
||||
widget.insert(1, '--defaultno')
|
||||
|
||||
@@ -192,9 +192,10 @@ class DialogUI:
|
||||
# dialog draws on the terminal and writes the selection to stderr.
|
||||
back_widget = ['--extra-button', '--extra-label', translate('Back')] if self.back_enabled and any(
|
||||
flag in widget for flag in ('--inputbox', '--passwordbox', '--yesno', '--menu', '--checklist')) else []
|
||||
confirmation_labels = ['--yes-label', translate('Yes'), '--no-label', translate('No')] if '--yesno' in widget else []
|
||||
result = subprocess.run(
|
||||
["dialog", "--no-collapse", "--cancel-label", translate('Cancel'), "--backtitle", self.backtitle, "--title", title or self.title,
|
||||
*back_widget, *widget],
|
||||
*confirmation_labels, *back_widget, *widget],
|
||||
stdout=None, stderr=subprocess.PIPE, text=True, check=False, env=environment,
|
||||
)
|
||||
if result.returncode == 3 and back_widget:
|
||||
|
||||
Reference in New Issue
Block a user