build / build (push) Successful in 38m26s
- das-shell 0.1.0: the Das two-line bash prompt by default (replaces the PS1 of Void's skel .bashrc once), dprompt (Textual prompt builder with presets and live preview) and dbanner (SSH login banner editor: canvas tools, fields with values, widgets, das-banner service for cached ones, Das OS logo and tryzub pictures). Python tests in make test. - das-server 0.3.0 depends on das-shell; the server installer mentions dprompt and dbanner; the desktop image includes it. - run-qemu.sh forwards the guest's SSH to localhost:2222. - Hardware fixes: Ventoy menu icon, boot menu titles "Das OS <version>". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
648 B
Python
27 lines
648 B
Python
"""Ukrainian or English messages, chosen like the shell helpers do (LC_ALL, LC_MESSAGES, LANG)."""
|
|
|
|
import os
|
|
|
|
|
|
def _ukrainian():
|
|
for var in ("LC_ALL", "LC_MESSAGES", "LANG"):
|
|
value = os.environ.get(var)
|
|
if value:
|
|
return value.startswith("uk")
|
|
return False
|
|
|
|
|
|
UK = _ukrainian()
|
|
|
|
|
|
def t(uk, en):
|
|
"""The message in the user's language."""
|
|
return uk if UK else en
|
|
|
|
|
|
def title(obj, default=""):
|
|
"""A {"uk": ..., "en": ...} title (or a plain string) in the user's language."""
|
|
if isinstance(obj, dict):
|
|
return obj.get("uk" if UK else "en") or obj.get("en") or default
|
|
return obj or default
|