Mark most of the translatable content in python code for i18n.

This commit is contained in:
SwimmingTiger 2020-06-17 02:02:30 +08:00 committed by Mathieu Comandon
parent 5d0b77cbcd
commit e25d9f0005
78 changed files with 1229 additions and 1099 deletions

View file

@ -1,6 +1,7 @@
"""Exception handling module"""
# Standard Library
from functools import wraps
from gettext import gettext as _
class LutrisError(Exception):
@ -22,7 +23,7 @@ class GameConfigError(LutrisError):
class UnavailableLibraries(RuntimeError):
def __init__(self, libraries):
message = (
message = _(
"Some required libraries are not installed on your system, install them "
"with your package manager and restart Lutris. Libraries: %s"
) % ", ".join(libraries)

View file

@ -7,6 +7,7 @@ import os
import shlex
import subprocess
import time
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GLib, GObject, Gtk
@ -132,19 +133,19 @@ class Game(GObject.Object):
message_text = message["text"].replace("&", "&")
dialogs.ErrorDialog(message_text)
elif message["error"] == "RUNNER_NOT_INSTALLED":
dialogs.ErrorDialog("Error the runner is not installed")
dialogs.ErrorDialog(_("Error the runner is not installed"))
elif message["error"] == "NO_BIOS":
dialogs.ErrorDialog("A bios file is required to run this game")
dialogs.ErrorDialog(_("A bios file is required to run this game"))
elif message["error"] == "FILE_NOT_FOUND":
filename = message["file"]
if filename:
message_text = "The file {} could not be found".format(filename.replace("&", "&"))
message_text = _("The file {} could not be found").format(filename.replace("&", "&"))
else:
message_text = "No file provided"
message_text = _("No file provided")
dialogs.ErrorDialog(message_text)
elif message["error"] == "NOT_EXECUTABLE":
message_text = message["file"].replace("&", "&")
dialogs.ErrorDialog("The file %s is not executable" % message_text)
dialogs.ErrorDialog(_("The file %s is not executable") % message_text)
def get_browse_dir(self):
"""Return the path to open with the Browse Files action."""
@ -264,7 +265,7 @@ class Game(GObject.Object):
runtime_updater = runtime.RuntimeUpdater()
if runtime_updater.is_updating():
logger.warning("Runtime updates: %s", runtime_updater.current_updates)
dialogs.ErrorDialog("Runtime currently updating", "Game might not work as expected")
dialogs.ErrorDialog(_("Runtime currently updating"), _("Game might not work as expected"))
if ("wine" in self.runner_name and not wine.get_system_wine_version() and not LINUX_SYSTEM.is_flatpak):
# TODO find a reference to the root window or better yet a way not
# to have Gtk dependent code in this class.
@ -275,7 +276,7 @@ class Game(GObject.Object):
def play(self):
"""Launch the game."""
if not self.runner:
dialogs.ErrorDialog("Invalid game configuration: Missing runner")
dialogs.ErrorDialog(_("Invalid game configuration: Missing runner"))
self.state = self.STATE_STOPPED
self.emit("game-stop")
return
@ -300,7 +301,7 @@ class Game(GObject.Object):
dialogs.ErrorDialog(str(error))
if not prelaunched:
logger.error("Game prelaunch unsuccessful")
dialogs.ErrorDialog("An error prevented the game from running")
dialogs.ErrorDialog(_("An error prevented the game from running"))
self.state = self.STATE_STOPPED
self.emit("game-stop")
return
@ -445,7 +446,7 @@ class Game(GObject.Object):
if terminal:
terminal = system_config.get("terminal_app", system.get_default_terminal())
if terminal and not system.find_executable(terminal):
dialogs.ErrorDialog("The selected terminal application " "could not be launched:\n" "%s" % terminal)
dialogs.ErrorDialog(_("The selected terminal application could not be launched:\n%s") % terminal)
self.state = self.STATE_STOPPED
self.emit("game-stop")
return
@ -553,7 +554,7 @@ class Game(GObject.Object):
def beat(self):
"""Watch the game's process(es)."""
if self.game_thread.error:
dialogs.ErrorDialog("<b>Error lauching the game:</b>\n" + self.game_thread.error)
dialogs.ErrorDialog(_("<b>Error lauching the game:</b>\n") + self.game_thread.error)
self.on_game_quit()
return False
@ -637,13 +638,13 @@ class Game(GObject.Object):
error = "error while loading shared lib"
error_line = strings.lookup_string_in_text(error, self.game_thread.stdout)
if error_line:
dialogs.ErrorDialog("<b>Error: Missing shared library.</b>" "\n\n%s" % error_line)
dialogs.ErrorDialog(_("<b>Error: Missing shared library.</b>\n\n%s") % error_line)
if self.game_thread.return_code == 1:
# Error Wine version conflict
error = "maybe the wrong wineserver"
if strings.lookup_string_in_text(error, self.game_thread.stdout):
dialogs.ErrorDialog("<b>Error: A different Wine version is " "already using the same Wine prefix.</b>")
dialogs.ErrorDialog(_("<b>Error: A different Wine version is already using the same Wine prefix.</b>"))
def notify_steam_game_changed(self, appmanifest):
"""Receive updates from Steam games and set the thread's ready state accordingly"""

View file

@ -4,6 +4,7 @@
# pylint: disable=too-many-public-methods
import os
import signal
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gio
@ -58,39 +59,39 @@ class GameActions:
def get_game_actions(self):
"""Return a list of game actions and their callbacks"""
return [
("play", "Play", self.on_game_run),
("stop", "Stop", self.on_stop),
("show_logs", "Show logs", self.on_show_logs),
("install", "Install", self.on_install_clicked),
("add", "Add installed game", self.on_add_manually),
("configure", "Configure", self.on_edit_game_configuration),
("execute-script", "Execute script", self.on_execute_script_clicked),
("browse", "Browse files", self.on_browse_files),
("play", _("Play"), self.on_game_run),
("stop", _("Stop"), self.on_stop),
("show_logs", _("Show logs"), self.on_show_logs),
("install", _("Install"), self.on_install_clicked),
("add", _("Add installed game"), self.on_add_manually),
("configure", _("Configure"), self.on_edit_game_configuration),
("execute-script", _("Execute script"), self.on_execute_script_clicked),
("browse", _("Browse files"), self.on_browse_files),
(
"desktop-shortcut",
"Create desktop shortcut",
_("Create desktop shortcut"),
self.on_create_desktop_shortcut,
),
(
"rm-desktop-shortcut",
"Delete desktop shortcut",
_("Delete desktop shortcut"),
self.on_remove_desktop_shortcut,
),
(
"menu-shortcut",
"Create application menu shortcut",
_("Create application menu shortcut"),
self.on_create_menu_shortcut,
),
(
"rm-menu-shortcut",
"Delete application menu shortcut",
_("Delete application menu shortcut"),
self.on_remove_menu_shortcut,
),
("install_more", "Install another version", self.on_install_clicked),
("remove", "Remove", self.on_remove_game),
("view", "View on Lutris.net", self.on_view_game),
("hide", "Hide game from library", self.on_hide_game),
("unhide", "Unhide game from library", self.on_unhide_game),
("install_more", _("Install another version"), self.on_install_clicked),
("remove", _("Remove"), self.on_remove_game),
("view", _("View on Lutris.net"), self.on_view_game),
("hide", _("Hide game from library"), self.on_hide_game),
("unhide", _("Unhide game from library"), self.on_unhide_game),
]
def on_hide_game(self, _widget):
@ -190,7 +191,7 @@ class GameActions:
def on_show_logs(self, _widget):
"""Display game log"""
return LogWindow(
title="Log for {}".format(self.game), buffer=self.game.log_buffer, application=self.application
title=_("Log for {}").format(self.game), buffer=self.game.log_buffer, application=self.application
)
def on_install_clicked(self, *_args):
@ -221,11 +222,11 @@ class GameActions:
"""Callback to open a game folder in the file browser"""
path = self.game.get_browse_dir()
if not path:
dialogs.NoticeDialog("This game has no installation directory")
dialogs.NoticeDialog(_("This game has no installation directory"))
elif path_exists(path):
open_uri("file://%s" % path)
else:
dialogs.NoticeDialog("Can't open %s \nThe folder doesn't exist." % path)
dialogs.NoticeDialog(_("Can't open %s \nThe folder doesn't exist.") % path)
def on_create_menu_shortcut(self, *_args):
"""Add the selected game to the system's Games menu."""

View file

@ -78,7 +78,7 @@ class Application(Gtk.Application):
self.run_in_background = False
if os.geteuid() == 0:
ErrorDialog("Running Lutris as root is not recommended and may cause unexpected issues")
ErrorDialog(_("Running Lutris as root is not recommended and may cause unexpected issues"))
try:
self.css_provider.load_from_path(os.path.join(datapath.get(), "ui", "lutris.css"))
@ -88,17 +88,17 @@ class Application(Gtk.Application):
if hasattr(self, "add_main_option"):
self.add_arguments()
else:
ErrorDialog("Your Linux distribution is too old. Lutris won't function properly.")
ErrorDialog(_("Your Linux distribution is too old. Lutris won't function properly."))
def add_arguments(self):
if hasattr(self, "set_option_context_summary"):
self.set_option_context_summary(
self.set_option_context_summary(_(
"Run a game directly by adding the parameter lutris:rungame/game-identifier.\n"
"If several games share the same identifier you can use the numerical ID "
"(displayed when running lutris --list-games) and add "
"lutris:rungameid/numerical-id.\n"
"To install a game, add lutris:install/game-identifier."
)
))
else:
logger.warning("GLib.set_option_context_summary missing, " "was added in GLib 2.56 (Released 2018-03-12)")
self.add_main_option(
@ -318,7 +318,7 @@ class Application(Gtk.Application):
url = options.lookup_value(GLib.OPTION_REMAINING)
installer_info = self.get_lutris_action(url)
except ValueError:
self._print(command_line, "%s is not a valid URI" % url.get_strv())
self._print(command_line, _("%s is not a valid URI") % url.get_strv())
return 1
game_slug = installer_info["game_slug"]
action = installer_info["action"]
@ -331,7 +331,7 @@ class Application(Gtk.Application):
try:
request = Request(installer_file).get()
except HTTPError:
self._print(command_line, "Failed to download %s" % installer_file)
self._print(command_line, _("Failed to download %s") % installer_file)
return 1
try:
headers = dict(request.response_headers)
@ -339,7 +339,8 @@ class Application(Gtk.Application):
except (KeyError, IndexError):
file_name = os.path.basename(installer_file)
file_path = os.path.join(tempfile.gettempdir(), file_name)
self._print(command_line, "download %s to %s started" % (installer_file, file_path))
self._print(command_line, _("download {url} to {file} started").format(
url=installer_file, file=file_path))
with open(file_path, 'wb') as dest_file:
dest_file.write(request.content)
installer_file = file_path
@ -349,7 +350,7 @@ class Application(Gtk.Application):
action = "install"
if not os.path.isfile(installer_file):
self._print(command_line, "No such file: %s" % installer_file)
self._print(command_line, _("No such file: %s") % installer_file)
return 1
db_game = None

View file

@ -1,4 +1,6 @@
# Lutris Modules
from gettext import gettext as _
from lutris.config import LutrisConfig
from lutris.gui.config import DIALOG_HEIGHT, DIALOG_WIDTH
from lutris.gui.config.common import GameDialogCommon
@ -10,7 +12,7 @@ class AddGameDialog(Dialog, GameDialogCommon):
"""Add game dialog class."""
def __init__(self, parent, game=None, runner=None):
super().__init__("Add a new game", parent=parent)
super().__init__(_("Add a new game"), parent=parent)
self.game = game
self.saved = False

View file

@ -2,6 +2,7 @@
# Standard Library
# pylint: disable=no-member,too-many-public-methods
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gdk, Gtk
@ -55,7 +56,7 @@ class ConfigBox(VBox):
def generate_widgets(self, config_section): # noqa: C901 # pylint: disable=too-many-branches,too-many-statements
"""Parse the config dict and generates widget accordingly."""
if not self.options:
no_options_label = Label("No options available")
no_options_label = Label(_("No options available"))
no_options_label.set_halign(Gtk.Align.CENTER)
no_options_label.set_valign(Gtk.Align.CENTER)
self.pack_start(no_options_label, True, True, 0)
@ -101,7 +102,7 @@ class ConfigBox(VBox):
# Reset button
reset_btn = Gtk.Button.new_from_icon_name("edit-clear", Gtk.IconSize.MENU)
reset_btn.set_relief(Gtk.ReliefStyle.NONE)
reset_btn.set_tooltip_text("Reset option to global or " "default config")
reset_btn.set_tooltip_text(_("Reset option to global or default config"))
reset_btn.connect(
"clicked",
self.on_reset_button_clicked,
@ -122,10 +123,10 @@ class ConfigBox(VBox):
helptext = option.get("help")
if isinstance(self.tooltip_default, str):
helptext = helptext + "\n\n" if helptext else ""
helptext += "<b>Default</b>: " + self.tooltip_default
helptext += _("<b>Default</b>: ") + self.tooltip_default
if value != default and option_key not in self.raw_config:
helptext = helptext + "\n\n" if helptext else ""
helptext += (
helptext += _(
"<i>(Italic indicates that this option is "
"modified in a lower configuration level.)</i>"
)
@ -303,7 +304,7 @@ class ConfigBox(VBox):
if isinstance(choice, str):
choice = (choice, choice)
if choice[1] == default:
liststore.append((choice[0] + " (default)", choice[1]))
liststore.append((_("%s (default)") % choice[0], choice[1]))
self.tooltip_default = choice[0]
else:
liststore.append(choice)
@ -387,7 +388,10 @@ class ConfigBox(VBox):
option_name = option["option"]
label = Label(option["label"])
file_chooser = FileChooserEntry(
title="Select file", action=Gtk.FileChooserAction.OPEN, path=path, default_path=option.get("default_path")
title=_("Select file"),
action=Gtk.FileChooserAction.OPEN,
path=path,
default_path=option.get("default_path")
)
file_chooser.set_size_request(200, 30)
@ -428,7 +432,7 @@ class ConfigBox(VBox):
if not path and self.game and self.game.runner:
default_path = self.game.runner.working_dir
directory_chooser = FileChooserEntry(
title="Select folder", action=Gtk.FileChooserAction.SELECT_FOLDER, path=path, default_path=default_path
title=_("Select folder"), action=Gtk.FileChooserAction.SELECT_FOLDER, path=path, default_path=default_path
)
directory_chooser.entry.connect("changed", self._on_chooser_dir_set, option_name)
directory_chooser.set_valign(Gtk.Align.CENTER)
@ -468,7 +472,7 @@ class ConfigBox(VBox):
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
label = Label(label + ":")
label.set_halign(Gtk.Align.START)
button = Gtk.Button("Add files")
button = Gtk.Button(_("Add files"))
button.connect("clicked", self.on_add_files_clicked, option_name, value)
button.set_margin_left(10)
vbox.pack_start(label, False, False, 5)
@ -486,7 +490,7 @@ class ConfigBox(VBox):
self.files_list_store.append([filename])
cell_renderer = Gtk.CellRendererText()
files_treeview = Gtk.TreeView(self.files_list_store)
files_column = Gtk.TreeViewColumn("Files", cell_renderer, text=0)
files_column = Gtk.TreeViewColumn(_("Files"), cell_renderer, text=0)
files_treeview.append_column(files_column)
files_treeview.connect("key-press-event", self.on_files_treeview_keypress, option_name)
treeview_scroll = Gtk.ScrolledWindow()
@ -503,13 +507,13 @@ class ConfigBox(VBox):
def on_add_files_clicked(self, _widget, option_name, value):
"""Create and run multi-file chooser dialog."""
dialog = Gtk.FileChooserDialog(
title="Select files",
title=_("Select files"),
parent=None,
action=Gtk.FileChooserAction.OPEN,
buttons=(
"_Cancel",
_("_Cancel"),
Gtk.ResponseType.CANCEL,
"_Add",
_("_Add"),
Gtk.ResponseType.ACCEPT,
),
)
@ -638,10 +642,10 @@ class RunnerBox(ConfigBox):
self.options = runner.get_runner_options()
if lutris_config.level == "game":
self.generate_top_info_box(
self.generate_top_info_box(_(
"If modified, these options supersede the same options from "
"the base runner configuration."
)
))
self.generate_widgets("runner")
@ -658,15 +662,15 @@ class SystemBox(ConfigBox):
self.options = sysoptions.system_options
if lutris_config.game_config_id and runner_slug:
self.generate_top_info_box(
self.generate_top_info_box(_(
"If modified, these options supersede the same options from "
"the base runner configuration, which themselves supersede "
"the global preferences."
)
))
elif runner_slug:
self.generate_top_info_box(
self.generate_top_info_box(_(
"If modified, these options supersede the same options from "
"the global preferences."
)
))
self.generate_widgets("system")

View file

@ -3,6 +3,7 @@
# pylint: disable=no-member,not-an-iterable
import importlib
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gdk, GLib, Gtk, Pango
@ -27,7 +28,7 @@ from lutris.util.strings import slugify
class GameDialogCommon:
"""Mixin for config dialogs"""
no_runner_label = "Select a runner in the Game Info tab"
no_runner_label = _("Select a runner in the Game Info tab")
def __init__(self):
self.notebook = None
@ -95,7 +96,7 @@ class GameDialogCommon:
info_box.pack_start(self._get_year_box(), False, False, 6) # Year
info_sw = self.build_scrolled_window(info_box)
self._add_notebook_tab(info_sw, "Game info")
self._add_notebook_tab(info_sw, _("Game info"))
def _build_prefs_tab(self):
prefs_box = VBox()
@ -103,17 +104,17 @@ class GameDialogCommon:
cache_help_label = Gtk.Label(visible=True)
cache_help_label.set_size_request(400, -1)
cache_help_label.set_markup(
cache_help_label.set_markup(_(
"If provided, this location will be used by installers to cache "
"downloaded files locally for future re-use. \nIf left empty, the "
"installer files are discarded after the install completion."
)
))
prefs_box.pack_start(cache_help_label, False, False, 6)
prefs_box.pack_start(self._get_hide_on_game_launch_box(), False, False, 6)
info_sw = self.build_scrolled_window(prefs_box)
self._add_notebook_tab(info_sw, "Lutris preferences")
self._add_notebook_tab(info_sw, _("Lutris preferences"))
def _build_sysinfo_tab(self):
sysinfo_box = Gtk.VBox()
@ -126,24 +127,24 @@ class GameDialogCommon:
self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
self._clipboard_buffer = sysinfo_str
button_copy = Gtk.Button("Copy System Info")
button_copy = Gtk.Button(_("Copy System Info"))
button_copy.connect("clicked", self._copy_text)
sysinfo_box.add(sysinfo_view)
sysinfo_box.add(button_copy)
info_sw = self.build_scrolled_window(sysinfo_box)
self._add_notebook_tab(info_sw, "System Information")
self._add_notebook_tab(info_sw, _("System Information"))
def _copy_text(self, widget): # pylint: disable=unused-argument
self.clipboard.set_text(self._clipboard_buffer, -1)
def _get_game_cache_box(self):
box = Gtk.Box(spacing=12, margin_right=12, margin_left=12)
label = Label("Cache path")
label = Label(_("Cache path"))
box.pack_start(label, False, False, 0)
cache_path = get_cache_path()
path_chooser = FileChooserEntry(
title="Set the folder for the cache path", action=Gtk.FileChooserAction.SELECT_FOLDER, path=cache_path
title=_("Set the folder for the cache path"), action=Gtk.FileChooserAction.SELECT_FOLDER, path=cache_path
)
path_chooser.entry.connect("changed", self._on_cache_path_set)
box.pack_start(path_chooser, True, True, 0)
@ -151,7 +152,7 @@ class GameDialogCommon:
def _get_hide_on_game_launch_box(self):
box = Gtk.Box(spacing=12, margin_right=12, margin_left=12)
checkbox = Gtk.CheckButton(label="Minimize client when a game is launched")
checkbox = Gtk.CheckButton(label=_("Minimize client when a game is launched"))
if settings.read_setting("hide_client_on_game_start") == "True":
checkbox.set_active(True)
checkbox.connect("toggled", self._on_hide_client_change)
@ -175,7 +176,7 @@ class GameDialogCommon:
def _get_name_box(self):
box = Gtk.Box(spacing=12, margin_right=12, margin_left=12)
label = Label("Name")
label = Label(_("Name"))
box.pack_start(label, False, False, 0)
self.name_entry = Gtk.Entry()
if self.game:
@ -186,7 +187,7 @@ class GameDialogCommon:
def _get_slug_box(self):
slug_box = Gtk.Box(spacing=12, margin_right=12, margin_left=12)
label = Label("Identifier")
label = Label(_("Identifier"))
slug_box.pack_start(label, False, False, 0)
self.slug_entry = SlugEntry()
@ -195,7 +196,7 @@ class GameDialogCommon:
self.slug_entry.connect("activate", self.on_slug_entry_activate)
slug_box.pack_start(self.slug_entry, True, True, 0)
self.slug_change_button = Gtk.Button("Change")
self.slug_change_button = Gtk.Button(_("Change"))
self.slug_change_button.connect("clicked", self.on_slug_change_clicked)
slug_box.pack_start(self.slug_change_button, False, False, 0)
@ -204,13 +205,13 @@ class GameDialogCommon:
def _get_runner_box(self):
runner_box = Gtk.Box(spacing=12, margin_right=12, margin_left=12)
runner_label = Label("Runner")
runner_label = Label(_("Runner"))
runner_box.pack_start(runner_label, False, False, 0)
self.runner_dropdown = self._get_runner_dropdown()
runner_box.pack_start(self.runner_dropdown, True, True, 0)
install_runners_btn = Gtk.Button("Install runners")
install_runners_btn = Gtk.Button(_("Install runners"))
install_runners_btn.connect("clicked", self.on_install_runners_clicked)
runner_box.pack_start(install_runners_btn, True, True, 0)
@ -229,7 +230,7 @@ class GameDialogCommon:
reset_banner_button = Gtk.Button.new_from_icon_name("edit-clear", Gtk.IconSize.MENU)
reset_banner_button.set_relief(Gtk.ReliefStyle.NONE)
reset_banner_button.set_tooltip_text("Remove custom banner")
reset_banner_button.set_tooltip_text(_("Remove custom banner"))
reset_banner_button.connect("clicked", self.on_custom_image_reset_clicked, "banner")
banner_box.pack_start(reset_banner_button, False, False, 0)
@ -240,7 +241,7 @@ class GameDialogCommon:
reset_icon_button = Gtk.Button.new_from_icon_name("edit-clear", Gtk.IconSize.MENU)
reset_icon_button.set_relief(Gtk.ReliefStyle.NONE)
reset_icon_button.set_tooltip_text("Remove custom icon")
reset_icon_button.set_tooltip_text(_("Remove custom icon"))
reset_icon_button.connect("clicked", self.on_custom_image_reset_clicked, "icon")
banner_box.pack_start(reset_icon_button, False, False, 0)
@ -249,7 +250,7 @@ class GameDialogCommon:
def _get_year_box(self):
box = Gtk.Box(spacing=12, margin_right=12, margin_left=12)
label = Label("Release year")
label = Label(_("Release year"))
box.pack_start(label, False, False, 0)
self.year_entry = NumberEntry()
@ -297,7 +298,7 @@ class GameDialogCommon:
def _get_runner_liststore():
"""Build a ListStore with available runners."""
runner_liststore = Gtk.ListStore(str, str)
runner_liststore.append(("Select a runner from the list", ""))
runner_liststore.append((_("Select a runner from the list"), ""))
for runner in runners.get_installed():
description = runner.description
runner_liststore.append(("%s (%s)" % (runner.human_name, description), runner.name))
@ -305,7 +306,7 @@ class GameDialogCommon:
def on_slug_change_clicked(self, widget):
if self.slug_entry.get_sensitive() is False:
widget.set_label("Apply")
widget.set_label(_("Apply"))
self.slug_entry.set_sensitive(True)
else:
self.change_game_slug()
@ -316,7 +317,7 @@ class GameDialogCommon:
def change_game_slug(self):
self.slug = self.slug_entry.get_text()
self.slug_entry.set_sensitive(False)
self.slug_change_button.set_label("Change")
self.slug_change_button.set_label(_("Change"))
def on_install_runners_clicked(self, _button):
"""Messed up callback requiring an import in the method to avoid a circular dependency"""
@ -347,7 +348,7 @@ class GameDialogCommon:
game_sw = self.build_scrolled_window(self.game_box)
else:
game_sw = Gtk.Label(label=self.no_runner_label)
self._add_notebook_tab(game_sw, "Game options")
self._add_notebook_tab(game_sw, _("Game options"))
def _build_runner_tab(self, _config_level):
if self.runner_name:
@ -355,14 +356,14 @@ class GameDialogCommon:
runner_sw = self.build_scrolled_window(self.runner_box)
else:
runner_sw = Gtk.Label(label=self.no_runner_label)
self._add_notebook_tab(runner_sw, "Runner options")
self._add_notebook_tab(runner_sw, _("Runner options"))
def _build_system_tab(self, _config_level):
if not self.lutris_config:
raise RuntimeError("Lutris config not loaded yet")
self.system_box = SystemBox(self.lutris_config)
self.system_sw = self.build_scrolled_window(self.system_box)
self._add_notebook_tab(self.system_sw, "System options")
self._add_notebook_tab(self.system_sw, _("System options"))
def _add_notebook_tab(self, widget, label):
self.notebook.append_page(widget, Gtk.Label(label=label))
@ -371,7 +372,7 @@ class GameDialogCommon:
self.action_area.set_layout(Gtk.ButtonBoxStyle.EDGE)
# Advanced settings checkbox
checkbox = Gtk.CheckButton(label="Show advanced options")
checkbox = Gtk.CheckButton(label=_("Show advanced options"))
if settings.read_setting("show_advanced_options") == "True":
checkbox.set_active(True)
checkbox.connect("toggled", self.on_show_advanced_options_toggled)
@ -379,11 +380,11 @@ class GameDialogCommon:
# Buttons
hbox = Gtk.Box()
cancel_button = Gtk.Button(label="Cancel")
cancel_button = Gtk.Button(label=_("Cancel"))
cancel_button.connect("clicked", self.on_cancel_clicked)
hbox.pack_start(cancel_button, True, True, 10)
save_button = Gtk.Button(label="Save")
save_button = Gtk.Button(label=_("Save"))
save_button.connect("clicked", button_callback)
hbox.pack_start(save_button, True, True, 0)
self.action_area.pack_start(hbox, True, True, 0)
@ -416,11 +417,11 @@ class GameDialogCommon:
dlg = QuestionDialog(
{
"question":
"Are you sure you want to change the runner for this game ? "
"This will reset the full configuration for this game and "
"is not reversible.",
_("Are you sure you want to change the runner for this game ? "
"This will reset the full configuration for this game and "
"is not reversible."),
"title":
"Confirm runner change",
_("Confirm runner change"),
}
)
@ -468,13 +469,13 @@ class GameDialogCommon:
def is_valid(self):
if not self.runner_name:
ErrorDialog("Runner not provided")
ErrorDialog(_("Runner not provided"))
return False
if not self.name_entry.get_text():
ErrorDialog("Please fill in the name")
ErrorDialog(_("Please fill in the name"))
return False
if (self.runner_name in ("steam", "winesteam") and self.lutris_config.game_config.get("appid") is None):
ErrorDialog("Steam AppId not provided")
ErrorDialog(_("Steam AppId not provided"))
return False
invalid_fields = []
runner_module = importlib.import_module("lutris.runners." + self.runner_name)
@ -493,14 +494,14 @@ class GameDialogCommon:
except Exception:
invalid_fields.append(option.get("label"))
if invalid_fields:
ErrorDialog("The following fields have invalid values: " + ", ".join(invalid_fields))
ErrorDialog(_("The following fields have invalid values: ") + ", ".join(invalid_fields))
return False
return True
def on_save(self, _button):
"""Save game info and destroy widget. Return True if success."""
if not self.is_valid():
logger.warning("Current configuration is not valid, ignoring save request")
logger.warning(_("Current configuration is not valid, ignoring save request"))
return False
name = self.name_entry.get_text()
@ -539,7 +540,7 @@ class GameDialogCommon:
def on_custom_image_select(self, _widget, image_type):
dialog = Gtk.FileChooserDialog(
"Please choose a custom image",
_("Please choose a custom image"),
self,
Gtk.FileChooserAction.OPEN,
(
@ -551,7 +552,7 @@ class GameDialogCommon:
)
image_filter = Gtk.FileFilter()
image_filter.set_name("Images")
image_filter.set_name(_("Images"))
image_filter.add_pixbuf_formats()
dialog.add_filter(image_filter)

View file

@ -1,3 +1,6 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.gui.config import DIALOG_HEIGHT, DIALOG_WIDTH
from lutris.gui.config.common import GameDialogCommon
@ -9,7 +12,7 @@ class EditGameConfigDialog(Dialog, GameDialogCommon):
"""Game config edit dialog."""
def __init__(self, parent, game):
super().__init__("Configure %s" % game.name, parent=parent)
super().__init__(_("Configure %s") % game.name, parent=parent)
self.game = game
self.lutris_config = game.config
self.slug = game.slug

View file

@ -1,3 +1,6 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.config import LutrisConfig
from lutris.gui.config import DIALOG_HEIGHT, DIALOG_WIDTH
@ -11,7 +14,7 @@ class RunnerConfigDialog(Dialog, GameDialogCommon):
def __init__(self, runner, parent=None):
self.runner_name = runner.__class__.__name__
super().__init__("Configure %s" % runner.human_name, parent=parent)
super().__init__(_("Configure %s") % runner.human_name, parent=parent)
self.game = None
self.saved = False

View file

@ -1,3 +1,6 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.config import LutrisConfig
from lutris.gui.config import DIALOG_HEIGHT, DIALOG_WIDTH
@ -8,7 +11,7 @@ from lutris.gui.dialogs import Dialog
class SystemConfigDialog(Dialog, GameDialogCommon):
def __init__(self, parent=None):
super().__init__("System preferences", parent=parent)
super().__init__(_("System preferences"), parent=parent)
self.game = None
self.runner_name = None

View file

@ -1,3 +1,6 @@
# Standard Library
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gtk
@ -10,10 +13,10 @@ class DownloadDialog(Gtk.Dialog):
"""Dialog showing a download in progress."""
def __init__(self, url=None, dest=None, title=None, label=None, downloader=None):
Gtk.Dialog.__init__(self, title or "Downloading file")
Gtk.Dialog.__init__(self, title or _("Downloading file"))
self.set_size_request(485, 104)
self.set_border_width(12)
params = {"url": url, "dest": dest, "title": label or "Downloading %s" % url}
params = {"url": url, "dest": dest, "title": label or _("Downloading %s") % url}
self.download_box = DownloadProgressBox(params, downloader=downloader)
self.download_box.connect("complete", self.download_complete)

View file

@ -2,6 +2,7 @@
# Standard Library
import json
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gtk
@ -23,15 +24,15 @@ class IssueReportWindow(BaseApplicationWindow):
self.vbox.add(self.title_label)
title_label = Gtk.Label()
title_label.set_markup("<b>Submit an issue</b>")
title_label.set_markup(_("<b>Submit an issue</b>"))
self.vbox.add(title_label)
self.vbox.add(Gtk.HSeparator())
issue_entry_label = Gtk.Label(
issue_entry_label = Gtk.Label(_(
"Describe the problem you're having in the text box below. "
"This information will be sent the Lutris team along with your system information."
"You can also save this information locally if you are offline."
)
))
issue_entry_label.set_max_width_chars(80)
issue_entry_label.set_property("wrap", True)
self.vbox.add(issue_entry_label)
@ -48,10 +49,10 @@ class IssueReportWindow(BaseApplicationWindow):
action_buttons_alignment.add(self.action_buttons)
self.vbox.pack_start(action_buttons_alignment, False, True, 0)
cancel_button = self.get_action_button("C_ancel", handler=self.on_destroy)
cancel_button = self.get_action_button(_("C_ancel"), handler=self.on_destroy)
self.action_buttons.add(cancel_button)
save_button = self.get_action_button("_Save", handler=self.on_save)
save_button = self.get_action_button(_("_Save"), handler=self.on_save)
self.action_buttons.add(save_button)
self.show_all()
@ -67,10 +68,10 @@ class IssueReportWindow(BaseApplicationWindow):
"""Signal handler for the save button"""
save_dialog = Gtk.FileChooserDialog(
title="Select a location to save the issue",
title=_("Select a location to save the issue"),
transient_for=self,
action=Gtk.FileChooserAction.SELECT_FOLDER,
buttons=("_Cancel", Gtk.ResponseType.CLOSE, "_OK", Gtk.ResponseType.OK),
buttons=(_("_Cancel"), Gtk.ResponseType.CLOSE, _("_OK"), Gtk.ResponseType.OK),
)
save_dialog.connect("response", self.on_folder_selected)
save_dialog.run()
@ -86,5 +87,5 @@ class IssueReportWindow(BaseApplicationWindow):
with open(issue_path, "w") as issue_file:
json.dump(issue_info, issue_file, indent=2)
dialog.destroy()
NoticeDialog("Issue saved in %s" % issue_path)
NoticeDialog(_("Issue saved in %s") % issue_path)
self.destroy()

View file

@ -1,4 +1,6 @@
"""Window to show game logs"""
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gdk, Gtk
@ -24,7 +26,7 @@ class LogWindow(Gtk.ApplicationWindow):
self.vbox.pack_start(scrolledwindow, True, True, 0)
self.search_entry = Gtk.SearchEntry()
self.search_entry.props.placeholder_text = "Search..."
self.search_entry.props.placeholder_text = _("Search...")
self.search_entry.connect("stop-search", self.dettach_search_entry)
self.search_entry.connect("search-changed", self.logtextview.find_first)
self.search_entry.connect("next-match", self.logtextview.find_next)

View file

@ -1,9 +1,11 @@
"""Dialog used to install versions of a runner"""
import gettext
# Standard Library
# pylint: disable=no-member
import os
import random
from collections import defaultdict
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GLib, Gtk
@ -31,7 +33,7 @@ class RunnerInstallDialog(Dialog):
def __init__(self, title, parent, runner):
super().__init__(title, parent, 0)
self.add_buttons("_OK", Gtk.ButtonsType.OK)
self.add_buttons(_("_OK"), Gtk.ButtonsType.OK)
self.runner = runner
self.runner_info = {}
self.installing = {}
@ -39,7 +41,7 @@ class RunnerInstallDialog(Dialog):
self.renderer_progress = Gtk.CellRendererProgress()
label = Gtk.Label.new("Waiting for response from %s" % (settings.SITE_URL))
label = Gtk.Label.new(_("Waiting for response from %s") % (settings.SITE_URL))
self.vbox.pack_start(label, False, False, 18)
spinner = Gtk.Spinner(visible=True)
@ -58,7 +60,7 @@ class RunnerInstallDialog(Dialog):
self.runner_info = runner_info
if not self.runner_info:
ErrorDialog("Unable to get runner versions. Check your internet connection.")
ErrorDialog(_("Unable to get runner versions. Check your internet connection."))
return
for child_widget in self.vbox.get_children():
@ -67,7 +69,7 @@ class RunnerInstallDialog(Dialog):
self.populate_store()
label = Gtk.Label.new("%s version management" % self.runner_info["name"])
label = Gtk.Label.new(_("%s version management") % self.runner_info["name"])
self.vbox.add(label)
scrolled_window = Gtk.ScrolledWindow()
treeview = self.get_treeview(self.runner_store)
@ -139,9 +141,8 @@ class RunnerInstallDialog(Dialog):
for version_info in reversed(self.runner_info["versions"]):
is_installed = os.path.exists(self.get_runner_path(version_info["version"], version_info["architecture"]))
games_using = version_usage.get("%(version)s-%(architecture)s" % version_info)
usage_summary = "In use by %d game%s" % (
len(games_using), "s" if len(games_using) > 1 else ""
) if games_using else "Not in use"
usage_summary = gettext.ngettext("In use by %d game", "In use by %d games",
len(games_using)) if games_using else _("Not in use")
self.runner_store.append(
[
version_info["version"], version_info["architecture"], version_info["url"], is_installed, 0,
@ -162,8 +163,8 @@ class RunnerInstallDialog(Dialog):
if row[self.COL_VER] in self.installing:
confirm_dlg = QuestionDialog(
{
"question": "Do you want to cancel the download?",
"title": "Download starting",
"question": _("Do you want to cancel the download?"),
"title": _("Download starting"),
}
)
if confirm_dlg.result == confirm_dlg.YES:
@ -216,10 +217,10 @@ class RunnerInstallDialog(Dialog):
else:
row[self.COL_PROGRESS] = 1
self.renderer_progress.props.pulse = random.randint(1, 100)
self.renderer_progress.props.text = "Downloading…"
self.renderer_progress.props.text = _("Downloading…")
if downloader.state == downloader.COMPLETED:
row[self.COL_PROGRESS] = 99
self.renderer_progress.props.text = "Extracting…"
self.renderer_progress.props.text = _("Extracting…")
self.on_runner_downloaded(row)
return False
return True
@ -242,7 +243,7 @@ class RunnerInstallDialog(Dialog):
def on_extracted(self, row_info, error):
"""Called when a runner archive is extracted"""
if error or not row_info:
ErrorDialog("Failed to retrieve the runner archive", parent=self)
ErrorDialog(_("Failed to retrieve the runner archive"), parent=self)
return
src, row = row_info
os.remove(src)

View file

@ -2,6 +2,7 @@
# Standard Library
# pylint: disable=too-many-instance-attributes,attribute-defined-outside-init
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GObject, Gtk
@ -124,7 +125,7 @@ class RunnersDialog(GtkBuilderDialog):
self.configure_button.show()
def on_versions_clicked(self, widget, runner, runner_label):
dlg_title = "Manage %s versions" % runner.name
dlg_title = _("Manage %s versions") % runner.name
versions_dialog = RunnerInstallDialog(dlg_title, self.dialog, runner.name)
versions_dialog.connect("destroy", self.set_install_state, runner, runner_label)

View file

@ -1,3 +1,6 @@
# Standard Library
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gtk, Pango
@ -51,7 +54,7 @@ class UninstallGameDialog(GtkBuilderDialog):
remove_contents_button.set_active(True)
else:
remove_contents_button.set_sensitive(False)
path = "No game folder"
path = _("No game folder")
path = reverse_expanduser(path)
self.substitute_label(remove_contents_button, "path", path)
@ -80,10 +83,10 @@ class UninstallGameDialog(GtkBuilderDialog):
dlg = QuestionDialog(
{
"question":
"Are you sure you want to delete EVERYTHING under "
"\n<b>%s</b>?\n (This can't be undone)" % game_dir,
_("Are you sure you want to delete EVERYTHING under "
"\n<b>%s</b>?\n (This can't be undone)") % game_dir,
"title":
"CONFIRM DANGEROUS OPERATION",
_("CONFIRM DANGEROUS OPERATION"),
}
)
if dlg.result != Gtk.ResponseType.YES:

View file

@ -3,6 +3,7 @@
import os
import time
import webbrowser
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gtk
@ -73,16 +74,16 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
action_buttons_alignment.add(self.action_buttons)
self.vbox.pack_start(action_buttons_alignment, False, True, 0)
self.manual_button = self.add_button("Configure m_anually", self.on_manual_clicked)
self.manual_button = self.add_button(_("Configure m_anually"), self.on_manual_clicked)
self.cancel_button = self.add_button(
"C_ancel", self.cancel_installation, tooltip="Abort and revert the installation"
_("C_ancel"), self.cancel_installation, tooltip=_("Abort and revert the installation")
)
self.eject_button = self.add_button("_Eject", self.on_eject_clicked)
self.source_button = self.add_button("_View source", self.on_source_clicked)
self.install_button = self.add_button("_Install", self.on_install_clicked)
self.continue_button = self.add_button("_Continue")
self.play_button = self.add_button("_Launch", self.launch_game)
self.close_button = self.add_button("_Close", self.on_destroy)
self.eject_button = self.add_button(_("_Eject"), self.on_eject_clicked)
self.source_button = self.add_button(_("_View source"), self.on_source_clicked)
self.install_button = self.add_button(_("_Install"), self.on_install_clicked)
self.continue_button = self.add_button(_("_Continue"))
self.play_button = self.add_button(_("_Launch"), self.launch_game)
self.close_button = self.add_button(_("_Close"), self.on_destroy)
self.continue_handler = None
@ -90,7 +91,7 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
if system.path_exists(self.installer_file):
self.on_scripts_obtained(interpreter.read_script(self.installer_file))
else:
self.title_label.set_markup("Waiting for response from %s" % (settings.SITE_URL))
self.title_label.set_markup(_("Waiting for response from %s") % (settings.SITE_URL))
self.add_spinner()
self.widget_box.show()
self.title_label.show()
@ -184,7 +185,7 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
"""Stage where we choose an install script."""
self.validate_scripts()
base_script = self.scripts[0]
self.title_label.set_markup("<b>Install %s</b>" % escape_gtk_label(base_script["name"]))
self.title_label.set_markup(_("<b>Install %s</b>") % escape_gtk_label(base_script["name"]))
installer_picker = InstallerPicker(self.scripts)
installer_picker.connect("installer-selected", self.on_installer_selected)
scrolledwindow = Gtk.ScrolledWindow(hexpand=True, vexpand=True, child=installer_picker)
@ -204,8 +205,8 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
except MissingGameDependency as ex:
dlg = QuestionDialog(
{
"question": "This game requires %s. Do you want to install it?" % ex.slug,
"title": "Missing dependency",
"question": _("This game requires %s. Do you want to install it?") % ex.slug,
"title": _("Missing dependency"),
}
)
if dlg.result == Gtk.ResponseType.YES:
@ -217,18 +218,18 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
self.destroy()
return
self.title_label.set_markup(u"<b>Installing {}</b>".format(escape_gtk_label(self.interpreter.game_name)))
self.title_label.set_markup(_(u"<b>Installing {}</b>").format(escape_gtk_label(self.interpreter.game_name)))
self.select_install_folder()
def select_install_folder(self):
"""Stage where we select the install directory."""
if self.interpreter.creates_game_folder:
self.set_message("Select installation directory")
self.set_message(_("Select installation directory"))
default_path = self.interpreter.get_default_target()
self.set_path_chooser(self.on_target_changed, "folder", default_path)
else:
self.set_message("Click install to continue")
self.set_message(_("Click install to continue"))
if self.continue_handler:
self.continue_button.disconnect(self.continue_handler)
self.continue_button.hide()
@ -277,11 +278,11 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
self.continue_button.set_sensitive(False)
if action == "file":
title = "Select file"
title = _("Select file")
action = Gtk.FileChooserAction.OPEN
enable_warnings = False
elif action == "folder":
title = "Select folder"
title = _("Select folder")
action = Gtk.FileChooserAction.SELECT_FOLDER
enable_warnings = True
else:
@ -347,20 +348,20 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
buttons_box.set_margin_bottom(40)
self.widget_box.add(buttons_box)
autodetect_button = Gtk.Button(label="Autodetect")
autodetect_button = Gtk.Button(label=_("Autodetect"))
autodetect_button.connect("clicked", callback, requires)
autodetect_button.grab_focus()
autodetect_button.show()
buttons_box.pack_start(autodetect_button, True, True, 40)
browse_button = Gtk.Button(label="Browse…")
browse_button = Gtk.Button(label=_("Browse…"))
callback_data = {"callback": callback, "requires": requires}
browse_button.connect("clicked", self.on_browse_clicked, callback_data)
browse_button.show()
buttons_box.pack_start(browse_button, True, True, 40)
def on_browse_clicked(self, widget, callback_data):
dialog = DirectoryDialog("Select the folder where the disc is mounted", parent=self)
dialog = DirectoryDialog(_("Select the folder where the disc is mounted"), parent=self)
folder = dialog.folder
callback = callback_data["callback"]
requires = callback_data["requires"]
@ -403,8 +404,8 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
self.clean_widgets()
self.install_in_progress = False
self.desktop_shortcut_box = Gtk.CheckButton("Create desktop shortcut")
self.menu_shortcut_box = Gtk.CheckButton("Create application menu " "shortcut")
self.desktop_shortcut_box = Gtk.CheckButton(_("Create desktop shortcut"))
self.menu_shortcut_box = Gtk.CheckButton(_("Create application menu shortcut"))
self.widget_box.pack_start(self.desktop_shortcut_box, False, False, 5)
self.widget_box.pack_start(self.menu_shortcut_box, False, False, 5)
self.widget_box.show_all()
@ -470,14 +471,14 @@ class InstallerWindow(BaseApplicationWindow): # pylint: disable=too-many-public
def cancel_installation(self, widget=None):
"""Ask a confirmation before cancelling the install"""
remove_checkbox = Gtk.CheckButton.new_with_label("Remove game files")
remove_checkbox = Gtk.CheckButton.new_with_label(_("Remove game files"))
if self.interpreter:
remove_checkbox.set_active(self.interpreter.game_dir_created)
remove_checkbox.show()
confirm_cancel_dialog = QuestionDialog(
{
"question": "Are you sure you want to cancel the installation?",
"title": "Cancel installation?",
"question": _("Are you sure you want to cancel the installation?"),
"title": _("Cancel installation?"),
"widgets": [remove_checkbox]
}
)

View file

@ -3,6 +3,7 @@
# pylint: disable=no-member
import os
from collections import namedtuple
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gdk, Gio, GLib, GObject, Gtk
@ -125,8 +126,8 @@ class LutrisWindow(Gtk.ApplicationWindow): # pylint: disable=too-many-public-me
lutris_icon = Gtk.Image.new_from_icon_name("lutris", Gtk.IconSize.MENU)
lutris_icon.set_margin_right(3)
self.website_search_toggle.set_image(lutris_icon)
self.website_search_toggle.set_label("Search Lutris.net")
self.website_search_toggle.set_tooltip_text("Search Lutris.net")
self.website_search_toggle.set_label(_("Search Lutris.net"))
self.website_search_toggle.set_tooltip_text(_("Search Lutris.net"))
self.sidebar_listbox = SidebarListBox()
self.sidebar_listbox.set_size_request(250, -1)
self.sidebar_listbox.connect("selected-rows-changed", self.on_sidebar_changed)
@ -548,7 +549,7 @@ class LutrisWindow(Gtk.ApplicationWindow): # pylint: disable=too-many-public-me
"""Synchronize games with local stuff and server."""
def update_gui(result, error):
self.sync_label.set_label("Synchronize library")
self.sync_label.set_label(_("Synchronize library"))
self.sync_spinner.props.active = False
self.sync_button.set_sensitive(True)
if error:
@ -565,7 +566,7 @@ class LutrisWindow(Gtk.ApplicationWindow): # pylint: disable=too-many-public-me
else:
logger.error("No results returned when syncing the library")
self.sync_label.set_label("Synchronizing…")
self.sync_label.set_label(_("Synchronizing…"))
self.sync_spinner.props.active = True
self.sync_button.set_sensitive(False)
AsyncCall(sync_from_remote, update_gui)
@ -611,8 +612,8 @@ class LutrisWindow(Gtk.ApplicationWindow): # pylint: disable=too-many-public-me
def on_disconnect(self, *_args):
"""Callback from user disconnect"""
dlg = dialogs.QuestionDialog({
"question": "Do you want to log out from Lutris?",
"title": "Log out?",
"question": _("Do you want to log out from Lutris?"),
"title": _("Log out?"),
})
if dlg.result != Gtk.ResponseType.YES:
return
@ -729,13 +730,13 @@ class LutrisWindow(Gtk.ApplicationWindow): # pylint: disable=too-many-public-me
self.search_terms = self.search_entry.props.text
if toggle_button.props.active:
self.search_mode = "website"
self.search_entry.set_placeholder_text("Search Lutris.net")
self.search_entry.set_placeholder_text(_("Search Lutris.net"))
self.search_entry.set_icon_from_icon_name(Gtk.EntryIconPosition.PRIMARY, "folder-download-symbolic")
self.game_store.search_mode = True
self.search_games(self.search_terms)
else:
self.search_mode = "local"
self.search_entry.set_placeholder_text("Filter the list of games")
self.search_entry.set_placeholder_text(_("Filter the list of games"))
self.search_entry.set_icon_from_icon_name(Gtk.EntryIconPosition.PRIMARY, "system-search-symbolic")
self.search_games("")
self.search_spinner.props.active = False
@ -906,7 +907,7 @@ class LutrisWindow(Gtk.ApplicationWindow): # pylint: disable=too-many-public-me
self.invalidate_game_filter()
def show_invalid_credential_warning(self):
dialogs.ErrorDialog("Could not connect to your Lutris account. Please sign in again.")
dialogs.ErrorDialog(_("Could not connect to your Lutris account. Please sign in again."))
def show_library_sync_error(self):
dialogs.ErrorDialog("Failed to retrieve game library. " "There might be some problems contacting lutris.net")
dialogs.ErrorDialog(_("Failed to retrieve game library. There might be some problems contacting lutris.net"))

View file

@ -1,6 +1,7 @@
"""Game panel"""
# Standard Library
from datetime import datetime
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GObject, Gtk, Pango
@ -55,7 +56,7 @@ class GamePanel(GenericPanel):
def get_close_button(self):
"""Return the close button"""
button = Gtk.Button.new_from_icon_name("window-close-symbolic", Gtk.IconSize.MENU)
button.set_tooltip_text("Close")
button.set_tooltip_text(_("Close"))
button.set_size_request(32, 32)
button.connect("clicked", self.on_close)
button.show()
@ -98,7 +99,7 @@ class GamePanel(GenericPanel):
"""Return the label containing the playtime info"""
playtime_label = Gtk.Label()
playtime_label.show()
playtime_label.set_markup("Time played: <b>%s</b>" % self.game.formatted_playtime)
playtime_label.set_markup(_("Time played: <b>%s</b>") % self.game.formatted_playtime)
return playtime_label
def get_last_played_label(self):
@ -106,7 +107,7 @@ class GamePanel(GenericPanel):
last_played_label = Gtk.Label()
last_played_label.show()
lastplayed = datetime.fromtimestamp(self.game.lastplayed)
last_played_label.set_markup("Last played: <b>%s</b>" % lastplayed.strftime("%x"))
last_played_label.set_markup(_("Last played: <b>%s</b>") % lastplayed.strftime("%x"))
return last_played_label
@staticmethod
@ -231,14 +232,14 @@ class GamePanel(GenericPanel):
def on_game_start(self, _widget):
"""Callback for the `game-start` signal"""
self.buttons["play"].set_label("Launching...")
self.buttons["play"].set_label(_("Launching..."))
self.buttons["play"].set_sensitive(False)
def on_game_started(self, _widget):
"""Callback for the `game-started` signal"""
self.buttons["stop"].show()
self.buttons["play"].hide()
self.buttons["play"].set_label("Play")
self.buttons["play"].set_label(_("Play"))
self.buttons["play"].set_sensitive(True)
def on_game_state_changed(self, _widget, _game_id=None):

View file

@ -1,6 +1,7 @@
"""Side panel when no game is selected"""
# Standard Library
import json
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gdk, Gio, GObject, Gtk, Pango
@ -81,7 +82,7 @@ class GenericPanel(Gtk.Fixed):
application = Gio.Application.get_default()
if application.running_games.get_n_items():
running_label = Gtk.Label(visible=True)
running_label.set_markup("<b>Playing:</b>")
running_label.set_markup(_("<b>Playing:</b>"))
self.put(running_label, 12, 355)
self.put(self.get_running_games(), 12, 377)
@ -90,7 +91,7 @@ class GenericPanel(Gtk.Fixed):
def get_preferences_button(self):
preferences_button = Gtk.Button.new_from_icon_name("preferences-system-symbolic", Gtk.IconSize.MENU)
preferences_button.set_tooltip_text("Preferences")
preferences_button.set_tooltip_text(_("Preferences"))
preferences_button.set_size_request(32, 32)
preferences_button.props.relief = Gtk.ReliefStyle.NONE
preferences_button.connect("clicked", self.on_preferences_clicked)
@ -154,26 +155,26 @@ class GenericPanel(Gtk.Fixed):
def get_lutris_links(self):
box = Gtk.VBox(spacing=6, visible=True)
donate_button = get_link_button("Support Lutris!")
donate_button = get_link_button(_("Support Lutris!"))
donate_button.connect("clicked", lambda *x: open_uri(LINKS["donate"]))
box.add(donate_button)
help_label = Gtk.Label(visible=True)
help_label.set_markup("<b>Help:</b>")
help_label.set_markup(_("<b>Help:</b>"))
help_label.set_alignment(0, 0.5)
help_label.set_margin_top(136)
box.add(help_label)
help_box = Gtk.Box(spacing=6, visible=True)
forums_button = get_link_button("Forums")
forums_button = get_link_button(_("Forums"))
forums_button.set_size_request(-1, -1)
forums_button.connect("clicked", lambda *x: open_uri(LINKS["forums"]))
help_box.add(forums_button)
irc_button = get_link_button("IRC")
irc_button = get_link_button(_("IRC"))
irc_button.set_size_request(-1, -1)
irc_button.connect("clicked", lambda *x: open_uri(LINKS["irc"]))
help_box.add(irc_button)
discord_button = get_link_button("Discord")
discord_button = get_link_button(_("Discord"))
discord_button.set_size_request(-1, -1)
discord_button.connect("clicked", lambda *x: open_uri(LINKS["discord"]))
help_box.add(discord_button)

View file

@ -1,4 +1,6 @@
"""TreeView based game list"""
from gettext import gettext as _
# Third Party Libraries
# pylint: disable=no-member
from gi.repository import Gtk, Pango
@ -37,15 +39,15 @@ class GameListView(Gtk.TreeView, GameView):
name_cell = self.set_text_cell()
name_cell.set_padding(5, 0)
self.set_column(name_cell, "Name", COL_NAME, 200)
self.set_column(default_text_cell, "Year", COL_YEAR, 60)
self.set_column(default_text_cell, "Runner", COL_RUNNER_HUMAN_NAME, 120)
self.set_column(default_text_cell, "Platform", COL_PLATFORM, 120)
self.set_column(default_text_cell, "Last Played", COL_LASTPLAYED_TEXT, 120)
self.set_column(name_cell, _("Name"), COL_NAME, 200)
self.set_column(default_text_cell, _("Year"), COL_YEAR, 60)
self.set_column(default_text_cell, _("Runner"), COL_RUNNER_HUMAN_NAME, 120)
self.set_column(default_text_cell, _("Platform"), COL_PLATFORM, 120)
self.set_column(default_text_cell, _("Last Played"), COL_LASTPLAYED_TEXT, 120)
self.set_sort_with_column(COL_LASTPLAYED_TEXT, COL_LASTPLAYED)
self.set_column(default_text_cell, "Installed At", COL_INSTALLED_AT_TEXT, 120)
self.set_column(default_text_cell, _("Installed At"), COL_INSTALLED_AT_TEXT, 120)
self.set_sort_with_column(COL_INSTALLED_AT_TEXT, COL_INSTALLED_AT)
self.set_column(default_text_cell, "Play Time", COL_PLAYTIME_TEXT, 100)
self.set_column(default_text_cell, _("Play Time"), COL_PLAYTIME_TEXT, 100)
self.set_sort_with_column(COL_PLAYTIME_TEXT, COL_PLAYTIME)
self.get_selection().set_mode(Gtk.SelectionMode.SINGLE)

View file

@ -1,3 +1,6 @@
# Standard Library
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GObject, Gtk, Pango
@ -45,7 +48,7 @@ class CellRendererButton(Gtk.CellRenderer):
context = widget.get_style_context()
context.save()
context.add_class(Gtk.STYLE_CLASS_BUTTON)
self.layout.set_markup("Install")
self.layout.set_markup(_("Install"))
(x, y, w, h) = self.do_get_size(widget, cell_area)
h -= 4
# Gtk.render_background(context, cr, x, y, w, h)

View file

@ -1,6 +1,7 @@
"""Misc widgets used in the GUI."""
# Standard Library
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GObject, Gtk, Pango
@ -41,7 +42,7 @@ class FileChooserEntry(Gtk.Box):
def __init__(
self,
title="Select file",
title=_("Select file"),
action=Gtk.FileChooserAction.OPEN,
path=None,
default_path=None,
@ -64,7 +65,7 @@ class FileChooserEntry(Gtk.Box):
if path:
self.entry.set_text(path)
browse_button = Gtk.Button("Browse...", visible=True)
browse_button = Gtk.Button(_("Browse..."), visible=True)
browse_button.connect("clicked", self.on_browse_clicked)
box = Gtk.Box(spacing=6, visible=True)
@ -91,7 +92,7 @@ class FileChooserEntry(Gtk.Box):
def get_filechooser_dialog(self):
"""Return an instance of a FileChooserDialog configured for this widget"""
dialog = Gtk.FileChooserDialog(title=self.title, transient_for=None, action=self.action)
dialog.add_buttons("_Cancel", Gtk.ResponseType.CLOSE, "_OK", Gtk.ResponseType.OK)
dialog.add_buttons(_("_Cancel"), Gtk.ResponseType.CLOSE, _("_OK"), Gtk.ResponseType.OK)
dialog.set_create_folders(True)
dialog.set_current_folder(self.get_default_folder())
dialog.connect("response", self.on_select_file)
@ -127,26 +128,26 @@ class FileChooserEntry(Gtk.Box):
warning_image.set_from_pixbuf(get_stock_icon("dialog-warning", 32))
ntfs_box.add(warning_image)
ntfs_label = Gtk.Label(visible=True)
ntfs_label.set_markup(
ntfs_label.set_markup(_(
"<b>Warning!</b> The selected path is located on a drive formatted by Windows.\n"
"Games and programs installed on Windows drives usually <b>don't work</b>."
)
))
ntfs_box.add(ntfs_label)
self.pack_end(ntfs_box, False, False, 10)
if self.warn_if_non_empty and os.path.exists(path) and os.listdir(path):
non_empty_label = Gtk.Label(visible=True)
non_empty_label.set_markup(
non_empty_label.set_markup(_(
"<b>Warning!</b> The selected path "
"contains files. Installation might not work properly."
)
))
self.pack_end(non_empty_label, False, False, 10)
parent = system.get_existing_parent(path)
if parent is not None and not os.access(parent, os.W_OK):
non_writable_destination_label = Gtk.Label(visible=True)
non_writable_destination_label.set_markup(
non_writable_destination_label.set_markup(_(
"<b>Warning</b> The destination folder "
"is not writable by the current user."
)
))
self.pack_end(non_writable_destination_label, False, False, 10)
def on_select_file(self, dialog, response):
@ -249,11 +250,11 @@ class EditableGrid(Gtk.Grid):
self.treeview.append_column(column)
self.buttons = []
self.add_button = Gtk.Button("Add")
self.add_button = Gtk.Button(_("Add"))
self.buttons.append(self.add_button)
self.add_button.connect("clicked", self.on_add)
self.delete_button = Gtk.Button("Delete")
self.delete_button = Gtk.Button(_("Delete"))
self.buttons.append(self.delete_button)
self.delete_button.connect("clicked", self.on_delete)

View file

@ -1,3 +1,6 @@
# Standard Library
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GLib, GObject, Gtk, Pango
@ -22,7 +25,7 @@ class DownloadProgressBox(Gtk.Box):
self.url = params.get("url")
self.dest = params.get("dest")
self.referer = params.get("referer")
title = params.get("title", "Downloading {}".format(self.url))
title = params.get("title", _("Downloading {}").format(self.url))
self.main_label = Gtk.Label(title)
self.main_label.set_alignment(0, 0)
@ -41,7 +44,7 @@ class DownloadProgressBox(Gtk.Box):
self.progressbar.set_margin_right(10)
progress_box.pack_start(self.progressbar, True, True, 0)
self.cancel_button = Gtk.Button.new_with_mnemonic("_Cancel")
self.cancel_button = Gtk.Button.new_with_mnemonic(_("_Cancel"))
self.cancel_button.connect("clicked", self.cancel)
if not cancelable:
self.cancel_button.set_sensitive(False)
@ -86,7 +89,7 @@ class DownloadProgressBox(Gtk.Box):
if self.downloader.state in [self.downloader.CANCELLED, self.downloader.ERROR]:
self.progressbar.set_fraction(0)
if self.downloader.state == self.downloader.CANCELLED:
self._set_text("Download interrupted")
self._set_text(_("Download interrupted"))
else:
self._set_text(self.downloader.error)
if self.downloader.state == self.downloader.CANCELLED:
@ -94,11 +97,13 @@ class DownloadProgressBox(Gtk.Box):
return False
self.progressbar.set_fraction(progress)
megabytes = 1024 * 1024
progress_text = "%0.2f / %0.2fMB (%0.2fMB/s), %s remaining" % (
float(self.downloader.downloaded_size) / megabytes,
float(self.downloader.full_size) / megabytes,
float(self.downloader.average_speed) / megabytes,
self.downloader.time_left,
progress_text = _(
"{downloaded:0.2f} / {size:0.2f}MB ({speed:0.2f}MB/s), {time} remaining"
).format(
downloaded=float(self.downloader.downloaded_size) / megabytes,
size=float(self.downloader.full_size) / megabytes,
speed=float(self.downloader.average_speed) / megabytes,
time=self.downloader.time_left,
)
self._set_text(progress_text)
if self.downloader.state == self.downloader.COMPLETED:

View file

@ -1,4 +1,6 @@
"""Widgets for the installer window"""
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GObject, Gtk, Pango
@ -75,7 +77,7 @@ class InstallerScriptBox(Gtk.VBox):
align = Gtk.Alignment()
align.set(0, 0, 0, 0)
install_button = Gtk.Button("Install")
install_button = Gtk.Button(_("Install"))
install_button.connect("clicked", self.on_install_clicked)
install_button.set_margin_right(6)
align.add(install_button)

View file

@ -1,4 +1,8 @@
"""Window for importing games from third party services"""
# Standard Library
import gettext
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gtk
from gi.repository.GdkPixbuf import Pixbuf
@ -51,7 +55,7 @@ class ServiceSyncBox(Gtk.Box):
if service.ONLINE:
self.refresh_button = Gtk.Button()
self.refresh_button.connect("clicked", self.on_refresh_clicked)
self.refresh_button.set_tooltip_text("Reload")
self.refresh_button.set_tooltip_text(_("Reload"))
self.refresh_button.set_image(Gtk.Image.new_from_icon_name("view-refresh-symbolic", Gtk.IconSize.MENU))
title_box.add(self.refresh_button)
title_box.add(self.connect_button)
@ -64,9 +68,9 @@ class ServiceSyncBox(Gtk.Box):
actions = Gtk.Box(spacing=6)
self.pack_start(actions, False, False, 0)
self.import_button = Gtk.Button("Import games")
self.import_button = Gtk.Button(_("Import games"))
self.import_button.set_sensitive(False)
self.import_button.set_tooltip_text("Sync now")
self.import_button.set_tooltip_text(_("Sync now"))
self.import_button.connect("clicked", self.on_sync_button_clicked, service.SYNCER.sync)
actions.pack_start(self.import_button, False, False, 0)
@ -78,7 +82,7 @@ class ServiceSyncBox(Gtk.Box):
self.sync_switch.set_state(True)
actions.pack_start(Gtk.Alignment(), True, True, 0)
actions.pack_start(self.sync_switch, False, False, 0)
actions.pack_start(Gtk.Label("Sync all games at startup"), False, False, 0)
actions.pack_start(Gtk.Label(_("Sync all games at startup")), False, False, 0)
if self.service.ONLINE:
AsyncCall(self._connect_button_toggle, None)
@ -89,10 +93,10 @@ class ServiceSyncBox(Gtk.Box):
if self.service.ONLINE and not self.is_connecting:
service_logo = self.get_icon(size=(64, 64))
service_label = Gtk.Label("Connect to %s to import your library." % self.name)
service_label = Gtk.Label(_("Connect to %s to import your library.") % self.name)
service_label.set_justify(Gtk.Justification.CENTER)
service_button = Gtk.Button("Connect your account")
service_button = Gtk.Button(_("Connect your account"))
service_button.connect("clicked", self.on_connect_clicked)
service_box = Gtk.VBox()
@ -140,13 +144,13 @@ class ServiceSyncBox(Gtk.Box):
self.is_connecting = False
if self.service.is_connected():
icon_name = "system-log-out-symbolic"
label = "Disconnect"
label = _("Disconnect")
self.refresh_button.show()
self.sync_switch.set_sensitive(True)
self.import_button.set_sensitive(True)
else:
icon_name = "avatar-default-symbolic"
label = "Connect"
label = _("Connect")
self.refresh_button.hide()
self.sync_switch.set_sensitive(False)
self.import_button.set_sensitive(False)
@ -171,18 +175,18 @@ class ServiceSyncBox(Gtk.Box):
skipped_import = len(original_games) - len(added_games)
if added_games:
added_message = "%s game%s imported. " % (len(added_games), "s were" if len(added_games) > 1 else " was")
added_message = gettext.ngettext("%s game was imported. ",
"%s games were imported. ", len(added_games))
else:
added_message = "No games were added. "
added_message = _("No games were added. ")
if skipped_import:
skipped_message = "%s game%s already in the library" % (
skipped_import, "s are" if skipped_import > 1 else " is"
)
skipped_message = gettext.ngettext("%s game is already in the library",
"%s games are already in the library", skipped_import)
else:
skipped_message = ""
send_notification("Games imported", added_message + skipped_message)
send_notification(_("Games imported"), added_message + skipped_message)
for game_id in added_games:
window.game_store.add_or_update(game_id)
@ -198,7 +202,7 @@ class ServiceSyncBox(Gtk.Box):
renderer_text = Gtk.CellRendererText()
import_column = Gtk.TreeViewColumn("Import", renderer_toggle, active=self.COL_SELECTED)
import_column = Gtk.TreeViewColumn(_("Import"), renderer_toggle, active=self.COL_SELECTED)
treeview.append_column(import_column)
image_cell = Gtk.CellRendererPixbuf()
@ -254,14 +258,14 @@ class ServiceSyncBox(Gtk.Box):
def get_game_list_widget(self):
content = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
filter_box = Gtk.Box(spacing=6)
select_all_button = Gtk.CheckButton.new_with_label("Select all")
select_all_button = Gtk.CheckButton.new_with_label(_("Select all"))
select_all_button.connect("toggled", self.on_select_all)
filter_box.add(select_all_button)
search_entry = Gtk.Entry()
search_entry.connect("changed", self.on_search_entry_changed)
filter_box.pack_start(Gtk.Alignment(), True, True, 0)
filter_box.add(Gtk.Label("Filter:"))
filter_box.add(Gtk.Label(_("Filter:")))
filter_box.add(search_entry)
content.pack_start(filter_box, False, False, 0)
@ -326,7 +330,7 @@ class ServiceSyncBox(Gtk.Box):
class SyncServiceWindow(Gtk.ApplicationWindow):
def __init__(self, application):
super().__init__(title="Import games", application=application)
super().__init__(title=_("Import games"), application=application)
self.set_default_icon_name("lutris")
self.application = application
self.set_show_menubar(False)

View file

@ -1,6 +1,7 @@
"""Sidebar for the main window"""
# Standard Library
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GObject, Gtk, Pango
@ -61,12 +62,12 @@ class SidebarRow(Gtk.ListBoxRow):
if self.runner.multiple_versions:
entries.append((
"system-software-install-symbolic",
"Manage Versions",
_("Manage Versions"),
self.on_manage_versions,
))
if self.runner.runnable_alone:
entries.append(("media-playback-start-symbolic", "Run", self.runner.run))
entries.append(("emblem-system-symbolic", "Configure", self.on_configure_runner))
entries.append(("media-playback-start-symbolic", _("Run"), self.runner.run))
entries.append(("emblem-system-symbolic", _("Configure"), self.on_configure_runner))
for entry in entries:
btn = Gtk.Button(tooltip_text=entry[1], relief=Gtk.ReliefStyle.NONE, visible=True)
image = Gtk.Image.new_from_icon_name(entry[0], Gtk.IconSize.MENU)
@ -81,7 +82,7 @@ class SidebarRow(Gtk.ListBoxRow):
RunnerConfigDialog(self.runner, parent=self.get_toplevel())
def on_manage_versions(self, *args): # pylint: disable=unused-argument
dlg_title = "Manage %s versions" % self.runner.name
dlg_title = _("Manage %s versions") % self.runner.name
RunnerInstallDialog(dlg_title, self.get_toplevel(), self.runner.name)
def do_state_flags_changed(self, previous_flags): # pylint: disable=arguments-differ
@ -111,7 +112,7 @@ class SidebarHeader(Gtk.Box):
box = Gtk.Box(margin_start=9, margin_top=6, margin_bottom=6, margin_right=9)
box.add(label)
self.add(box)
if name == "Runners":
if name == _("Runners"):
manage_runners_button = Gtk.Button.new_from_icon_name("emblem-system-symbolic", Gtk.IconSize.MENU)
manage_runners_button.props.action_name = "win.manage-runners"
manage_runners_button.props.relief = Gtk.ReliefStyle.NONE
@ -144,7 +145,7 @@ class SidebarListBox(Gtk.ListBox):
if local_theme_path not in icon_theme.get_search_path():
icon_theme.prepend_search_path(local_theme_path)
all_row = SidebarRow(None, "runner", "All", None)
all_row = SidebarRow(None, "runner", _("All"), None)
self.add(all_row)
self.select_row(all_row)
for runner in self.runners:
@ -153,7 +154,7 @@ class SidebarListBox(Gtk.ListBox):
name = runners.import_runner(runner).human_name
self.add(SidebarRow(runner, "runner", name, icon))
self.add(SidebarRow(None, "platform", "All", None))
self.add(SidebarRow(None, "platform", _("All"), None))
for platform in self.platforms:
icon_name = (platform.lower().replace(" ", "").replace("/", "_") + "-symbolic")
icon = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
@ -182,9 +183,9 @@ class SidebarListBox(Gtk.ListBox):
return
if not before:
row.set_header(SidebarHeader("Runners"))
row.set_header(SidebarHeader(_("Runners")))
elif before.type == "runner" and row.type == "platform":
row.set_header(SidebarHeader("Platforms"))
row.set_header(SidebarHeader(_("Platforms")))
def update(self, *args): # pylint: disable=unused-argument
self.installed_runners = [runner.name for runner in runners.get_installed()]

View file

@ -1,4 +1,6 @@
"""AppIndicator based tray icon"""
from gettext import gettext as _
# Third Party Libraries
import gi
from gi.repository import Gtk
@ -65,12 +67,12 @@ class LutrisStatusIcon:
present_menu = Gtk.ImageMenuItem()
present_menu.set_image(Gtk.Image.new_from_icon_name("lutris", Gtk.IconSize.MENU))
present_menu.set_label("Show Lutris")
present_menu.set_label(_("Show Lutris"))
present_menu.connect("activate", self.on_activate)
menu.append(present_menu)
quit_menu = Gtk.MenuItem()
quit_menu.set_label("Quit")
quit_menu.set_label(_("Quit"))
quit_menu.connect("activate", self.on_quit_application)
menu.append(quit_menu)
menu.show_all()
@ -116,7 +118,7 @@ class LutrisTray(Gtk.StatusIcon):
def __init__(self, application, **_kwargs):
super().__init__()
self.set_tooltip_text("Lutris")
self.set_tooltip_text(_("Lutris"))
self.set_visible(True)
self.application = application
self.set_from_icon_name("lutris")

View file

@ -7,6 +7,7 @@ import os
import shlex
import shutil
import stat
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GLib
@ -165,7 +166,7 @@ class CommandsMixin:
else:
dest_path = self.target_path
for filename in filenames:
msg = "Extracting %s" % os.path.basename(filename)
msg = _("Extracting %s") % os.path.basename(filename)
logger.debug(msg)
GLib.idle_add(self.parent.set_status, msg)
merge_single = "nomerge" not in data
@ -206,13 +207,13 @@ class CommandsMixin:
requires = data.get("requires")
message = data.get(
"message",
"Insert or mount game disc and click Autodetect or\n"
"use Browse if the disc is mounted on a non standard location.",
_("Insert or mount game disc and click Autodetect or\n"
"use Browse if the disc is mounted on a non standard location."),
)
message += (
"\n\nLutris is looking for a mounted disk drive or image \n"
"containing the following file or folder:\n"
"<i>%s</i>" % requires
_("\n\nLutris is looking for a mounted disk drive or image \n"
"containing the following file or folder:\n"
"<i>%s</i>") % requires
)
if self.runner == "wine":
GLib.idle_add(self.parent.eject_button.show)

View file

@ -1,30 +1,33 @@
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class ags(Runner):
human_name = "Adventure Game Studio"
description = "Graphics adventure engine"
platforms = ["Linux"]
human_name = _("Adventure Game Studio")
description = _("Graphics adventure engine")
platforms = [_("Linux")]
runner_executable = "ags/ags.sh"
game_options = [{"option": "main_file", "type": "file", "label": "Game executable or directory"}]
game_options = [{"option": "main_file", "type": "file", "label": _("Game executable or directory")}]
runner_options = [
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": True,
},
{
"option": "filter",
"type": "choice",
"label": "Graphics filter",
"label": _("Graphics filter"),
"choices": [
("None", "none"),
("Standard scaling", "stdscale"),
("HQ2x", "hq2x"),
("HQ3x", "hq3x"),
(_("None"), "none"),
(_("Standard scaling"), "stdscale"),
(_("HQ2x"), "hq2x"),
(_("HQ3x"), "hq3x"),
],
},
]

View file

@ -1,6 +1,7 @@
# Standard Library
import logging
import os.path
from gettext import gettext as _
# Lutris Modules
from lutris.config import LutrisConfig
@ -12,11 +13,11 @@ from lutris.util import display, extract, system
# pylint: disable=C0103
class atari800(Runner):
human_name = "Atari800"
platforms = ["Atari 8bit computers"] # FIXME try to determine the actual computer used
human_name = _("Atari800")
platforms = [_("Atari 8bit computers")] # FIXME try to determine the actual computer used
runner_executable = "atari800/bin/atari800"
bios_url = "http://kent.dl.sourceforge.net/project/atari800/ROM/Original%20XL%20ROM/xf25.zip"
description = "Atari 400,800 and XL emulator"
description = _("Atari 400,800 and XL emulator")
bios_checksums = {
"xlxe_rom": "06daac977823773a3eea3422fd26a703",
"basic_rom": "0bac0c6a50104045d902df4503a4c30b",
@ -31,8 +32,8 @@ class atari800(Runner):
"type":
"file",
"label":
"ROM file",
"help": (
_("ROM file"),
"help": _(
"The game data, commonly called a ROM image. \n"
"Supported rom formats: ATR, XFD, DCM, ATR.GZ, XFD.GZ "
"and PRO."
@ -46,7 +47,7 @@ class atari800(Runner):
screen_resolutions = [(resolution, resolution) for resolution in display.DISPLAY_MANAGER.get_resolutions()]
except OSError:
screen_resolutions = []
screen_resolutions.insert(0, ("Desktop resolution", "desktop"))
screen_resolutions.insert(0, (_("Desktop resolution"), "desktop"))
return screen_resolutions
runner_options = [
@ -56,8 +57,8 @@ class atari800(Runner):
"type":
"directory_chooser",
"label":
"Bios location",
"help": (
_("Bios location"),
"help": _(
"A folder containing the Atari 800 bios files.\n"
"They are provided by Lutris so you shouldn't have to "
"change this."
@ -69,29 +70,29 @@ class atari800(Runner):
"type":
"choice",
"choices": [
("Emulate Atari 800", "atari"),
("Emulate Atari 800 XL", "xl"),
("Emulate Atari 320 XE (Compy Shop)", "320xe"),
("Emulate Atari 320 XE (Rambo)", "rambo"),
("Emulate Atari 5200", "5200"),
(_("Emulate Atari 800"), "atari"),
(_("Emulate Atari 800 XL"), "xl"),
(_("Emulate Atari 320 XE (Compy Shop)"), "320xe"),
(_("Emulate Atari 320 XE (Rambo)"), "rambo"),
(_("Emulate Atari 5200"), "5200"),
],
"default":
"atari",
"label":
"Machine",
_("Machine"),
},
{
"option": "fullscreen",
"type": "bool",
"default": False,
"label": "Fullscreen",
"label": _("Fullscreen"),
},
{
"option": "resolution",
"type": "choice",
"choices": get_resolutions,
"default": "desktop",
"label": "Fullscreen resolution",
"label": _("Fullscreen resolution"),
},
]
@ -103,7 +104,7 @@ class atari800(Runner):
dlg = DownloadDialog(self.bios_url, bios_archive)
dlg.run()
if not system.path_exists(bios_archive):
ErrorDialog("Could not download Atari800 BIOS archive")
ErrorDialog(_("Could not download Atari800 BIOS archive"))
return
extract.extract_archive(bios_archive, config_path)
os.remove(bios_archive)

View file

@ -1,16 +1,19 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
class browser(Runner):
human_name = "Browser"
platforms = ["Web"]
description = "Runs games in the browser"
human_name = _("Browser")
platforms = [_("Web")]
description = _("Runs games in the browser")
game_options = [
{
"option": "main_file",
"type": "string",
"label": "Full address (URL)",
"label": _("Full address (URL)"),
"help": "The full address of the game's web page.",
}
]
@ -21,8 +24,8 @@ class browser(Runner):
"type":
"file",
"label":
"Custom web browser",
"help": (
_("Custom web browser"),
"help": _(
"Select the executable of a browser on your system. \n"
"If left blank, Lutris will launch your default browser."
),
@ -41,7 +44,7 @@ class browser(Runner):
if not url:
return {
"error": "CUSTOM",
"text": ("The web address is empty, \n"
"verify the game's configuration."),
"text": _("The web address is empty, \n"
"verify the game's configuration."),
}
return {"command": [self.get_executable(), url]}

View file

@ -1,4 +1,6 @@
"""Citra runner"""
from gettext import gettext as _
# Lutris Modules
from lutris.exceptions import UnavailableLibraries
from lutris.runners.runner import Runner
@ -9,18 +11,18 @@ from lutris.util.linux import LINUX_SYSTEM
class citra(Runner): # pylint: disable=invalid-name
"""Runner for Nintendo 3DS games using Citra"""
human_name = "Citra"
platforms = ["Nintendo 3DS"]
human_name = _("Citra")
platforms = [_("Nintendo 3DS")]
require_libs = {"libQt5OpenGL.so.5", "libQt5Widgets.so.5", "libQt5Multimedia.so.5"}
description = "Nintendo 3DS emulator"
description = _("Nintendo 3DS emulator")
runner_executable = "citra/citra-qt"
runnable_alone = True
game_options = [
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"help": "The game data, commonly called a ROM image.",
"label": _("ROM file"),
"help": _("The game data, commonly called a ROM image."),
}
]

View file

@ -1,3 +1,6 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
@ -5,15 +8,15 @@ from lutris.util import system
class desmume(Runner):
human_name = "DeSmuME"
platforms = ["Nintendo DS"]
description = "Nintendo DS emulator"
platforms = [_("Nintendo DS")]
description = _("Nintendo DS emulator")
runner_executable = "desmume/bin/desmume"
game_options = [
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"help": "The game data, commonly called a ROM image.",
"label": _("ROM file"),
"help": _("The game data, commonly called a ROM image."),
}
]

View file

@ -1,39 +1,42 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class dgen(Runner):
human_name = "DGen"
description = "Sega Genesis emulator"
platforms = ["Sega Genesis"]
human_name = _("DGen")
description = _("Sega Genesis emulator")
platforms = [_("Sega Genesis")]
runner_executable = "dgen/bin/dgen"
game_options = [
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"help": "The game data, commonly called a ROM image.",
"label": _("ROM file"),
"help": _("The game data, commonly called a ROM image."),
}
]
runner_options = [
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": True,
},
{
"option": "pal",
"type": "bool",
"label": "PAL",
"label": _("PAL"),
"default": False,
"advanced": True,
},
{
"option": "region",
"type": "choice",
"label": "Region",
"label": _("Region"),
"choices": [
("America (NTSC)", "U"),
("Japan (NTSC)", "J"),

View file

@ -1,13 +1,15 @@
"""Dolphin runner"""
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class dolphin(Runner):
description = "Gamecube and Wii emulator"
human_name = "Dolphin"
platforms = ["Nintendo Gamecube", "Nintendo Wii"]
description = _("Gamecube and Wii emulator")
human_name = _("Dolphin")
platforms = [_("Nintendo Gamecube"), _("Nintendo Wii")]
runnable_alone = True
runner_executable = "dolphin/dolphin-emu"
game_options = [
@ -15,29 +17,29 @@ class dolphin(Runner):
"option": "main_file",
"type": "file",
"default_path": "game_path",
"label": "ISO file",
"label": _("ISO file"),
},
{
"option": "platform",
"type": "choice",
"label": "Platform",
"choices": (("Nintendo Gamecube", "0"), ("Nintendo Wii", "1")),
"label": _("Platform"),
"choices": ((_("Nintendo Gamecube"), "0"), (_("Nintendo Wii"), "1")),
},
]
runner_options = [
{
"option": "nogui",
"type": "bool",
"label": "No GUI",
"label": _("No GUI"),
"default": False,
"help": "Disable the graphical user interface.",
"help": _("Disable the graphical user interface."),
},
{
"option": "batch",
"type": "bool",
"label": "Batch",
"label": _("Batch"),
"default": False,
"help": "Exit Dolphin with emulator.",
"help": _("Exit Dolphin with emulator."),
},
]

View file

@ -1,6 +1,7 @@
# Standard Library
import os
import shlex
from gettext import gettext as _
# Lutris Modules
from lutris.runners.commands.dosbox import dosexec, makeconfig # NOQA pylint: disable=unused-import
@ -9,9 +10,9 @@ from lutris.util import system
class dosbox(Runner):
human_name = "DOSBox"
description = "MS-Dos emulator"
platforms = ["MS-DOS"]
human_name = _("DOSBox")
description = _("MS-Dos emulator")
platforms = [_("MS-DOS")]
runnable_alone = True
runner_executable = "dosbox/bin/dosbox"
game_options = [
@ -21,8 +22,8 @@ class dosbox(Runner):
"type":
"file",
"label":
"Main file",
"help": (
_("Main file"),
"help": _(
"The CONF, EXE, COM or BAT file to launch.\n"
"It can be left blank if the launch of the executable is "
"managed in the config file."
@ -34,8 +35,8 @@ class dosbox(Runner):
"type":
"file",
"label":
"Configuration file",
"help": (
_("Configuration file"),
"help": _(
"Start Dosbox with the options specified in this file. \n"
"It can have a section in which you can put commands "
"to execute on startup. Read Dosbox's documentation "
@ -45,8 +46,8 @@ class dosbox(Runner):
{
"option": "args",
"type": "string",
"label": "Command arguments",
"help": "Command line arguments used when launching DOSBox",
"label": _("Command arguments"),
"help": _("Command line arguments used when launching DOSBox"),
"validator": shlex.split,
},
{
@ -55,8 +56,8 @@ class dosbox(Runner):
"type":
"directory_chooser",
"label":
"Working directory",
"help": (
_("Working directory"),
"help": _(
"The location where the game is run from.\n"
"By default, Lutris uses the directory of the "
"executable."
@ -89,7 +90,7 @@ class dosbox(Runner):
"option":
"scaler",
"label":
"Graphic scaler",
_("Graphic scaler"),
"type":
"choice",
"choices":
@ -97,22 +98,22 @@ class dosbox(Runner):
"default":
"normal3x",
"help":
("The algorithm used to scale up the game's base "
"resolution, resulting in different visual styles. "),
_("The algorithm used to scale up the game's base "
"resolution, resulting in different visual styles. "),
},
{
"option": "exit",
"label": "Exit Dosbox with the game",
"label": _("Exit Dosbox with the game"),
"type": "bool",
"default": True,
"help": "Shut down Dosbox when the game is quit.",
"help": _("Shut down Dosbox when the game is quit."),
},
{
"option": "fullscreen",
"label": "Open game in fullscreen",
"label": _("Open game in fullscreen"),
"type": "bool",
"default": False,
"help": "Tells Dosbox to launch the game in fullscreen.",
"help": _("Tells Dosbox to launch the game in fullscreen."),
},
]

View file

@ -1,14 +1,16 @@
# It is pitch black. You are likely to be eaten by a grue.
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class frotz(Runner):
human_name = "Frotz"
description = "Z-code emulator for text adventure games such as Zork."
platforms = ["Z-Machine"]
human_name = _("Frotz")
description = _("Z-code emulator for text adventure games such as Zork.")
platforms = [_("Z-Machine")]
runner_executable = "frotz/frotz"
game_options = [
@ -18,8 +20,8 @@ class frotz(Runner):
"type":
"file",
"label":
"Story file",
"help": (
_("Story file"),
"help": _(
"The Z-Machine game file.\n"
'Usally ends in ".z*", with "*" being a number from 1 '
"to 6 representing the version of the Z-Machine that "

View file

@ -1,5 +1,6 @@
# Standard Library
import os
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
@ -7,29 +8,29 @@ from lutris.util.display import DISPLAY_MANAGER
class fsuae(Runner):
human_name = "FS-UAE"
description = "Amiga emulator"
human_name = _("FS-UAE")
description = _("Amiga emulator")
platforms = [
"Amiga 500",
"Amiga 500+",
"Amiga 600",
"Amiga 1000",
"Amiga 1200",
"Amiga 1200",
"Amiga 4000",
"Amiga CD32",
"Commodore CDTV",
_("Amiga 500"),
_("Amiga 500+"),
_("Amiga 600"),
_("Amiga 1000"),
_("Amiga 1200"),
_("Amiga 1200"),
_("Amiga 4000"),
_("Amiga CD32"),
_("Commodore CDTV"),
]
model_choices = [
("Amiga 500", "A500"),
("Amiga 500+ with 1 MB chip RAM", "A500+"),
("Amiga 600 with 1 MB chip RAM", "A600"),
("Amiga 1000 with 512 KB chip RAM", "A1000"),
("Amiga 1200 with 2 MB chip RAM", "A1200"),
("Amiga 1200 but with 68020 processor", "A1200/020"),
("Amiga 4000 with 2 MB chip RAM and a 68040", "A4000/040"),
("Amiga CD32", "CD32"),
("Commodore CDTV", "CDTV"),
(_("Amiga 500"), "A500"),
(_("Amiga 500+ with 1 MB chip RAM"), "A500+"),
(_("Amiga 600 with 1 MB chip RAM"), "A600"),
(_("Amiga 1000 with 512 KB chip RAM"), "A1000"),
(_("Amiga 1200 with 2 MB chip RAM"), "A1200"),
(_("Amiga 1200 but with 68020 processor"), "A1200/020"),
(_("Amiga 4000 with 2 MB chip RAM and a 68040"), "A4000/040"),
(_("Amiga CD32"), "CD32"),
(_("Commodore CDTV"), "CDTV"),
]
memory_choices = [
("0", "0"),
@ -83,10 +84,10 @@ class fsuae(Runner):
"type":
"file",
"label":
"Boot disk",
_("Boot disk"),
"default_path":
"game_path",
"help": (
"help": _(
"The main floppy disk file with the game data. \n"
"FS-UAE supports floppy images in multiple file formats: "
"ADF, IPF, DMS are the most common. ADZ (compressed ADF) "
@ -97,34 +98,34 @@ class fsuae(Runner):
}, {
"option": "disks",
"type": "multiple",
"label": "Additionnal floppies",
"label": _("Additionnal floppies"),
"default_path": "game_path",
"help": "The additional floppy disk image(s).",
"help": _("The additional floppy disk image(s)."),
}, {
"option": "cdrom_image",
"label": "CD-Rom image",
"label": _("CD-Rom image"),
"type": "file",
"help": "CD-ROM image to use on non CD32/CDTV models"
"help": _("CD-ROM image to use on non CD32/CDTV models")
}
]
runner_options = [
{
"option": "model",
"label": "Amiga model",
"label": _("Amiga model"),
"type": "choice",
"choices": model_choices,
"default": "A500",
"help": "Specify the Amiga model you want to emulate.",
"help": _("Specify the Amiga model you want to emulate."),
},
{
"option":
"kickstart_file",
"label":
"Kickstart ROMs location",
_("Kickstart ROMs location"),
"type":
"file",
"help": (
"help": _(
"Choose the folder containing original Amiga kickstart "
"ROMs. Refer to FS-UAE documentation to find how to "
"acquire them. Without these, FS-UAE uses a bundled "
@ -134,39 +135,39 @@ class fsuae(Runner):
},
{
"option": "kickstart_ext_file",
"label": "Extended Kickstart location",
"label": _("Extended Kickstart location"),
"type": "file",
"help": "Location of extended Kickstart used for CD32",
"help": _("Location of extended Kickstart used for CD32"),
},
{
"option": "fmemory",
"label": "Fast Memory",
"label": _("Fast Memory"),
"type": "choice",
"choices": memory_choices,
"default": "0",
"help": "Specify how much Fast Memory the Amiga model should have.",
"help": _("Specify how much Fast Memory the Amiga model should have."),
},
{
"option": "fdvolume",
"label": "Floppy Drive Volume",
"label": _("Floppy Drive Volume"),
"type": "choice",
"choices": flsound_choices,
"default": "0",
"help": ("Set volume to 0 to disable floppy drive clicks "
"when the drive is empty. Max volume is 100.")
"help": _("Set volume to 0 to disable floppy drive clicks "
"when the drive is empty. Max volume is 100.")
},
{
"option":
"fdspeed",
"label":
"Floppy Drive Speed",
_("Floppy Drive Speed"),
"type":
"choice",
"choices":
flspeed_choices,
"default":
"100",
"help": (
"help": _(
"Set the speed of the emulated floppy drives, in percent. "
"For example, you can specify 800 to get an 8x increase in "
"speed. Use 0 to specify turbo mode. Turbo mode means that "
@ -177,14 +178,14 @@ class fsuae(Runner):
"option":
"grafixcard",
"label":
"Graphics Card",
_("Graphics Card"),
"type":
"choice",
"choices":
gpucard_choices,
"default":
"None",
"help": (
"help": _(
"Use this option to enable a graphics card. This option is none by default, in "
"which case only chipset graphics (OCS/ECS/AGA) support is available."
)
@ -193,60 +194,60 @@ class fsuae(Runner):
"option":
"grafixmemory",
"label":
"Graphics Card RAM",
_("Graphics Card RAM"),
"type":
"choice",
"choices":
gpumem_choices,
"default":
"0",
"help": (
"help": _(
"Override the amount of graphics memory on the graphics card. The 0 MB option is "
"not really valid, but exists for user interface reasons."
)
},
{
"option": "gfx_fullscreen_amiga",
"label": "Fullscreen (F12 + s to switch)",
"label": _("Fullscreen (F12 + s to switch)"),
"type": "bool",
"default": False,
},
{
"option": "jitcompiler",
"label": "JIT Compiler",
"label": _("JIT Compiler"),
"type": "bool",
"default": False,
},
{
"option": "gamemode",
"label": "Feral GameMode",
"label": _("Feral GameMode"),
"type": "bool",
"default": False,
"help": ("Automatically uses Feral GameMode daemon if available."
"set to true to disable the feature.")
"help": _("Automatically uses Feral GameMode daemon if available."
"set to true to disable the feature.")
},
{
"option": "govwarning",
"label": "CPU governor warning",
"label": _("CPU governor warning"),
"type": "bool",
"default": False,
"help":
("Warn if running with a CPU governor other than performance."
"set to true to disable the warning.")
_("Warn if running with a CPU governor other than performance."
"set to true to disable the warning.")
},
{
"option": "bsdsocket",
"label": "UAE bsdsocket.library",
"label": _("UAE bsdsocket.library"),
"type": "bool",
"default": False,
},
{
"option": "scanlines",
"label": "Scanlines display style",
"label": _("Scanlines display style"),
"type": "bool",
"default": False,
"help": ("Activates a display filter adding scanlines to imitate "
"the displays of yesteryear."),
"help": _("Activates a display filter adding scanlines to imitate "
"the displays of yesteryear."),
},
]

View file

@ -1,6 +1,7 @@
# Standard Library
import os
import shutil
from gettext import gettext as _
# Lutris Modules
from lutris.config import LutrisConfig
@ -10,9 +11,9 @@ from lutris.util import system
class hatari(Runner):
human_name = "Hatari"
description = "Atari ST computers emulator"
platforms = ["Atari ST"]
human_name = _("Hatari")
description = _("Atari ST computers emulator")
platforms = [_("Atari ST")]
runnable_alone = True
runner_executable = "hatari/bin/hatari"
game_options = [
@ -22,8 +23,8 @@ class hatari(Runner):
"type":
"file",
"label":
"Floppy Disk A",
"help": (
_("Floppy Disk A"),
"help": _(
"Hatari supports floppy disk images in the following "
"formats: ST, DIM, MSA, STX, IPF, RAW and CRT. The last "
"three require the caps library (capslib). ZIP is "
@ -36,8 +37,8 @@ class hatari(Runner):
"type":
"file",
"label":
"Floppy Disk B",
"help": (
_("Floppy Disk B"),
"help": _(
"Hatari supports floppy disk images in the following "
"formats: ST, DIM, MSA, STX, IPF, RAW and CRT. The last "
"three require the caps library (capslib). ZIP is "
@ -46,7 +47,7 @@ class hatari(Runner):
},
]
joystick_choices = [("None", "none"), ("Keyboard", "keys"), ("Joystick", "real")]
joystick_choices = [(_("None"), "none"), (_("Keyboard"), "keys"), (_("Joystick"), "real")]
runner_options = [
{
@ -55,8 +56,8 @@ class hatari(Runner):
"type":
"file",
"label":
"Bios file (TOS)",
"help": (
_("Bios file (TOS)"),
"help": _(
"TOS is the operating system of the Atari ST "
"and is necessary to run applications with the best "
"fidelity, minimizing risks of issues.\n"
@ -66,15 +67,15 @@ class hatari(Runner):
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": False,
},
{
"option": "zoom",
"type": "bool",
"label": "Scale up display by 2 (Atari ST/STE)",
"label": _("Scale up display by 2 (Atari ST/STE)"),
"default": True,
"help": "Double the screen size in windowed mode.",
"help": _("Double the screen size in windowed mode."),
},
{
"option":
@ -82,10 +83,10 @@ class hatari(Runner):
"type":
"bool",
"label":
"Add borders to display",
_("Add borders to display"),
"default":
False,
"help": (
"help": _(
"Useful for some games and demos using the overscan "
"technique. The Atari ST displayed borders around the "
"screen because it was not powerful enough to display "
@ -100,10 +101,10 @@ class hatari(Runner):
"type":
"bool",
"label":
"Display status bar",
_("Display status bar"),
"default":
False,
"help": (
"help": _(
"Displays a status bar with some useful information, "
"like green leds lighting up when the floppy disks are "
"read."
@ -112,14 +113,14 @@ class hatari(Runner):
{
"option": "joy0",
"type": "choice",
"label": "Joystick 1",
"label": _("Joystick 1"),
"choices": joystick_choices,
"default": "none",
},
{
"option": "joy1",
"type": "choice",
"label": "Joystick 2",
"label": _("Joystick 2"),
"choices": joystick_choices,
"default": "none",
},
@ -131,12 +132,12 @@ class hatari(Runner):
bios_path = system.create_folder("~/.hatari/bios")
dlg = QuestionDialog(
{
"question": "Do you want to select an Atari ST BIOS file?",
"title": "Use BIOS file?",
"question": _("Do you want to select an Atari ST BIOS file?"),
"title": _("Use BIOS file?"),
}
)
if dlg.result == dlg.YES:
bios_dlg = FileDialog("Select a BIOS file")
bios_dlg = FileDialog(_("Select a BIOS file"))
bios_filename = bios_dlg.filename
if not bios_filename:
return

View file

@ -1,5 +1,6 @@
# Standard Library
import os
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
@ -7,9 +8,9 @@ from lutris.util import system
class jzintv(Runner):
human_name = "jzIntv"
description = "Intellivision Emulator"
platforms = ["Intellivision"]
human_name = _("jzIntv")
description = _("Intellivision Emulator")
platforms = [_("Intellivision")]
runner_executable = "jzintv/bin/jzintv"
game_options = [
{
@ -18,10 +19,10 @@ class jzintv(Runner):
"type":
"file",
"label":
"ROM file",
_("ROM file"),
"default_path":
"game_path",
"help": (
"help": _(
"The game data, commonly called a ROM image. \n"
"Supported rom formats: .rom, .bin+.cfg, .int, .itv \n"
"The file extension must be lower-case."
@ -35,8 +36,8 @@ class jzintv(Runner):
"type":
"directory_chooser",
"label":
"Bios location",
"help": (
_("Bios location"),
"help": _(
"Choose the folder containing the Intellivision bios "
"files (exec.bin and grom.bin).\n"
"These files contain code from the original hardware "
@ -46,7 +47,7 @@ class jzintv(Runner):
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen"
"label": _("Fullscreen")
},
{
"option":
@ -56,7 +57,7 @@ class jzintv(Runner):
"label":
"Resolution",
"choices": (
("320 x 200 (default)", "0"),
(_("%s (default)") % "320 x 200", "0"),
("640 x 480", "1"),
("800 x 400", "5"),
("800 x 600", "2"),

View file

@ -1,6 +1,7 @@
"""libretro runner"""
# Standard Library
import os
from gettext import gettext as _
from operator import itemgetter
from zipfile import ZipFile
@ -55,8 +56,8 @@ def get_core_choices():
class libretro(Runner):
human_name = "Libretro"
description = "Multi system emulator"
human_name = _("Libretro")
description = _("Multi system emulator")
runnable_alone = True
runner_executable = "retroarch/retroarch"
@ -64,12 +65,12 @@ class libretro(Runner):
{
"option": "main_file",
"type": "file",
"label": "ROM file"
"label": _("ROM file")
},
{
"option": "core",
"type": "choice",
"label": "Core",
"label": _("Core"),
"choices": get_core_choices(),
},
]
@ -78,19 +79,19 @@ class libretro(Runner):
{
"option": "config_file",
"type": "file",
"label": "Config file",
"label": _("Config file"),
"default": get_default_config_path("retroarch.cfg"),
},
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": True,
},
{
"option": "verbose",
"type": "bool",
"label": "Verbose logging",
"label": _("Verbose logging"),
"default": False,
},
]
@ -253,7 +254,7 @@ class libretro(Runner):
if not core:
return {
"error": "CUSTOM",
"text": "No core has been selected for this game",
"text": _("No core has been selected for this game"),
}
command.append("--libretro={}".format(self.get_core_path(core)))
@ -264,7 +265,7 @@ class libretro(Runner):
# Main file
file = self.game_config.get("main_file")
if not file:
return {"error": "CUSTOM", "text": "No game file specified"}
return {"error": "CUSTOM", "text": _("No game file specified")}
if not system.path_exists(file):
return {"error": "FILE_NOT_FOUND", "file": file}
command.append(file)

View file

@ -2,6 +2,7 @@
# Standard Library
import os
import stat
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
@ -10,23 +11,23 @@ from lutris.util.strings import split_arguments
class linux(Runner):
human_name = "Linux"
description = "Runs native games"
platforms = ["Linux"]
human_name = _("Linux")
description = _("Runs native games")
platforms = [_("Linux")]
game_options = [
{
"option": "exe",
"type": "file",
"default_path": "game_path",
"label": "Executable",
"help": "The game's main executable file",
"label": _("Executable"),
"help": _("The game's main executable file"),
},
{
"option": "args",
"type": "string",
"label": "Arguments",
"help": "Command line arguments used when launching the game",
"label": _("Arguments"),
"help": _("Command line arguments used when launching the game"),
},
{
"option":
@ -34,8 +35,8 @@ class linux(Runner):
"type":
"directory_chooser",
"label":
"Working directory",
"help": (
_("Working directory"),
"help": _(
"The location where the game is run from.\n"
"By default, Lutris uses the directory of the "
"executable."
@ -44,9 +45,9 @@ class linux(Runner):
{
"option": "ld_preload",
"type": "file",
"label": "Preload library",
"label": _("Preload library"),
"advanced": True,
"help": "A library to load before running the game's executable.",
"help": _("A library to load before running the game's executable."),
},
{
"option":
@ -54,10 +55,10 @@ class linux(Runner):
"type":
"directory_chooser",
"label":
"Add directory to LD_LIBRARY_PATH",
_("Add directory to LD_LIBRARY_PATH"),
"advanced":
True,
"help": (
"help": _(
"A directory where libraries should be searched for "
"first, before the standard set of directories; this is "
"useful when debugging a new library or using a "

View file

@ -2,6 +2,7 @@
# Standard Library
import os
import subprocess
from gettext import gettext as _
# Lutris Modules
from lutris import settings
@ -36,9 +37,9 @@ class mame(Runner): # pylint: disable=invalid-name
"""MAME runner"""
human_name = "MAME"
description = "Arcade game emulator"
platforms = ["Arcade", "Plug & Play TV games", "LCD handheld games", "Game & Watch"]
human_name = _("MAME")
description = _("Arcade game emulator")
platforms = [_("Arcade"), _("Plug & Play TV games"), _("LCD handheld games"), _("Game & Watch")]
runner_executable = "mame/mame"
runnable_alone = True
config_dir = os.path.expanduser("~/.mame")
@ -49,65 +50,65 @@ class mame(Runner): # pylint: disable=invalid-name
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"label": _("ROM file"),
"default_path": "game_path",
}, {
"option": "machine",
"type": "choice_with_search",
"label": "Machine",
"label": _("Machine"),
"choices": get_system_choices,
"help": "The emulated machine."
"help": _("The emulated machine.")
}, {
"option":
"device",
"type":
"choice_with_entry",
"label":
"Storage type",
_("Storage type"),
"choices": [
("Floppy disk", "flop"),
("Floppy drive 1", "flop1"),
("Floppy drive 2", "flop2"),
("Floppy drive 3", "flop3"),
("Floppy drive 4", "flop4"),
("Cassette (tape)", "cass"),
("Cassette 1 (tape)", "cass1"),
("Cassette 2 (tape)", "cass2"),
("Cartridge", "cart"),
("Cartridge 1", "cart1"),
("Cartridge 2", "cart2"),
("Cartridge 3", "cart3"),
("Cartridge 4", "cart4"),
("Snapshot", "snapshot"),
("Hard Disk", "hard"),
("Hard Disk 1", "hard1"),
("Hard Disk 2", "hard2"),
("CDROM", "cdrm"),
("CDROM 1", "cdrm1"),
("CDROM 2", "cdrm2"),
("Snapshot", "dump"),
("Quickload", "quickload"),
("Memory Card", "memc"),
("Cylinder", "cyln"),
("Punch Tape 1", "ptap1"),
("Punch Tape 2", "ptap2"),
("Print Out", "prin"),
(_("Floppy disk"), "flop"),
(_("Floppy drive 1"), "flop1"),
(_("Floppy drive 2"), "flop2"),
(_("Floppy drive 3"), "flop3"),
(_("Floppy drive 4"), "flop4"),
(_("Cassette (tape)"), "cass"),
(_("Cassette 1 (tape)"), "cass1"),
(_("Cassette 2 (tape)"), "cass2"),
(_("Cartridge"), "cart"),
(_("Cartridge 1"), "cart1"),
(_("Cartridge 2"), "cart2"),
(_("Cartridge 3"), "cart3"),
(_("Cartridge 4"), "cart4"),
(_("Snapshot"), "snapshot"),
(_("Hard Disk"), "hard"),
(_("Hard Disk 1"), "hard1"),
(_("Hard Disk 2"), "hard2"),
(_("CDROM"), "cdrm"),
(_("CDROM 1"), "cdrm1"),
(_("CDROM 2"), "cdrm2"),
(_("Snapshot"), "dump"),
(_("Quickload"), "quickload"),
(_("Memory Card"), "memc"),
(_("Cylinder"), "cyln"),
(_("Punch Tape 1"), "ptap1"),
(_("Punch Tape 2"), "ptap2"),
(_("Print Out"), "prin"),
],
}, {
"option": "platform",
"type": "choice",
"label": "Platform",
"choices": (("Auto", ""), ("Plug & Play TV games", "1"), ("LCD handheld games", "2")),
"label": _("Platform"),
"choices": ((_("Auto"), ""), (_("Plug & Play TV games"), "1"), (_("LCD handheld games"), "2")),
}, {
"option": "autoboot_command",
"type": "string",
"label": "Autoboot command",
"help": ("Autotype this command when the system has started,"
"an enter keypress is automatically added."),
"label": _("Autoboot command"),
"help": _("Autotype this command when the system has started,"
"an enter keypress is automatically added."),
}, {
"option": "autoboot_delay",
"type": "range",
"label": "Delay before entering autoboot command",
"label": _("Delay before entering autoboot command"),
"min": 0,
"max": 120,
}
@ -120,8 +121,8 @@ class mame(Runner): # pylint: disable=invalid-name
"type":
"directory_chooser",
"label":
"ROM/BIOS path",
"help": (
_("ROM/BIOS path"),
"help": _(
"Choose the folder containing ROMs and BIOS files.\n"
"These files contain code from the original hardware "
"necessary to the emulation."
@ -130,29 +131,29 @@ class mame(Runner): # pylint: disable=invalid-name
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": True,
},
{
"option": "video",
"type": "choice",
"label": "Video backend",
"label": _("Video backend"),
"choices": (
("Auto", ""),
(_("Auto"), ""),
("OpenGL", "opengl"),
("BGFX", "bgfx"),
("SDL2", "accel"),
("Software", "soft"),
(_("Software"), "soft"),
),
"default": "",
},
{
"option": "waitvsync",
"type": "bool",
"label": "Wait for VSync",
"label": _("Wait for VSync"),
"help":
("Enable waiting for the start of VBLANK before "
"flipping screens; reduces tearing effects."),
_("Enable waiting for the start of VBLANK before "
"flipping screens; reduces tearing effects."),
"advanced": True,
"default": False,
},
@ -164,23 +165,23 @@ class mame(Runner): # pylint: disable=invalid-name
"label":
"Menu mode key",
"choices": [
("Scroll Lock", "SCRLOCK"),
("Num Lock", "NUMLOCK"),
("Caps Lock", "CAPSLOCK"),
("Menu", "MENU"),
("Right Control", "RCONTROL"),
("Left Control", "LCONTROL"),
("Right Alt", "RALT"),
("Left Alt", "LALT"),
("Right Super", "RWIN"),
("Left Super", "LWIN"),
(_("Scroll Lock"), "SCRLOCK"),
(_("Num Lock"), "NUMLOCK"),
(_("Caps Lock"), "CAPSLOCK"),
(_("Menu"), "MENU"),
(_("Right Control"), "RCONTROL"),
(_("Left Control"), "LCONTROL"),
(_("Right Alt"), "RALT"),
(_("Left Alt"), "LALT"),
(_("Right Super"), "RWIN"),
(_("Left Super"), "LWIN"),
],
"default":
"SCRLOCK",
"advanced":
True,
"help": ("Key to switch between Full Keyboard Mode and "
"Partial Keyboard Mode (default: Scroll Lock)"),
"help": _("Key to switch between Full Keyboard Mode and "
"Partial Keyboard Mode (default: Scroll Lock)"),
},
]
@ -206,8 +207,8 @@ class mame(Runner): # pylint: disable=invalid-name
return machine_mapping[self.game_config["machine"]]
rom_file = os.path.basename(self.game_config.get("main_file", ""))
if rom_file.startswith("gnw_"):
return "Nintendo Game & Watch"
return "Arcade"
return _("Nintendo Game & Watch")
return _("Arcade")
def prelaunch(self):
if not system.path_exists(os.path.join(self.config_dir, "mame.ini")):

View file

@ -1,5 +1,6 @@
# Standard Library
import subprocess
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
@ -12,65 +13,65 @@ DEFAULT_MEDNAFEN_SCALER = "nn4x"
class mednafen(Runner):
human_name = "Mednafen"
description = "Multi-system emulator including NES, GB(A), PC Engine support."
human_name = _("Mednafen")
description = _("Multi-system emulator including NES, GB(A), PC Engine support.")
platforms = [
"Nintendo Game Boy (Color)",
"Nintendo Game Boy Advance",
"Sega Game Gear",
"Sega Genesis/Mega Drive",
"Atari Lynx",
"Sega Master System",
"SNK Neo Geo Pocket (Color)",
"Nintendo NES",
"NEC PC Engine TurboGrafx-16",
"NEC PC-FX",
"Sony PlayStation",
"Sega Saturn",
"Nintendo SNES",
"Bandai WonderSwan",
"Nintendo Virtual Boy",
_("Nintendo Game Boy (Color)"),
_("Nintendo Game Boy Advance"),
_("Sega Game Gear"),
_("Sega Genesis/Mega Drive"),
_("Atari Lynx"),
_("Sega Master System"),
_("SNK Neo Geo Pocket (Color)"),
_("Nintendo NES"),
_("NEC PC Engine TurboGrafx-16"),
_("NEC PC-FX"),
_("Sony PlayStation"),
_("Sega Saturn"),
_("Nintendo SNES"),
_("Bandai WonderSwan"),
_("Nintendo Virtual Boy"),
]
machine_choices = (
("Game Boy (Color)", "gb"),
("Game Boy Advance", "gba"),
("Game Gear", "gg"),
("Genesis/Mega Drive", "md"),
("Lynx", "lynx"),
("Master System", "sms"),
("Neo Geo Pocket (Color)", "gnp"),
("NES", "nes"),
("PC Engine", "pce_fast"),
("PC-FX", "pcfx"),
("PlayStation", "psx"),
("Saturn", "ss"),
("SNES", "snes"),
("WonderSwan", "wswan"),
("Virtual Boy", "vb"),
(_("Game Boy (Color)"), "gb"),
(_("Game Boy Advance"), "gba"),
(_("Game Gear"), "gg"),
(_("Genesis/Mega Drive"), "md"),
(_("Lynx"), "lynx"),
(_("Master System"), "sms"),
(_("Neo Geo Pocket (Color)"), "gnp"),
(_("NES"), "nes"),
(_("PC Engine"), "pce_fast"),
(_("PC-FX"), "pcfx"),
(_("PlayStation"), "psx"),
(_("Saturn"), "ss"),
(_("SNES"), "snes"),
(_("WonderSwan"), "wswan"),
(_("Virtual Boy"), "vb"),
)
runner_executable = "mednafen/bin/mednafen"
game_options = [
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"label": _("ROM file"),
"help":
("The game data, commonly called a ROM image. \n"
"Mednafen supports GZIP and ZIP compressed ROMs."),
_("The game data, commonly called a ROM image. \n"
"Mednafen supports GZIP and ZIP compressed ROMs."),
},
{
"option": "machine",
"type": "choice",
"label": "Machine type",
"label": _("Machine type"),
"choices": machine_choices,
"help": "The emulated machine.",
"help": _("The emulated machine."),
},
]
runner_options = [
{
"option": "fs",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": False
},
{
@ -79,13 +80,13 @@ class mednafen(Runner):
"type":
"choice",
"label":
"Aspect ratio",
_("Aspect ratio"),
"choices": (
("Disabled", "0"),
("Stretched", "full"),
("Preserve aspect ratio", "aspect"),
("Integer scale", "aspect_int"),
("Multiple of 2 scale", "aspect_mult2"),
(_("Disabled"), "0"),
(_("Stretched"), "full"),
(_("Preserve aspect ratio"), "aspect"),
(_("Integer scale"), "aspect_int"),
(_("Multiple of 2 scale"), "aspect_mult2"),
),
"default":
"aspect_int",
@ -96,7 +97,7 @@ class mednafen(Runner):
"type":
"choice",
"label":
"Video scaler",
_("Video scaler"),
"choices": (
("none", "none"),
("hq2x", "hq2x"),
@ -124,10 +125,10 @@ class mednafen(Runner):
"type":
"choice",
"label":
"Sound device",
_("Sound device"),
"choices": (
("Mednafen default", "default"),
("ALSA default", "sexyal-literal-default"),
(_("Mednafen default"), "default"),
(_("ALSA default"), "sexyal-literal-default"),
("hw:0", "hw:0,0"),
("hw:1", "hw:1,0"),
("hw:2", "hw:2,0"),
@ -138,7 +139,7 @@ class mednafen(Runner):
{
"option": "dont_map_controllers",
"type": "bool",
"label": "Use default Mednafen controller configuration",
"label": _("Use default Mednafen controller configuration"),
"default": False,
},
]

View file

@ -1,5 +1,6 @@
# Standard Library
import os
from gettext import gettext as _
# Lutris Modules
from lutris import settings
@ -8,29 +9,29 @@ from lutris.util import system
class mupen64plus(Runner):
human_name = "Mupen64Plus"
description = "Nintendo 64 emulator"
platforms = ["Nintendo 64"]
human_name = _("Mupen64Plus")
description = _("Nintendo 64 emulator")
platforms = [_("Nintendo 64")]
runner_executable = "mupen64plus/mupen64plus"
game_options = [
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"help": "The game data, commonly called a ROM image.",
"label": _("ROM file"),
"help": _("The game data, commonly called a ROM image."),
}
]
runner_options = [
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": True,
},
{
"option": "hideosd",
"type": "bool",
"label": "Hide OSD",
"label": _("Hide OSD"),
"default": True
},
]

View file

@ -1,5 +1,6 @@
# Standard Library
import os
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
@ -7,13 +8,13 @@ from lutris.util import system
class o2em(Runner):
human_name = "O2EM"
description = "Magnavox Osyssey² Emulator"
human_name = _("O2EM")
description = _("Magnavox Osyssey² Emulator")
platforms = (
"Magnavox Odyssey²",
"Phillips C52",
"Phillips Videopac+",
"Brandt Jopac",
_("Magnavox Odyssey²"),
_("Phillips C52"),
_("Phillips Videopac+"),
_("Brandt Jopac"),
)
bios_path = os.path.expanduser("~/.o2em/bios")
runner_executable = "o2em/o2em"
@ -26,24 +27,24 @@ class o2em(Runner):
}
bios_choices = [
("Magnavox Odyssey2", "o2rom"),
("Phillips C52", "c52"),
("Phillips Videopac+", "g7400"),
("Brandt Jopac", "jopac"),
(_("Magnavox Odyssey2"), "o2rom"),
(_("Phillips C52"), "c52"),
(_("Phillips Videopac+"), "g7400"),
(_("Brandt Jopac"), "jopac"),
]
controller_choices = [
("Disable", "0"),
("Arrows keys and right shift", "1"),
("W,S,A,D,SPACE", "2"),
("Joystick", "3"),
(_("Disable"), "0"),
(_("Arrows keys and right shift"), "1"),
(_("W,S,A,D,SPACE"), "2"),
(_("Joystick"), "3"),
]
game_options = [
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"label": _("ROM file"),
"default_path": "game_path",
"help": "The game data, commonly called a ROM image.",
"help": _("The game data, commonly called a ROM image."),
}
]
runner_options = [
@ -51,36 +52,36 @@ class o2em(Runner):
"option": "bios",
"type": "choice",
"choices": bios_choices,
"label": "Bios",
"label": _("Bios"),
"default": "o2rom",
},
{
"option": "controller1",
"type": "choice",
"choices": controller_choices,
"label": "First controller",
"label": _("First controller"),
"default": "2",
},
{
"option": "controller2",
"type": "choice",
"choices": controller_choices,
"label": "Second controller",
"label": _("Second controller"),
"default": "1",
},
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": False,
},
{
"option": "scanlines",
"type": "bool",
"label": "Scanlines display style",
"label": _("Scanlines display style"),
"default": False,
"help": ("Activates a display filter adding scanlines to imitate "
"the displays of yesteryear."),
"help": _("Activates a display filter adding scanlines to imitate "
"the displays of yesteryear."),
},
]

View file

@ -1,18 +1,21 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class openmsx(Runner):
human_name = "openMSX"
description = "MSX computer emulator"
platforms = ["MSX, MSX2, MSX2+, MSX turboR"]
human_name = _("openMSX")
description = _("MSX computer emulator")
platforms = [_("MSX, MSX2, MSX2+, MSX turboR")]
game_options = [
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"help": "The game data, commonly called a ROM image.",
"label": _("ROM file"),
"help": _("The game data, commonly called a ROM image."),
}
]

View file

@ -1,12 +1,15 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class osmose(Runner):
human_name = "Osmose"
description = "Sega Master System Emulator"
platforms = ["Sega Master System"]
human_name = _("Osmose")
description = _("Sega Master System Emulator")
platforms = [_("Sega Master System")]
runner_executable = "osmose/osmose"
game_options = [
{
@ -15,10 +18,10 @@ class osmose(Runner):
"type":
"file",
"label":
"ROM file",
_("ROM file"),
"default_path":
"game_path",
"help": (
"help": _(
"The game data, commonly called a ROM image.\n"
"Supported formats: SMS and GG files. ZIP compressed "
"ROMs are supported."
@ -28,7 +31,7 @@ class osmose(Runner):
runner_options = [{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": False,
}]

View file

@ -1,18 +1,21 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class pcsx2(Runner):
human_name = "PCSX2"
description = "PlayStation 2 emulator"
platforms = ["Sony PlayStation 2"]
human_name = _("PCSX2")
description = _("PlayStation 2 emulator")
platforms = [_("Sony PlayStation 2")]
runnable_alone = True
runner_executable = "pcsx2/PCSX2"
game_options = [{
"option": "main_file",
"type": "file",
"label": "ISO file",
"label": _("ISO file"),
"default_path": "game_path",
}]
@ -20,31 +23,31 @@ class pcsx2(Runner):
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": False,
},
{
"option": "full_boot",
"type": "bool",
"label": "Fullboot",
"label": _("Fullboot"),
"default": False
},
{
"option": "nogui",
"type": "bool",
"label": "No GUI",
"label": _("No GUI"),
"default": False
},
{
"option": "config_file",
"type": "file",
"label": "Custom config file",
"label": _("Custom config file"),
"advanced": True,
},
{
"option": "config_path",
"type": "directory_chooser",
"label": "Custom config path",
"label": _("Custom config path"),
"advanced": True,
},
]

View file

@ -4,6 +4,7 @@ import json
import math
import os
import shutil
from gettext import gettext as _
from time import sleep
# Lutris Modules
@ -17,16 +18,16 @@ DOWNLOAD_URL = "https://github.com/daniel-j/lutris-pico-8-runner/archive/master.
class pico8(Runner):
description = "Runs PICO-8 fantasy console cartridges"
description = _("Runs PICO-8 fantasy console cartridges")
multiple_versions = False
human_name = "PICO-8"
platforms = ["PICO-8"]
human_name = _("PICO-8")
platforms = [_("PICO-8")]
game_options = [
{
"option": "main_file",
"type": "string",
"label": "Cartridge file/url/id",
"help": "You can put a .p8.png file path, url, or BBS cartridge id here.",
"label": _("Cartridge file/url/id"),
"help": _("You can put a .p8.png file path, url, or BBS cartridge id here."),
}
]
@ -34,37 +35,37 @@ class pico8(Runner):
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": True,
"help": "Launch in fullscreen.",
"help": _("Launch in fullscreen."),
},
{
"option": "window_size",
"label": "Window size",
"label": _("Window size"),
"type": "string",
"default": "640x512",
"help": "The initial size of the game window.",
"help": _("The initial size of the game window."),
},
{
"option": "splore",
"type": "bool",
"label": "Start in splore mode",
"label": _("Start in splore mode"),
"default": False,
},
{
"option": "args",
"type": "string",
"label": "Extra arguments",
"label": _("Extra arguments"),
"default": "",
"help": "Extra arguments to the executable",
"help": _("Extra arguments to the executable"),
"advanced": True,
},
{
"option": "engine",
"type": "string",
"label": "Engine (web only)",
"label": _("Engine (web only)"),
"default": "pico8_0111g_4",
"help": "Name of engine (will be downloaded) or local file path",
"help": _("Name of engine (will be downloaded) or local file path"),
},
]
@ -78,7 +79,7 @@ class pico8(Runner):
self.runnable_alone = self.is_native
def __repr__(self):
return "PICO-8 runner (%s)" % self.config
return _("PICO-8 runner (%s)") % self.config
def install(self, version=None, _downloader=None, callback=None):
opts = {}

View file

@ -1,24 +1,27 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class ppsspp(Runner):
human_name = "PPSSPP"
description = "Sony PSP emulator"
platforms = ["Sony PlayStation Portable"]
human_name = _("PPSSPP")
description = _("Sony PSP emulator")
platforms = [_("Sony PlayStation Portable")]
runner_executable = "ppsspp/PPSSPPSDL"
game_options = [{
"option": "main_file",
"type": "file",
"label": "ISO file",
"label": _("ISO file"),
"default_path": "game_path",
}]
runner_options = [{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": False,
}]

View file

@ -4,6 +4,7 @@ import re
import shutil
from collections import Counter
from configparser import RawConfigParser
from gettext import gettext as _
# Lutris Modules
from lutris import settings
@ -13,9 +14,9 @@ from lutris.util import joypad, system
class reicast(Runner):
human_name = "Reicast"
description = "Sega Dreamcast emulator"
platforms = ["Sega Dreamcast"]
human_name = _("Reicast")
description = _("Sega Dreamcast emulator")
platforms = [_("Sega Dreamcast")]
runner_executable = "reicast/reicast.elf"
joypads = None
@ -24,9 +25,9 @@ class reicast(Runner):
{
"option": "iso",
"type": "file",
"label": "Disc image file",
"help": ("The game data.\n"
"Supported formats: ISO, CDI"),
"label": _("Disc image file"),
"help": _("The game data.\n"
"Supported formats: ISO, CDI"),
}
]
@ -37,34 +38,34 @@ class reicast(Runner):
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": False,
},
{
"option": "device_id_1",
"type": "choice",
"label": "Joypad 1",
"label": _("Joypad 1"),
"choices": self.get_joypads,
"default": "-1",
},
{
"option": "device_id_2",
"type": "choice",
"label": "Joypad 2",
"label": _("Joypad 2"),
"choices": self.get_joypads,
"default": "-1",
},
{
"option": "device_id_3",
"type": "choice",
"label": "Joypad 3",
"label": _("Joypad 3"),
"choices": self.get_joypads,
"default": "-1",
},
{
"option": "device_id_4",
"type": "choice",
"label": "Joypad 4",
"label": _("Joypad 4"),
"choices": self.get_joypads,
"default": "-1",
},
@ -79,7 +80,7 @@ class reicast(Runner):
shutil.copy(os.path.join(mapping_source, mapping_file), mapping_path)
system.create_folder("~/.reicast/data")
NoticeDialog("You have to copy valid BIOS files to ~/.reicast/data " "before playing")
NoticeDialog(_("You have to copy valid BIOS files to ~/.reicast/data before playing"))
super(reicast, self).install(version, downloader, on_runner_installed)

View file

@ -2,6 +2,7 @@
# Standard Library
import os
import subprocess
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
@ -10,9 +11,9 @@ RESIDUALVM_CONFIG_FILE = os.path.join(os.path.expanduser("~"), ".residualvmrc")
class residualvm(Runner):
human_name = "ResidualVM"
platforms = ["Linux"] # TODO
description = (
human_name = _("ResidualVM")
platforms = [_("Linux")] # TODO
description = _(
"Runs various 3D point-and-click adventure games, "
"like Grim Fandango and Escape from Monkey Island."
)
@ -21,16 +22,16 @@ class residualvm(Runner):
{
"option": "game_id",
"type": "string",
"label": "Game identifier"
"label": _("Game identifier")
},
{
"option": "path",
"type": "directory_chooser",
"label": "Game files location"
"label": _("Game files location")
},
{
"option": "subtitles",
"label": "Enable subtitles (if the game has voice)",
"label": _("Enable subtitles (if the game has voice)"),
"type": "bool",
"default": False,
},
@ -38,24 +39,24 @@ class residualvm(Runner):
runner_options = [
{
"option": "fullscreen",
"label": "Fullscreen mode",
"label": _("Fullscreen mode"),
"type": "bool",
"default": False,
},
{
"option": "renderer",
"label": "Renderer",
"label": _("Renderer"),
"type": "choice",
"choices": (
("OpenGL", "opengl"),
("OpenGL shaders", "opengl_shaders"),
("Software", "software"),
(_("OpenGL shaders"), "opengl_shaders"),
(_("Software"), "software"),
),
"default": "opengl",
},
{
"option": "show-fps",
"label": "Display FPS information",
"label": _("Display FPS information"),
"type": "bool",
"default": False,
},

View file

@ -1,12 +1,15 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class rpcs3(Runner):
human_name = "RPCS3"
description = "PlayStation 3 emulator"
platforms = ["Sony PlayStation 3"]
human_name = _("RPCS3")
description = _("PlayStation 3 emulator")
platforms = [_("Sony PlayStation 3")]
runnable_alone = True
runner_executable = "rpcs3/rpcs3"
game_options = [
@ -14,10 +17,10 @@ class rpcs3(Runner):
"option": "main_file",
"type": "file",
"default_path": "game_path",
"label": "Path to EBOOT.BIN",
"label": _("Path to EBOOT.BIN"),
}
]
runner_options = [{"option": "nogui", "type": "bool", "label": "No GUI", "default": False}]
runner_options = [{"option": "nogui", "type": "bool", "label": _("No GUI"), "default": False}]
# RPCS3 currently uses an AppImage, no need for the runtime.
system_options_override = [{"option": "disable_runtime", "default": True}]

View file

@ -1,6 +1,7 @@
"""Base module for runners"""
# Standard Library
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gtk
@ -148,7 +149,7 @@ class Runner(metaclass=RunnerMeta): # pylint: disable=too-many-public-methods
{
"option": "runner_executable",
"type": "file",
"label": "Custom executable for the runner",
"label": _("Custom executable for the runner"),
"advanced": True,
}
)
@ -249,9 +250,9 @@ class Runner(metaclass=RunnerMeta): # pylint: disable=too-many-public-methods
"""
dialog = dialogs.QuestionDialog(
{
"question": ("The required runner is not installed.\n"
"Do you wish to install it now?"),
"title": "Required runner unavailable",
"question": _("The required runner is not installed.\n"
"Do you wish to install it now?"),
"title": _("Required runner unavailable"),
}
)
if Gtk.ResponseType.YES == dialog.result:

View file

@ -1,6 +1,7 @@
# Standard Library
import os
import subprocess
from gettext import gettext as _
# Lutris Modules
from lutris import settings
@ -10,39 +11,39 @@ from lutris.util.strings import split_arguments
class scummvm(Runner):
description = "Runs various 2D point-and-click adventure games."
human_name = "ScummVM"
platforms = ["Linux"]
description = _("Runs various 2D point-and-click adventure games.")
human_name = _("ScummVM")
platforms = [_("Linux")]
runnable_alone = True
runner_executable = "scummvm/bin/scummvm"
game_options = [
{
"option": "game_id",
"type": "string",
"label": "Game identifier"
"label": _("Game identifier")
},
{
"option": "path",
"type": "directory_chooser",
"label": "Game files location"
"label": _("Game files location")
},
{
"option": "subtitles",
"label": "Enable subtitles (if the game has voice)",
"label": _("Enable subtitles (if the game has voice)"),
"type": "bool",
"default": False,
},
{
"option": "args",
"type": "string",
"label": "Arguments",
"help": "Command line arguments used when launching the game",
"label": _("Arguments"),
"help": _("Command line arguments used when launching the game"),
},
]
runner_options = [
{
"option": "fullscreen",
"label": "Fullscreen mode",
"label": _("Fullscreen mode"),
"type": "bool",
"default": False,
},
@ -50,12 +51,12 @@ class scummvm(Runner):
"option":
"aspect",
"label":
"Aspect ratio correction",
_("Aspect ratio correction"),
"type":
"bool",
"default":
True,
"help": (
"help": _(
"Most games supported by ScummVM were made for VGA "
"display modes using rectangular pixels. Activating "
"this option for these games will preserve the 4:3 "
@ -66,13 +67,13 @@ class scummvm(Runner):
"option":
"gfx-mode",
"label":
"Graphic scaler",
_("Graphic scaler"),
"type":
"choice",
"default":
"3x",
"choices": [
("normal", "normal"),
(_("normal"), "normal"),
("2x", "2x"),
("3x", "3x"),
("hq2x", "hq2x"),
@ -86,14 +87,14 @@ class scummvm(Runner):
("dotmatrix", "dotmatrix"),
],
"help":
("The algorithm used to scale up the game's base "
"resolution, resulting in different visual styles. "),
_("The algorithm used to scale up the game's base "
"resolution, resulting in different visual styles. "),
},
{
"option": "datadir",
"label": "Data directory",
"label": _("Data directory"),
"type": "directory_chooser",
"help": "Defaults to share/scummvm if unspecified.",
"help": _("Defaults to share/scummvm if unspecified."),
"advanced": True,
},
]

View file

@ -2,6 +2,7 @@
import os
import subprocess
import xml.etree.ElementTree as etree
from gettext import gettext as _
# Lutris Modules
from lutris import settings
@ -13,9 +14,9 @@ SNES9X_DIR = os.path.join(settings.DATA_DIR, "runners/snes9x")
class snes9x(Runner):
description = "Super Nintendo emulator"
human_name = "Snes9x"
platforms = ["Nintendo SNES"]
description = _("Super Nintendo emulator")
human_name = _("Snes9x")
platforms = [_("Nintendo SNES")]
runnable_alone = True
runner_executable = "snes9x/bin/snes9x-gtk"
game_options = [
@ -23,8 +24,8 @@ class snes9x(Runner):
"option": "main_file",
"type": "file",
"default_path": "game_path",
"label": "ROM file",
"help": "The game data, commonly called a ROM image.",
"label": _("ROM file"),
"help": _("The game data, commonly called a ROM image."),
}
]
@ -32,7 +33,7 @@ class snes9x(Runner):
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": "1"
},
{
@ -41,10 +42,10 @@ class snes9x(Runner):
"type":
"bool",
"label":
"Maintain aspect ratio (4:3)",
_("Maintain aspect ratio (4:3)"),
"default":
"1",
"help": (
"help": _(
"Super Nintendo games were made for 4:3 "
"screens with rectangular pixels, but modern screens "
"have square pixels, which results in a vertically "
@ -55,7 +56,7 @@ class snes9x(Runner):
{
"option": "sound_driver",
"type": "choice",
"label": "Sound driver",
"label": _("Sound driver"),
"advanced": True,
"choices": (("SDL", "1"), ("ALSA", "2"), ("OSS", "0")),
"default": "1",

View file

@ -3,6 +3,7 @@
import os
import subprocess
import time
from gettext import gettext as _
# Lutris Modules
from lutris.command import MonitoredCommand
@ -39,16 +40,16 @@ def is_running():
class steam(Runner):
description = "Runs Steam for Linux games"
human_name = "Steam"
platforms = ["Linux"]
description = _("Runs Steam for Linux games")
human_name = _("Steam")
platforms = [_("Linux")]
runner_executable = "steam"
game_options = [
{
"option": "appid",
"label": "Application ID",
"label": _("Application ID"),
"type": "string",
"help": (
"help": _(
"The application ID can be retrieved from the game's "
"page at steampowered.com. Example: 235320 is the "
"app ID for <i>Original War</i> in: \n"
@ -58,47 +59,47 @@ class steam(Runner):
{
"option": "args",
"type": "string",
"label": "Arguments",
"help": (
"label": _("Arguments"),
"help": _(
"Command line arguments used when launching the game.\n"
"Ignored when Steam Big Picture mode is enabled."
),
},
{
"option": "run_without_steam",
"label": "DRM free mode (Do not launch Steam)",
"label": _("DRM free mode (Do not launch Steam)"),
"type": "bool",
"default": False,
"advanced": True,
"help": (
"help": _(
"Run the game directly without Steam, requires the game binary path to be set"
),
},
{
"option": "steamless_binary",
"type": "file",
"label": "Game binary path",
"label": _("Game binary path"),
"advanced": True,
"help": "Path to the game executable (Required by DRM free mode)",
"help": _("Path to the game executable (Required by DRM free mode)"),
},
]
runner_options = [
{
"option": "quit_steam_on_exit",
"label": "Stop Steam after game exits",
"label": _("Stop Steam after game exits"),
"type": "bool",
"default": False,
"help": (
"help": _(
"Shut down Steam after the game has quit\n"
"(only if Steam was started by Lutris)"
),
},
{
"option": "start_in_big_picture",
"label": "Start Steam in Big Picture mode",
"label": _("Start Steam in Big Picture mode"),
"type": "bool",
"default": False,
"help": (
"help": _(
"Launches Steam in Big Picture mode.\n"
"Only works if Steam is not running or "
"already running in Big Picture mode.\n"
@ -107,10 +108,10 @@ class steam(Runner):
},
{
"option": "steam_native_runtime",
"label": "Disable Steam Runtime (use native libraries)",
"label": _("Disable Steam Runtime (use native libraries)"),
"type": "bool",
"default": False,
"help": (
"help": _(
"Launches Steam with STEAM_RUNTIME=0. "
"Make sure you disabled Lutris Runtime and "
"have the required libraries installed."
@ -118,10 +119,10 @@ class steam(Runner):
},
{
"option": "lsi_steam",
"label": "Start Steam with LSI",
"label": _("Start Steam with LSI"),
"type": "bool",
"default": False,
"help": (
"help": _(
"Launches steam with LSI patches enabled. "
"Make sure Lutris Runtime is disabled and "
"you have LSI installed. "
@ -131,9 +132,9 @@ class steam(Runner):
{
"option": "args",
"type": "string",
"label": "Arguments",
"label": _("Arguments"),
"advanced": True,
"help": ("Extra command line arguments used when " "launching Steam"),
"help": _("Extra command line arguments used when launching Steam"),
},
]
system_options_override = [{"option": "disable_runtime", "default": True}]
@ -149,7 +150,7 @@ class steam(Runner):
def __init__(self, config=None):
super(steam, self).__init__(config)
self.own_game_remove_method = "Remove game data (through Steam)"
self.own_game_remove_method = _("Remove game data (through Steam)")
self.no_game_remove_warning = True
self.original_steampid = None
@ -299,7 +300,7 @@ class steam(Runner):
def prelaunch(self):
def has_steam_shutdown(times=10):
for _ in range(times):
for __ in range(times):
time.sleep(1)
if not is_running():
return True

View file

@ -1,12 +1,15 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class stella(Runner):
description = "Atari 2600 emulator"
human_name = "Stella"
platforms = ["Atari 2600"]
description = _("Atari 2600 emulator")
human_name = _("Stella")
platforms = [_("Atari 2600")]
runnable_alone = True
runner_executable = "stella/bin/stella"
game_options = [
@ -16,8 +19,8 @@ class stella(Runner):
"type":
"file",
"label":
"ROM file",
"help": (
_("ROM file"),
"help": _(
"The game data, commonly called a ROM image.\n"
"Supported formats: A26/BIN/ROM. GZIP and ZIP compressed "
"ROMs are supported."

View file

@ -1,5 +1,6 @@
# Standard Library
import os
from gettext import gettext as _
# Lutris Modules
from lutris import settings
@ -9,15 +10,15 @@ from lutris.util.log import logger
class vice(Runner):
description = "Commodore Emulator"
human_name = "Vice"
description = _("Commodore Emulator")
human_name = _("Vice")
platforms = [
"Commodore 64",
"Commodore 128",
"Commodore VIC20",
"Commodore PET",
"Commodore Plus/4",
"Commodore CBM II",
_("Commodore 64"),
_("Commodore 128"),
_("Commodore VIC20"),
_("Commodore PET"),
_("Commodore Plus/4"),
_("Commodore CBM II"),
]
machine_choices = [
("C64", "c64"),
@ -34,8 +35,8 @@ class vice(Runner):
"type":
"file",
"label":
"ROM file",
"help": (
_("ROM file"),
"help": _(
"The game data, commonly called a ROM image.\n"
"Supported formats: X64, D64, G64, P64, D67, D71, D81, "
"D80, D82, D1M, D2M, D4M, T46, P00 and CRT."
@ -47,44 +48,44 @@ class vice(Runner):
{
"option": "joy",
"type": "bool",
"label": "Use joysticks",
"label": _("Use joysticks"),
"default": False
},
{
"option": "fullscreen",
"type": "bool",
"label": "Fullscreen",
"label": _("Fullscreen"),
"default": False,
},
{
"option": "double",
"type": "bool",
"label": "Scale up display by 2",
"label": _("Scale up display by 2"),
"default": True,
},
{
"option": "aspect_ratio",
"type": "bool",
"label": "Keep aspect ratio",
"label": _("Keep aspect ratio"),
"default": True,
},
{
"option": "drivesound",
"type": "bool",
"label": "Enable sound emulation of disk drives",
"label": _("Enable sound emulation of disk drives"),
"default": False,
},
{
"option": "renderer",
"type": "choice",
"label": "Graphics renderer",
"choices": [("OpenGL", "opengl"), ("Software", "software")],
"label": _("Graphics renderer"),
"choices": [("OpenGL", "opengl"), (_("Software"), "software")],
"default": "opengl",
},
{
"option": "machine",
"type": "choice",
"label": "Machine",
"label": _("Machine"),
"choices": machine_choices,
"default": "c64",
},

View file

@ -1,12 +1,15 @@
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class virtualjaguar(Runner):
description = "Atari Jaguar emulator"
human_name = "Virtual Jaguar"
platforms = ["Atari Jaguar"]
description = _("Atari Jaguar emulator")
human_name = _("Virtual Jaguar")
platforms = [_("Atari Jaguar")]
runnable_alone = True
runner_executable = "virtualjaguar/virtualjaguar"
game_options = [
@ -14,13 +17,13 @@ class virtualjaguar(Runner):
"option": "main_file",
"type": "file",
"default_path": "game_path",
"label": "ROM file",
"help": ("The game data, commonly called a ROM image.\n"
"Supported formats: J64 and JAG."),
"label": _("ROM file"),
"help": _("The game data, commonly called a ROM image.\n"
"Supported formats: J64 and JAG."),
}
]
runner_options = [{"option": "fullscreen", "type": "bool", "label": "Fullscreen", "default": "1"}]
runner_options = [{"option": "fullscreen", "type": "bool", "label": _("Fullscreen"), "default": "1"}]
def play(self):
rom = self.game_config.get("main_file") or ""

View file

@ -2,6 +2,7 @@
# Standard Library
import os
import string
from gettext import gettext as _
from urllib.parse import urlparse
# Lutris Modules
@ -14,36 +15,36 @@ DEFAULT_ICON = os.path.join(datapath.get(), "media/default_icon.png")
class web(Runner):
human_name = "Web"
description = "Runs web based games"
platforms = ["Web"]
human_name = _("Web")
description = _("Runs web based games")
platforms = [_("Web")]
game_options = [
{
"option": "main_file",
"type": "string",
"label": "Full URL or HTML file path",
"help": "The full address of the game's web page or path to a HTML file.",
"label": _("Full URL or HTML file path"),
"help": _("The full address of the game's web page or path to a HTML file."),
}
]
runner_options = [
{
"option": "fullscreen",
"label": "Open in fullscreen",
"label": _("Open in fullscreen"),
"type": "bool",
"default": False,
"help": "Launch the game in fullscreen.",
"help": _("Launch the game in fullscreen."),
},
{
"option": "maximize_window",
"label": "Open window maximized",
"label": _("Open window maximized"),
"type": "bool",
"default": False,
"help": "Maximizes the window when game starts.",
"help": _("Maximizes the window when game starts."),
},
{
"option": "window_size",
"label": "Window size",
"type": "choice_with_entry",
"type": _("choice_with_entry"),
"choices": [
"640x480",
"800x600",
@ -53,97 +54,97 @@ class web(Runner):
"1920x1080",
],
"default": "800x600",
"help": "The initial size of the game window when not opened.",
"help": _("The initial size of the game window when not opened."),
},
{
"option": "disable_resizing",
"label": "Disable window resizing (disables fullscreen and maximize)",
"label": _("Disable window resizing (disables fullscreen and maximize)"),
"type": "bool",
"default": False,
"help": "You can't resize this window.",
"help": _("You can't resize this window."),
},
{
"option": "frameless",
"label": "Borderless window",
"label": _("Borderless window"),
"type": "bool",
"default": False,
"help": "The window has no borders/frame.",
"help": _("The window has no borders/frame."),
},
{
"option": "disable_menu_bar",
"label": "Disable menu bar and default shortcuts",
"label": _("Disable menu bar and default shortcuts"),
"type": "bool",
"default": False,
"help": ("This also disables default keyboard shortcuts, "
"like copy/paste and fullscreen toggling."),
"help": _("This also disables default keyboard shortcuts, "
"like copy/paste and fullscreen toggling."),
},
{
"option": "disable_scrolling",
"label": "Disable page scrolling and hide scrollbars",
"label": _("Disable page scrolling and hide scrollbars"),
"type": "bool",
"default": False,
"help": "Disables scrolling on the page.",
"help": _("Disables scrolling on the page."),
},
{
"option": "hide_cursor",
"label": "Hide mouse cursor",
"label": _("Hide mouse cursor"),
"type": "bool",
"default": False,
"help": ("Prevents the mouse cursor from showing "
"when hovering above the window."),
"help": _("Prevents the mouse cursor from showing "
"when hovering above the window."),
},
{
"option":
"open_links",
"label":
"Open links in game window",
_("Open links in game window"),
"type":
"bool",
"default":
False,
"help": (
"help": _(
"Enable this option if you want clicked links to open inside the "
"game window. By default all links open in your default web browser."
),
},
{
"option": "remove_margin",
"label": "Remove default <body> margin & padding",
"label": _("Remove default <body> margin & padding"),
"type": "bool",
"default": False,
"help": ("Sets margin and padding to zero "
"on &lt;html&gt; and &lt;body&gt; elements."),
"help": _("Sets margin and padding to zero "
"on &lt;html&gt; and &lt;body&gt; elements."),
},
{
"option": "enable_flash",
"label": "Enable Adobe Flash Player",
"label": _("Enable Adobe Flash Player"),
"type": "bool",
"default": False,
"help": "Enable Adobe Flash Player.",
"help": _("Enable Adobe Flash Player."),
},
{
"option": "devtools",
"label": "Debug with Developer Tools",
"label": _("Debug with Developer Tools"),
"type": "bool",
"default": False,
"help": "Let's you debug the page.",
"help": _("Let's you debug the page."),
"advanced": True,
},
{
"option": "external_browser",
"label": "Open in web browser (old behavior)",
"label": _("Open in web browser (old behavior)"),
"type": "bool",
"default": False,
"help": "Launch the game in a web browser.",
"help": _("Launch the game in a web browser."),
},
{
"option":
"custom_browser_executable",
"label":
"Custom web browser executable",
_("Custom web browser executable"),
"type":
"file",
"help": (
"help": _(
"Select the executable of a browser on your system.\n"
"If left blank, Lutris will launch your default browser (xdg-open)."
),
@ -152,12 +153,12 @@ class web(Runner):
"option":
"custom_browser_args",
"label":
"Web browser arguments",
_("Web browser arguments"),
"type":
"string",
"default":
'"$GAME"',
"help": (
"help": _(
"Command line arguments to pass to the executable.\n"
"$GAME or $URL inserts the game url.\n\n"
'For Chrome/Chromium app mode use: --app="$GAME"'
@ -180,8 +181,8 @@ class web(Runner):
if not url:
return {
"error": "CUSTOM",
"text": ("The web address is empty, \n"
"verify the game's configuration."),
"text": _("The web address is empty, \n"
"verify the game's configuration."),
}
# check if it's an url or a file
@ -191,8 +192,8 @@ class web(Runner):
if not system.path_exists(url):
return {
"error": "CUSTOM",
"text": ("The file " + url + " does not exist, \n"
"verify the game's configuration."),
"text": _("The file %s does not exist, \n"
"verify the game's configuration.") % url,
}
url = "file://" + url

View file

@ -5,6 +5,7 @@
import os
import shlex
import shutil
from gettext import gettext as _
# Lutris Modules
from lutris import runtime
@ -35,22 +36,22 @@ MIN_SAFE_VERSION = "4.0" # Wine installers must run with at least this version
class wine(Runner):
description = "Runs Windows games"
human_name = "Wine"
platforms = ["Windows"]
description = _("Runs Windows games")
human_name = _("Wine")
platforms = [_("Windows")]
multiple_versions = True
game_options = [
{
"option": "exe",
"type": "file",
"label": "Executable",
"help": "The game's main EXE file",
"label": _("Executable"),
"help": _("The game's main EXE file"),
},
{
"option": "args",
"type": "string",
"label": "Arguments",
"help": "Windows command line arguments used when launching the game",
"label": _("Arguments"),
"help": _("Windows command line arguments used when launching the game"),
"validator": shlex.split
},
{
@ -59,8 +60,8 @@ class wine(Runner):
"type":
"directory_chooser",
"label":
"Working directory",
"help": (
_("Working directory"),
"help": _(
"The location where the game is run from.\n"
"By default, Lutris uses the directory of the "
"executable."
@ -72,8 +73,8 @@ class wine(Runner):
"type":
"directory_chooser",
"label":
"Wine prefix",
"help": (
_("Wine prefix"),
"help": _(
'The prefix (also named "bottle") used by Wine.\n'
"It's a directory containing a set of files and "
"folders making up a confined Windows environment."
@ -82,10 +83,10 @@ class wine(Runner):
{
"option": "arch",
"type": "choice",
"label": "Prefix architecture",
"choices": [("Auto", "auto"), ("32-bit", "win32"), ("64-bit", "win64")],
"label": _("Prefix architecture"),
"choices": [(_("Auto"), "auto"), (_("32-bit"), "win32"), (_("64-bit"), "win64")],
"default": "auto",
"help": "The architecture of the Windows environment",
"help": _("The architecture of the Windows environment"),
},
]
@ -117,12 +118,12 @@ class wine(Runner):
self.dll_overrides = {"winemenubuilder.exe": "d"}
def get_wine_version_choices():
version_choices = [("Custom (select executable below)", "custom")]
version_choices = [(_("Custom (select executable below)"), "custom")]
labels = {
"winehq-devel": "WineHQ devel ({})",
"winehq-staging": "WineHQ staging ({})",
"wine-development": "Wine Development ({})",
"system": "System ({})",
"winehq-devel": _("WineHQ devel ({})"),
"winehq-staging": _("WineHQ staging ({})"),
"wine-development": _("Wine Development ({})"),
"system": _("System ({})"),
}
versions = get_wine_versions()
for version in versions:
@ -136,7 +137,7 @@ class wine(Runner):
def dxvk_choices(manager_class):
version_choices = [
("Manual", "manual"),
(_("Manual"), "manual"),
(manager_class.DXVK_LATEST, manager_class.DXVK_LATEST),
]
for version in manager_class.DXVK_PAST_RELEASES:
@ -173,14 +174,14 @@ class wine(Runner):
"option":
"version",
"label":
"Wine version",
_("Wine version"),
"type":
"choice",
"choices":
get_wine_version_choices,
"default":
get_default_version(),
"help": (
"help": _(
"The version of Wine used to launch the game.\n"
"Using the last version is generally recommended, "
"but some games work better on older versions."
@ -188,25 +189,25 @@ class wine(Runner):
},
{
"option": "custom_wine_path",
"label": "Custom Wine executable",
"label": _("Custom Wine executable"),
"type": "file",
"advanced": True,
"help": ("The Wine executable to be used if you have "
'selected "Custom" as the Wine version.'),
"help": _("The Wine executable to be used if you have "
'selected "Custom" as the Wine version.'),
},
{
"option": "system_winetricks",
"label": "Use system winetricks",
"label": _("Use system winetricks"),
"type": "bool",
"default": False,
"advanced": True,
"help": "Switch on to use /usr/bin/winetricks for winetricks.",
"help": _("Switch on to use /usr/bin/winetricks for winetricks."),
},
{
"option":
"dxvk",
"label":
"Enable DXVK",
_("Enable DXVK"),
"type":
"extended_bool",
"callback":
@ -217,7 +218,7 @@ class wine(Runner):
True,
"active":
True,
"help": (
"help": _(
"Use DXVK to increase compatibility and performance "
"in Direct3D 11 and 10 applications by translating "
"their calls to Vulkan."
@ -225,7 +226,7 @@ class wine(Runner):
},
{
"option": "dxvk_version",
"label": "DXVK version",
"label": _("DXVK version"),
"advanced": True,
"type": "choice_with_entry",
"choices": get_dxvk_choices,
@ -233,16 +234,16 @@ class wine(Runner):
},
{
"option": "vkd3d",
"label": "Enable VKD3D",
"label": _("Enable VKD3D"),
"type": "bool",
"default": False,
"help": ("Enable DX12 support with VKD3D. This requires a compatible Wine build.")
"help": _("Enable DX12 support with VKD3D. This requires a compatible Wine build.")
},
{
"option":
"esync",
"label":
"Enable Esync",
_("Enable Esync"),
"type":
"extended_bool",
"callback":
@ -251,7 +252,7 @@ class wine(Runner):
True,
"active":
True,
"help": (
"help": _(
"Enable eventfd-based synchronization (esync). "
"This will increase performance in applications "
"that take advantage of multi-core processors."
@ -261,7 +262,7 @@ class wine(Runner):
"option":
"gallium_nine",
"label":
"Enable Gallium Nine",
_("Enable Gallium Nine"),
"type":
"bool",
"default":
@ -270,7 +271,7 @@ class wine(Runner):
nine.NineManager.is_available(),
"advanced":
True,
"help": (
"help": _(
"Gallium Nine allows to run Direct3D 9 applications faster.\n"
"Make sure your active graphics card supports Gallium Nine state "
"tracker before enabling this option.\n"
@ -279,43 +280,43 @@ class wine(Runner):
},
{
"option": "x360ce-path",
"label": "Path to the game's executable, for x360ce support",
"label": _("Path to the game's executable, for x360ce support"),
"type": "directory_chooser",
"help": "Locate the path for the game's executable for x360 support",
"help": _("Locate the path for the game's executable for x360 support"),
"advanced": True,
},
{
"option": "x360ce-dinput",
"label": "x360ce dinput 8 mode",
"label": _("x360ce dinput 8 mode"),
"type": "bool",
"default": False,
"help": "Configure x360ce with dinput8.dll, required for some games",
"help": _("Configure x360ce with dinput8.dll, required for some games"),
"advanced": True,
},
{
"option": "x360ce-xinput9",
"label": "x360ce xinput 9.1.0 mode",
"label": _("x360ce xinput 9.1.0 mode"),
"type": "bool",
"default": False,
"help": "Configure x360ce with xinput9_1_0.dll, required for some newer games",
"help": _("Configure x360ce with xinput9_1_0.dll, required for some newer games"),
"advanced": True,
},
{
"option": "dumbxinputemu",
"label": "Use Dumb xinput Emulator (experimental)",
"label": _("Use Dumb xinput Emulator (experimental)"),
"type": "bool",
"default": False,
"help": "Use the dlls from kozec/dumbxinputemu",
"help": _("Use the dlls from kozec/dumbxinputemu"),
"advanced": True,
},
{
"option": "xinput-arch",
"label": "Xinput architecture",
"label": _("Xinput architecture"),
"type": "choice",
"choices": [
("Same as wine prefix", ""),
("32 bit", "win32"),
("64 bit", "win64"),
(_("Same as wine prefix"), ""),
(_("32 bit"), "win32"),
(_("64 bit"), "win64"),
],
"default": "",
"advanced": True,
@ -324,12 +325,12 @@ class wine(Runner):
"option":
"Desktop",
"label":
"Windowed (virtual desktop)",
_("Windowed (virtual desktop)"),
"type":
"bool",
"default":
False,
"help": (
"help": _(
"Run the whole Windows desktop in a window.\n"
"Otherwise, run it fullscreen.\n"
"This corresponds to Wine's Virtual Desktop option."
@ -337,28 +338,28 @@ class wine(Runner):
},
{
"option": "WineDesktop",
"label": "Virtual desktop resolution",
"label": _("Virtual desktop resolution"),
"type": "choice_with_entry",
"choices": DISPLAY_MANAGER.get_resolutions,
"help": "The size of the virtual desktop in pixels.",
"help": _("The size of the virtual desktop in pixels."),
},
{
"option":
"MouseWarpOverride",
"label":
"Mouse Warp Override",
_("Mouse Warp Override"),
"type":
"choice",
"choices": [
("Enable", "enable"),
("Disable", "disable"),
("Force", "force"),
(_("Enable"), "enable"),
(_("Disable"), "disable"),
(_("Force"), "force"),
],
"default":
"enable",
"advanced":
True,
"help": (
"help": _(
"Override the default mouse pointer warping behavior\n"
"<b>Enable</b>: (Wine default) warp the pointer when the "
"mouse is exclusively acquired \n"
@ -370,7 +371,7 @@ class wine(Runner):
"option":
"OffscreenRenderingMode",
"label":
"Offscreen Rendering Mode",
_("Offscreen Rendering Mode"),
"type":
"choice",
"choices": [("FBO", "fbo"), ("BackBuffer", "backbuffer")],
@ -378,7 +379,7 @@ class wine(Runner):
"fbo",
"advanced":
True,
"help": (
"help": _(
"Select the offscreen rendering implementation.\n"
"<b>FBO</b>: (Wine default) Use framebuffer objects "
"for offscreen rendering \n"
@ -390,15 +391,15 @@ class wine(Runner):
"option":
"StrictDrawOrdering",
"label":
"Strict Draw Ordering",
_("Strict Draw Ordering"),
"type":
"choice",
"choices": [("Enabled", "enabled"), ("Disabled", "disabled")],
"choices": [(_("Enabled"), "enabled"), (_("Disabled"), "disabled")],
"default":
"disabled",
"advanced":
True,
"help": (
"help": _(
"This option ensures any pending drawing operations are "
"submitted to the driver, but at a significant performance "
'cost. Set to "enabled" to enable. This setting is deprecated '
@ -410,15 +411,15 @@ class wine(Runner):
"option":
"UseGLSL",
"label":
"Use GLSL",
_("Use GLSL"),
"type":
"choice",
"choices": [("Enabled", "enabled"), ("Disabled", "disabled")],
"choices": [(_("Enabled"), "enabled"), (_("Disabled"), "disabled")],
"default":
"enabled",
"advanced":
True,
"help": (
"help": _(
'When set to "disabled", this disables the use of GLSL for shaders. '
"In general disabling GLSL is not recommended, "
"only use this for debugging purposes."
@ -428,11 +429,11 @@ class wine(Runner):
"option":
"SampleCount",
"label":
"Anti-aliasing Sample Count",
_("Anti-aliasing Sample Count"),
"type":
"choice",
"choices": [
("Auto", "auto"),
(_("Auto"), "auto"),
("0", "0"),
("2", "2"),
("4", "4"),
@ -443,7 +444,7 @@ class wine(Runner):
"auto",
"advanced":
True,
"help": (
"help": _(
"Override swapchain sample count. It can be used to force enable multisampling "
"with applications that otherwise don't support it, like the similar control "
"panel setting available with some GPU drivers. This one might work in more "
@ -453,30 +454,30 @@ class wine(Runner):
},
{
"option": "UseXVidMode",
"label": "Use XVidMode to switch resolutions",
"label": _("Use XVidMode to switch resolutions"),
"type": "bool",
"default": False,
"advanced": True,
"help": ('Set this to "Y" to allow wine switch the resolution using XVidMode extension.'),
"help": _('Set this to "Y" to allow wine switch the resolution using XVidMode extension.'),
},
{
"option":
"Audio",
"label":
"Audio driver",
_("Audio driver"),
"type":
"choice",
"advanced":
True,
"choices": [
("Auto", "auto"),
(_("Auto"), "auto"),
("ALSA", "alsa"),
("PulseAudio", "pulse"),
("OSS", "oss"),
],
"default":
"auto",
"help": (
"help": _(
"Which audio backend to use.\n"
"By default, Wine automatically picks the right one "
"for your system."
@ -485,31 +486,31 @@ class wine(Runner):
{
"option": "overrides",
"type": "mapping",
"label": "DLL overrides",
"help": "Sets WINEDLLOVERRIDES when launching the game.",
"label": _("DLL overrides"),
"help": _("Sets WINEDLLOVERRIDES when launching the game."),
},
{
"option":
"show_debug",
"label":
"Output debugging info",
_("Output debugging info"),
"type":
"choice",
"choices": [
("Disabled", "-all"),
("Enabled", ""),
("Inherit from environment", "inherit"),
("Show FPS", "+fps"),
("Full (CAUTION: Will cause MASSIVE slowdown)", "+all"),
(_("Disabled"), "-all"),
(_("Enabled"), ""),
(_("Inherit from environment"), "inherit"),
(_("Show FPS"), "+fps"),
(_("Full (CAUTION: Will cause MASSIVE slowdown)"), "+all"),
],
"default":
"-all",
"help": ("Output debugging information in the game log "
"(might affect performance)"),
"help": _("Output debugging information in the game log "
"(might affect performance)"),
},
{
"option": "ShowCrashDialog",
"label": "Show crash dialogs",
"label": _("Show crash dialogs"),
"type": "bool",
"default": False,
"advanced": True,
@ -517,12 +518,12 @@ class wine(Runner):
{
"option": "autoconf_joypad",
"type": "bool",
"label": "Autoconfigure joypads",
"label": _("Autoconfigure joypads"),
"advanced": True,
"default": True,
"help":
("Automatically disables one of Wine's detected joypad "
"to avoid having 2 controllers detected"),
_("Automatically disables one of Wine's detected joypad "
"to avoid having 2 controllers detected"),
},
{
"option":
@ -530,12 +531,12 @@ class wine(Runner):
"type":
"bool",
"label":
"Create a sandbox for wine folders",
_("Create a sandbox for wine folders"),
"default":
True,
"advanced":
True,
"help": (
"help": _(
"Do not use $HOME for desktop integration folders.\n"
"By default, it use the directories in the confined "
"Windows environment."
@ -544,8 +545,8 @@ class wine(Runner):
{
"option": "sandbox_dir",
"type": "directory_chooser",
"label": "Sandbox directory",
"help": "Custom directory for desktop integration folders.",
"label": _("Sandbox directory"),
"help": _("Custom directory for desktop integration folders."),
"advanced": True,
},
]
@ -553,15 +554,15 @@ class wine(Runner):
@property
def context_menu_entries(self):
"""Return the contexual menu entries for wine"""
menu_entries = [("wineexec", "Run EXE inside wine prefix", self.run_wineexec)]
menu_entries = [("wineexec", _("Run EXE inside wine prefix"), self.run_wineexec)]
if "Proton" not in self.get_version():
menu_entries.append(("winecfg", "Wine configuration", self.run_winecfg))
menu_entries.append(("winecfg", _("Wine configuration"), self.run_winecfg))
menu_entries += [
("wineconsole", "Wine console", self.run_wineconsole),
("wine-regedit", "Wine registry", self.run_regedit),
("winekill", "Kill all wine processes", self.run_winekill),
("winetricks", "Winetricks", self.run_winetricks),
("winecpl", "Wine Control Panel", self.run_winecpl),
("wineconsole", _("Wine console"), self.run_wineconsole),
("wine-regedit", _("Wine registry"), self.run_regedit),
("winekill", _("Kill all wine processes"), self.run_winekill),
("winetricks", _("Winetricks"), self.run_winetricks),
("winecpl", _("Wine Control Panel"), self.run_winecpl),
]
return menu_entries
@ -717,7 +718,7 @@ class wine(Runner):
def run_wineexec(self, *args):
"""Ask the user for an arbitrary exe file to run in the game's prefix"""
dlg = FileDialog("Select an EXE or MSI file", default_path=self.game_path)
dlg = FileDialog(_("Select an EXE or MSI file"), default_path=self.game_path)
filename = dlg.filename
if not filename:
return

View file

@ -2,6 +2,7 @@
# Standard Library
import os
import time
from gettext import gettext as _
# Lutris Modules
from lutris import settings
@ -34,10 +35,10 @@ def kill():
# pylint: disable=C0103
class winesteam(wine.wine):
description = "Runs Steam for Windows games"
description = _("Runs Steam for Windows games")
multiple_versions = False
human_name = "Wine Steam"
platforms = ["Windows"]
human_name = _("Wine Steam")
platforms = [_("Windows")]
runnable_alone = True
depends_on = wine.wine
default_arch = WINE_DEFAULT_ARCH
@ -48,8 +49,8 @@ class winesteam(wine.wine):
"type":
"string",
"label":
"Application ID",
"help": (
_("Application ID"),
"help": _(
"The application ID can be retrieved from the game's "
"page at steampowered.com. Example: 235320 is the "
"app ID for <i>Original War</i> in: \n"
@ -59,8 +60,8 @@ class winesteam(wine.wine):
{
"option": "args",
"type": "string",
"label": "Arguments",
"help": "Command line arguments used when launching the game",
"label": _("Arguments"),
"help": _("Command line arguments used when launching the game"),
},
{
"option":
@ -68,8 +69,8 @@ class winesteam(wine.wine):
"type":
"directory_chooser",
"label":
"Prefix",
"help": (
_("Prefix"),
"help": _(
'The prefix (also named "bottle") used by Wine.\n'
"It's a directory containing a set of files and "
"folders making up a confined Windows environment."
@ -81,11 +82,11 @@ class winesteam(wine.wine):
"type":
"choice",
"label":
"Prefix architecture",
"choices": [("Auto", "auto"), ("32-bit", "win32"), ("64-bit", "win64")],
_("Prefix architecture"),
"choices": [(_("Auto"), "auto"), (_("32-bit"), "win32"), (_("64-bit"), "win64")],
"default":
"auto",
"help": (
"help": _(
"The architecture of the Windows environment.\n"
"32-bit is recommended unless running "
"a 64-bit only game."
@ -99,32 +100,32 @@ class winesteam(wine.wine):
"default":
False,
"label":
"Do not launch game, only open Steam",
"help": (
_("Do not launch game, only open Steam"),
"help": _(
"Opens Steam with the current settings without running the game, "
"useful if a game has several launch options."
),
},
{
"option": "run_without_steam",
"label": "DRM free mode (Do not launch Steam)",
"label": _("DRM free mode (Do not launch Steam)"),
"type": "bool",
"default": False,
"advanced": True,
"help": "Run the game directly without Steam, requires the game binary path to be set",
"help": _("Run the game directly without Steam, requires the game binary path to be set"),
},
{
"option": "steamless_binary",
"type": "file",
"label": "Game binary path",
"label": _("Game binary path"),
"advanced": True,
"help": "Path to the game executable (Required by DRM free mode)",
"help": _("Path to the game executable (Required by DRM free mode)"),
},
]
def __init__(self, config=None):
super(winesteam, self).__init__(config)
self.own_game_remove_method = "Remove game data (through Wine Steam)"
self.own_game_remove_method = _("Remove game data (through Wine Steam)")
self.no_game_remove_warning = True
winesteam_options = [
{
@ -133,8 +134,8 @@ class winesteam(wine.wine):
"type":
"directory_chooser",
"label":
"Custom Steam location",
"help": (
_("Custom Steam location"),
"help": _(
"Choose a folder containing Steam.exe\n"
"By default, Lutris will look for a Windows Steam "
"installation into ~/.wine or will install it in "
@ -143,33 +144,33 @@ class winesteam(wine.wine):
},
{
"option": "quit_steam_on_exit",
"label": "Stop Steam after game exits",
"label": _("Stop Steam after game exits"),
"type": "bool",
"default": True,
"help": "Shut down Steam after the game has quit.",
"help": _("Shut down Steam after the game has quit."),
},
{
"option": "args",
"type": "string",
"label": "Arguments",
"label": _("Arguments"),
"advanced": True,
"help": ("Extra command line arguments used when "
"launching Steam"),
"help": _("Extra command line arguments used when "
"launching Steam"),
},
{
"option": "default_win32_prefix",
"type": "directory_chooser",
"label": "Default Wine prefix (32bit)",
"label": _("Default Wine prefix (32bit)"),
"default": os.path.join(settings.RUNNER_DIR, "winesteam/prefix"),
"help": "Default prefix location for Steam (32 bit)",
"help": _("Default prefix location for Steam (32 bit)"),
"advanced": True,
},
{
"option": "default_win64_prefix",
"type": "directory_chooser",
"label": "Default Wine prefix (64bit)",
"label": _("Default Wine prefix (64bit)"),
"default": os.path.join(settings.RUNNER_DIR, "winesteam/prefix64"),
"help": "Default prefix location for Steam (64 bit)",
"help": _("Default prefix location for Steam (64 bit)"),
"advanced": True,
},
]
@ -177,7 +178,7 @@ class winesteam(wine.wine):
self.runner_options.insert(0, option)
def __repr__(self):
return "Winesteam runner (%s)" % self.config
return _("Winesteam runner (%s)") % self.config
@property
def appid(self):
@ -407,7 +408,7 @@ class winesteam(wine.wine):
an error if it cannot be killed"""
def has_steam_shutdown(times=10):
for _ in range(1, times + 1):
for __ in range(1, times + 1):
time.sleep(1)
if not is_running():
return True

View file

@ -1,6 +1,7 @@
# Standard Library
import filecmp
import os
from gettext import gettext as _
from shutil import copyfile
# Lutris Modules
@ -10,30 +11,30 @@ from lutris.util.log import logger
class yuzu(Runner):
human_name = "Yuzu"
platforms = ["Nintendo Switch"]
description = "Nintendo Switch emulator"
human_name = _("Yuzu")
platforms = [_("Nintendo Switch")]
description = _("Nintendo Switch emulator")
runnable_alone = True
runner_executable = "yuzu/yuzu"
game_options = [
{
"option": "main_file",
"type": "file",
"label": "ROM file",
"help": "The game data, commonly called a ROM image.",
"label": _("ROM file"),
"help": _("The game data, commonly called a ROM image."),
}
]
runner_options = [
{
"option": "prod_keys",
"label": "Ecryption keys",
"label": _("Ecryption keys"),
"type": "file",
"help": "File containing the encryption keys.",
"help": _("File containing the encryption keys."),
}, {
"option": "title_keys",
"label": "Title keys",
"label": _("Title keys"),
"type": "file",
"help": "File containing the title keys.",
"help": _("File containing the title keys."),
}
]

View file

@ -1,5 +1,6 @@
# Standard Library
import os
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
@ -10,84 +11,84 @@ from lutris.util.strings import split_arguments
class zdoom(Runner):
# http://zdoom.org/wiki/Command_line_parameters
description = "ZDoom DOOM Game Engine"
human_name = "ZDoom"
platforms = ["Linux"]
description = _("ZDoom DOOM Game Engine")
human_name = _("ZDoom")
platforms = [_("Linux")]
runner_executable = "zdoom/zdoom"
game_options = [
{
"option": "main_file",
"type": "file",
"label": "WAD file",
"help": "The game data, commonly called a WAD file.",
"label": _("WAD file"),
"help": _("The game data, commonly called a WAD file."),
},
{
"option": "args",
"type": "string",
"label": "Arguments",
"help": "Command line arguments used when launching the game.",
"label": _("Arguments"),
"help": _("Command line arguments used when launching the game."),
},
{
"option": "files",
"type": "multiple",
"label": "PWAD files",
"help": ("Used to load one or more PWAD files which generally contain "
"user-created levels."),
"label": _("PWAD files"),
"help": _("Used to load one or more PWAD files which generally contain "
"user-created levels."),
},
{
"option": "warp",
"type": "string",
"label": "Warp to map",
"help": "Starts the game on the given map.",
"label": _("Warp to map"),
"help": _("Starts the game on the given map."),
},
{
"option": "savedir",
"type": "directory_chooser",
"label": "Save path",
"help": ("User-specified path where save files should be located."),
"label": _("Save path"),
"help": _("User-specified path where save files should be located."),
},
]
runner_options = [
{
"option": "2",
"label": "Pixel Doubling",
"label": _("Pixel Doubling"),
"type": "bool",
"default": False
},
{
"option": "4",
"label": "Pixel Quadrupling",
"label": _("Pixel Quadrupling"),
"type": "bool",
"default": False
},
{
"option": "nostartup",
"label": "Disable Startup Screens",
"label": _("Disable Startup Screens"),
"type": "bool",
"default": False,
},
{
"option": "skill",
"label": "Skill",
"label": _("Skill"),
"type": "choice",
"default": "",
"choices": {
("None", ""),
("I'm Too Young To Die (1)", "1"),
("Hey, Not Too Rough (2)", "2"),
("Hurt Me Plenty (3)", "3"),
("Ultra-Violence (4)", "4"),
("Nightmare! (5)", "5"),
(_("None"), ""),
(_("I'm Too Young To Die (1)"), "1"),
(_("Hey, Not Too Rough (2)"), "2"),
(_("Hurt Me Plenty (3)"), "3"),
(_("Ultra-Violence (4)"), "4"),
(_("Nightmare! (5)"), "5"),
},
},
{
"option":
"config",
"label":
"Config file",
_("Config file"),
"type":
"file",
"help": (
"help": _(
"Used to load a user-created configuration file. If specified, "
"the file must contain the wad directory list or launch will fail."
),

View file

@ -3,6 +3,7 @@
import json
import os
import time
from gettext import gettext as _
from urllib.parse import parse_qsl, urlencode, urlparse
# Lutris Modules
@ -16,7 +17,7 @@ from lutris.util.http import HTTPError, Request
from lutris.util.log import logger
from lutris.util.resources import download_media
NAME = "GOG"
NAME = _("GOG")
ICON = "gog"
ONLINE = True

View file

@ -2,6 +2,7 @@
# Standard Library
import json
import os
from gettext import gettext as _
from urllib.parse import urlparse
# Lutris Modules
@ -14,7 +15,7 @@ from lutris.util.http import HTTPError, Request
from lutris.util.log import logger
from lutris.util.resources import download_media
NAME = "Humble Bundle"
NAME = _("Humble Bundle")
ICON = "humblebundle"
ONLINE = True

View file

@ -3,6 +3,7 @@
import os
import re
from configparser import ConfigParser
from gettext import gettext as _
# Lutris Modules
from lutris import pga
@ -11,7 +12,7 @@ from lutris.util import system
from lutris.util.log import logger
from lutris.util.strings import slugify
NAME = "ScummVM"
NAME = _("ScummVM")
ICON = "scummvm"
ONLINE = False
INSTALLER_SLUG = "system-scummvm"

View file

@ -2,6 +2,7 @@
# Standard Library
import os
import re
from gettext import gettext as _
# Lutris Modules
from lutris import pga
@ -10,7 +11,7 @@ from lutris.services.service_game import ServiceGame
from lutris.util.steam.appmanifest import AppManifest, get_appmanifests
from lutris.util.steam.config import get_steamapps_paths
NAME = "Steam"
NAME = _("Steam")
ICON = "steam"
ONLINE = False

View file

@ -1,8 +1,10 @@
"""Steam for Windows service"""
from gettext import gettext as _
# Lutris Modules
from lutris.services.steam import SteamSyncer
NAME = "Steam for Windows"
NAME = _("Steam for Windows")
ICON = "winesteam"
ONLINE = False

View file

@ -5,6 +5,7 @@ import os
import re
import shlex
import subprocess
from gettext import gettext as _
# Third Party Libraries
from gi.repository import Gio
@ -17,7 +18,7 @@ from lutris.util import system
from lutris.util.log import logger
from lutris.util.strings import slugify
NAME = "Desktop games"
NAME = _("Desktop games")
ICON = "linux"
ONLINE = False

View file

@ -1,6 +1,7 @@
"""Internal settings."""
# Standard Library
import os
from gettext import gettext as _
# Third Party Libraries
from gi.repository import GLib
@ -9,10 +10,10 @@ from gi.repository import GLib
from lutris import __version__
from lutris.util.settings import SettingsIO
PROJECT = "Lutris"
PROJECT = _("Lutris")
VERSION = __version__
COPYRIGHT = "(c) 2010-2020 Lutris Gaming Platform"
AUTHORS = ["The Lutris team"]
COPYRIGHT = _("(c) 2010-2020 Lutris Gaming Platform")
AUTHORS = [_("The Lutris team")]
# Paths
CONFIG_DIR = os.path.join(GLib.get_user_config_dir(), "lutris")

View file

@ -2,6 +2,7 @@
# Standard Library
# pylint: disable=no-member
import os
from gettext import gettext as _
# Lutris Modules
from lutris import pga, settings
@ -80,12 +81,12 @@ def check_driver():
if settings.read_setting(setting) != "True":
DontShowAgainDialog(
setting,
"Your Nvidia driver is outdated.",
secondary_message="You are currently running driver %s which does not "
"fully support all features for Vulkan and DXVK games.\n"
"Please upgrade your driver as described in our "
"<a href='https://github.com/lutris/lutris/wiki/Installing-drivers'>"
"installation guide</a>" % driver_info["nvrm"]["version"],
_("Your Nvidia driver is outdated."),
secondary_message=_("You are currently running driver %s which does not "
"fully support all features for Vulkan and DXVK games.\n"
"Please upgrade your driver as described in our "
"<a href='https://github.com/lutris/lutris/wiki/Installing-drivers'>"
"installation guide</a>") % driver_info["nvrm"]["version"],
)
@ -109,13 +110,13 @@ def check_libs(all_components=False):
if settings.read_setting(setting) != "True":
DontShowAgainDialog(
setting,
"Missing vulkan libraries",
secondary_message="Lutris was unable to detect Vulkan support for "
"the %s architecture.\n"
"This will prevent many games and programs from working.\n"
"To install it, please use the following guide: "
"<a href='https://github.com/lutris/lutris/wiki/Installing-drivers'>"
"Installing Graphics Drivers</a>" % " and ".join(missing_vulkan_libs),
_("Missing vulkan libraries"),
secondary_message=_("Lutris was unable to detect Vulkan support for "
"the %s architecture.\n"
"This will prevent many games and programs from working.\n"
"To install it, please use the following guide: "
"<a href='https://github.com/lutris/lutris/wiki/Installing-drivers'>"
"Installing Graphics Drivers</a>") % _(" and ").join(missing_vulkan_libs),
)
@ -132,14 +133,14 @@ def check_donate():
if settings.read_setting(setting) != "True":
DontShowAgainDialog(
setting,
"Please support Lutris!",
secondary_message="Lutris is entirely funded by its community and will "
"remain an independent gaming platform.\n"
"For Lutris to survive and grow, the project needs your help.\n"
"Please consider making a donation if you can. This will greatly help "
"cover the costs of hosting the project and fund new features "
"like cloud saves or a full-screen interface for the TV!\n"
"<a href='https://lutris.net/donate'>SUPPORT US! https://lutris.net/donate</a>",
_("Please support Lutris!"),
secondary_message=_("Lutris is entirely funded by its community and will "
"remain an independent gaming platform.\n"
"For Lutris to survive and grow, the project needs your help.\n"
"Please consider making a donation if you can. This will greatly help "
"cover the costs of hosting the project and fund new features "
"like cloud saves or a full-screen interface for the TV!\n"
"<a href='https://lutris.net/donate'>SUPPORT US! https://lutris.net/donate</a>"),
)

View file

@ -4,6 +4,7 @@ import glob
# pylint: disable=invalid-name
import os
from collections import OrderedDict
from gettext import gettext as _
# Lutris Modules
from lutris import runners
@ -28,7 +29,7 @@ def get_resolution_choices():
"""
resolutions = DISPLAY_MANAGER.get_resolutions()
resolution_choices = list(zip(resolutions, resolutions))
resolution_choices.insert(0, ("Keep current", "off"))
resolution_choices.insert(0, (_("Keep current"), "off"))
return resolution_choices
@ -36,8 +37,8 @@ def get_output_choices():
"""Return list of outputs for drop-downs"""
displays = DISPLAY_MANAGER.get_display_names()
output_choices = list(zip(displays, displays))
output_choices.insert(0, ("Off", "off"))
output_choices.insert(1, ("Primary", "primary"))
output_choices.insert(0, (_("Off"), "off"))
output_choices.insert(1, (_("Primary"), "primary"))
return output_choices
@ -45,7 +46,7 @@ def get_output_list():
"""Return a list of output with their index.
This is used to indicate to SDL 1.2 which monitor to use.
"""
choices = [("Off", "off")]
choices = [(_("Off"), "off")]
displays = DISPLAY_MANAGER.get_display_names()
for index, output in enumerate(displays):
# Display name can't be used because they might not be in the right order
@ -56,7 +57,7 @@ def get_output_list():
def get_optirun_choices():
"""Return menu choices (label, value) for Optimus"""
choices = [("Off", "off")]
choices = [(_("Off"), "off")]
if system.find_executable("primusrun"):
choices.append(("primusrun", "primusrun"))
if system.find_executable("optirun"):
@ -68,7 +69,7 @@ def get_optirun_choices():
def get_vk_icd_choices():
"""Return available Vulkan ICD loaders"""
choices = [("Auto", "")]
choices = [(_("Auto"), "")]
# Add loaders
for data_dir in VULKAN_DATA_DIRS:
@ -85,10 +86,10 @@ system_options = [ # pylint: disable=invalid-name
{
"option": "game_path",
"type": "directory_chooser",
"label": "Default installation folder",
"label": _("Default installation folder"),
"default": os.path.expanduser("~/Games"),
"scope": ["runner", "system"],
"help": "The default folder where you install your games."
"help": _("The default folder where you install your games.")
},
{
"option":
@ -96,20 +97,20 @@ system_options = [ # pylint: disable=invalid-name
"type":
"bool",
"label":
"Disable Lutris Runtime",
_("Disable Lutris Runtime"),
"default":
False,
"help": ("The Lutris Runtime loads some libraries before running the "
"game. Which can cause some incompatibilities in some cases. "
"Check this option to disable it."),
"help": _("The Lutris Runtime loads some libraries before running the "
"game. Which can cause some incompatibilities in some cases. "
"Check this option to disable it."),
},
{
"option": "prefer_system_libs",
"type": "bool",
"label": "Prefer system libraries",
"label": _("Prefer system libraries"),
"default": True,
"help": ("When the runtime is enabled, prioritize the system libraries"
" over the provided ones."),
"help": _("When the runtime is enabled, prioritize the system libraries"
" over the provided ones."),
},
{
"option":
@ -117,20 +118,20 @@ system_options = [ # pylint: disable=invalid-name
"type":
"bool",
"label":
"Restore resolution on game exit",
_("Restore resolution on game exit"),
"default":
False,
"help": ("Some games don't restore your screen resolution when \n"
"closed or when they crash. This is when this option comes \n"
"into play to save your bacon."),
"help": _("Some games don't restore your screen resolution when \n"
"closed or when they crash. This is when this option comes \n"
"into play to save your bacon."),
},
{
"option": "single_cpu",
"type": "bool",
"label": "Restrict to single core",
"label": _("Restrict to single core"),
"advanced": True,
"default": False,
"help": "Restrict the game to a single CPU core.",
"help": _("Restrict the game to a single CPU core."),
},
{
"option":
@ -140,47 +141,47 @@ system_options = [ # pylint: disable=invalid-name
"default":
False,
"label":
"Restore gamma on game exit",
_("Restore gamma on game exit"),
"advanced":
True,
"help": ("Some games don't correctly restores gamma on exit, making "
"your display too bright. Select this option to correct it."),
"help": _("Some games don't correctly restores gamma on exit, making "
"your display too bright. Select this option to correct it."),
},
{
"option": "disable_compositor",
"label": "Disable desktop effects",
"label": _("Disable desktop effects"),
"type": "bool",
"default": False,
"advanced": True,
"help": ("Disable desktop effects while game is running, "
"reducing stuttering and increasing performance"),
"help": _("Disable desktop effects while game is running, "
"reducing stuttering and increasing performance"),
},
{
"option": "reset_pulse",
"type": "bool",
"label": "Reset PulseAudio",
"label": _("Reset PulseAudio"),
"default": False,
"advanced": True,
"condition": system.find_executable("pulseaudio"),
"help": "Restart PulseAudio before launching the game.",
"help": _("Restart PulseAudio before launching the game."),
},
{
"option": "pulse_latency",
"type": "bool",
"label": "Reduce PulseAudio latency",
"label": _("Reduce PulseAudio latency"),
"default": False,
"advanced": True,
"condition": system.find_executable("pulseaudio"),
"help": ("Set the environment variable PULSE_LATENCY_MSEC=60 "
"to improve audio quality on some games"),
"help": _("Set the environment variable PULSE_LATENCY_MSEC=60 "
"to improve audio quality on some games"),
},
{
"option": "use_us_layout",
"type": "bool",
"label": "Switch to US keyboard layout",
"label": _("Switch to US keyboard layout"),
"default": False,
"advanced": True,
"help": "Switch to US keyboard qwerty layout while game is running",
"help": _("Switch to US keyboard qwerty layout while game is running"),
},
{
"option":
@ -192,15 +193,15 @@ system_options = [ # pylint: disable=invalid-name
"choices":
get_optirun_choices,
"label":
"Optimus launcher (NVIDIA Optimus laptops)",
_("Optimus launcher (NVIDIA Optimus laptops)"),
"advanced":
True,
"help": ("If you have installed the primus or bumblebee packages, "
"select what launcher will run the game with the command, "
"activating your NVIDIA graphic chip for high 3D "
"performance. primusrun normally has better performance, but"
"optirun/virtualgl works better for more games."
"Primus VK provide vulkan support under bumblebee."),
"help": _("If you have installed the primus or bumblebee packages, "
"select what launcher will run the game with the command, "
"activating your NVIDIA graphic chip for high 3D "
"performance. primusrun normally has better performance, but"
"optirun/virtualgl works better for more games."
"Primus VK provide vulkan support under bumblebee."),
},
{
"option":
@ -212,38 +213,38 @@ system_options = [ # pylint: disable=invalid-name
"choices":
get_vk_icd_choices,
"label":
"Vulkan ICD loader",
_("Vulkan ICD loader"),
"advanced":
True,
"help": ("The ICD loader is a library that is placed between a Vulkan "
"application and any number of Vulkan drivers, in order to support "
"multiple drivers and the instance-level functionality that works "
"across these drivers.")
"help": _("The ICD loader is a library that is placed between a Vulkan "
"application and any number of Vulkan drivers, in order to support "
"multiple drivers and the instance-level functionality that works "
"across these drivers.")
},
{
"option": "fps_limit",
"type": "string",
"size": "small",
"label": "Fps limit",
"label": _("Fps limit"),
"advanced": True,
"condition": bool(system.find_executable("strangle")),
"help": "Limit the game's fps to desired number",
"help": _("Limit the game's fps to desired number"),
},
{
"option": "aco",
"type": "bool",
"label": "Enable ACO shader compiler",
"label": _("Enable ACO shader compiler"),
"condition": system.LINUX_SYSTEM.is_feature_supported("ACO"),
"help": ("Enable ACO shader compiler, improving performance in a lot of games. "
"Requires Mesa 19.3 or later.")
"help": _("Enable ACO shader compiler, improving performance in a lot of games. "
"Requires Mesa 19.3 or later.")
},
{
"option": "gamemode",
"type": "bool",
"default": system.LINUX_SYSTEM.gamemode_available,
"condition": system.LINUX_SYSTEM.gamemode_available,
"label": "Enable Feral gamemode",
"help": "Request a set of optimisations be temporarily applied to the host OS",
"label": _("Enable Feral gamemode"),
"help": _("Request a set of optimisations be temporarily applied to the host OS"),
},
{
"option":
@ -255,12 +256,12 @@ system_options = [ # pylint: disable=invalid-name
"condition":
True,
"label":
"Enable NVIDIA Prime render offload",
"help": ("If you have the latest NVIDIA driver and the properly patched xorg-server (see "
"https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/primerenderoffload.html"
"), you can launch a game on your NVIDIA GPU by toggling this switch. This will apply "
"__NV_PRIME_RENDER_OFFLOAD=1 and "
"__GLX_VENDOR_LIBRARY_NAME=nvidia environment variables.")
_("Enable NVIDIA Prime render offload"),
"help": _("If you have the latest NVIDIA driver and the properly patched xorg-server (see "
"https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/primerenderoffload.html"
"), you can launch a game on your NVIDIA GPU by toggling this switch. This will apply "
"__NV_PRIME_RENDER_OFFLOAD=1 and "
"__GLX_VENDOR_LIBRARY_NAME=nvidia environment variables.")
},
{
"option":
@ -272,13 +273,13 @@ system_options = [ # pylint: disable=invalid-name
"condition":
USE_DRI_PRIME,
"label":
"Use discrete graphics",
_("Use discrete graphics"),
"advanced":
True,
"help": ("If you have open source graphic drivers (Mesa), selecting this "
"option will run the game with the 'DRI_PRIME=1' environment variable, "
"activating your discrete graphic chip for high 3D "
"performance."),
"help": _("If you have open source graphic drivers (Mesa), selecting this "
"option will run the game with the 'DRI_PRIME=1' environment variable, "
"activating your discrete graphic chip for high 3D "
"performance."),
},
{
"option":
@ -286,16 +287,16 @@ system_options = [ # pylint: disable=invalid-name
"type":
"choice",
"label":
"SDL 1.2 Fullscreen Monitor",
_("SDL 1.2 Fullscreen Monitor"),
"choices":
get_output_list,
"default":
"off",
"advanced":
True,
"help": ("Hint SDL 1.2 games to use a specific monitor when going "
"fullscreen by setting the SDL_VIDEO_FULLSCREEN "
"environment variable"),
"help": _("Hint SDL 1.2 games to use a specific monitor when going "
"fullscreen by setting the SDL_VIDEO_FULLSCREEN "
"environment variable"),
},
{
"option":
@ -303,39 +304,39 @@ system_options = [ # pylint: disable=invalid-name
"type":
"choice",
"label":
"Turn off monitors except",
_("Turn off monitors except"),
"choices":
get_output_choices,
"default":
"off",
"advanced":
True,
"help": ("Only keep the selected screen active while the game is "
"running. \n"
"This is useful if you have a dual-screen setup, and are \n"
"having display issues when running a game in fullscreen."),
"help": _("Only keep the selected screen active while the game is "
"running. \n"
"This is useful if you have a dual-screen setup, and are \n"
"having display issues when running a game in fullscreen."),
},
{
"option": "resolution",
"type": "choice",
"label": "Switch resolution to",
"label": _("Switch resolution to"),
"choices": get_resolution_choices,
"default": "off",
"help": "Switch to this screen resolution while the game is running.",
"help": _("Switch to this screen resolution while the game is running."),
},
{
"option": "terminal",
"label": "Run in a terminal",
"label": _("Run in a terminal"),
"type": "bool",
"default": False,
"advanced": True,
"help": "Run the game in a new terminal window.",
"help": _("Run the game in a new terminal window."),
},
{
"option":
"terminal_app",
"label":
"Terminal application",
_("Terminal application"),
"type":
"choice_with_entry",
"choices":
@ -344,53 +345,53 @@ system_options = [ # pylint: disable=invalid-name
system.get_default_terminal(),
"advanced":
True,
"help": ("The terminal emulator to be run with the previous option."
"Choose from the list of detected terminal apps or enter "
"the terminal's command or path."
"Note: Not all terminal emulators are guaranteed to work."),
"help": _("The terminal emulator to be run with the previous option."
"Choose from the list of detected terminal apps or enter "
"the terminal's command or path."
"Note: Not all terminal emulators are guaranteed to work."),
},
{
"option": "env",
"type": "mapping",
"label": "Environment variables",
"help": "Environment variables loaded at run time",
"label": _("Environment variables"),
"help": _("Environment variables loaded at run time"),
},
{
"option": "prefix_command",
"type": "string",
"label": "Command prefix",
"label": _("Command prefix"),
"advanced": True,
"help": ("Command line instructions to add in front of the game's "
"execution command."),
"help": _("Command line instructions to add in front of the game's "
"execution command."),
},
{
"option": "manual_command",
"type": "file",
"label": "Manual script",
"label": _("Manual script"),
"advanced": True,
"help": ("Script to execute from the game's contextual menu"),
"help": _("Script to execute from the game's contextual menu"),
},
{
"option": "prelaunch_command",
"type": "file",
"label": "Pre-launch script",
"label": _("Pre-launch script"),
"advanced": True,
"help": "Script to execute before the game starts",
"help": _("Script to execute before the game starts"),
},
{
"option": "prelaunch_wait",
"type": "bool",
"label": "Wait for pre-launch script completion",
"label": _("Wait for pre-launch script completion"),
"advanced": True,
"default": False,
"help": "Run the game only once the pre-launch script has exited",
"help": _("Run the game only once the pre-launch script has exited"),
},
{
"option": "postexit_command",
"type": "file",
"label": "Post-exit script",
"label": _("Post-exit script"),
"advanced": True,
"help": "Script to execute when the game exits",
"help": _("Script to execute when the game exits"),
},
{
"option":
@ -398,13 +399,13 @@ system_options = [ # pylint: disable=invalid-name
"type":
"string",
"label":
"Include processes",
_("Include processes"),
"advanced":
True,
"help": ("What processes to include in process monitoring. "
"This is to override the built-in exclude list.\n"
"Space-separated list, processes including spaces "
"can be wrapped in quotation marks."),
"help": _("What processes to include in process monitoring. "
"This is to override the built-in exclude list.\n"
"Space-separated list, processes including spaces "
"can be wrapped in quotation marks."),
},
{
"option":
@ -412,14 +413,14 @@ system_options = [ # pylint: disable=invalid-name
"type":
"string",
"label":
"Exclude processes",
_("Exclude processes"),
"advanced":
True,
"help": ("What processes to exclude in process monitoring. "
"For example background processes that stick around "
"after the game has been closed.\n"
"Space-separated list, processes including spaces "
"can be wrapped in quotation marks."),
"help": _("What processes to exclude in process monitoring. "
"For example background processes that stick around "
"after the game has been closed.\n"
"Space-separated list, processes including spaces "
"can be wrapped in quotation marks."),
},
{
"option":
@ -427,12 +428,12 @@ system_options = [ # pylint: disable=invalid-name
"type":
"string",
"label":
"Killswitch file",
_("Killswitch file"),
"advanced":
True,
"help": ("Path to a file which will stop the game when deleted \n"
"(usually /dev/input/js0 to stop the game on joystick "
"unplugging)"),
"help": _("Path to a file which will stop the game when deleted \n"
"(usually /dev/input/js0 to stop the game on joystick "
"unplugging)"),
},
{
"option":
@ -440,46 +441,46 @@ system_options = [ # pylint: disable=invalid-name
"type":
"string",
"label":
"SDL2 gamepad mapping",
_("SDL2 gamepad mapping"),
"advanced":
True,
"help": ("SDL_GAMECONTROLLERCONFIG mapping string or path to a custom "
"gamecontrollerdb.txt file containing mappings."),
"help": _("SDL_GAMECONTROLLERCONFIG mapping string or path to a custom "
"gamecontrollerdb.txt file containing mappings."),
},
{
"option":
"xephyr",
"label":
"Use Xephyr",
_("Use Xephyr"),
"type":
"choice",
"choices": (
("Off", "off"),
("8BPP (256 colors)", "8bpp"),
("16BPP (65536 colors)", "16bpp"),
("24BPP (16M colors)", "24bpp"),
(_("Off"), "off"),
(_("8BPP (256 colors)"), "8bpp"),
(_("16BPP (65536 colors)"), "16bpp"),
(_("24BPP (16M colors)"), "24bpp"),
),
"default":
"off",
"advanced":
True,
"help":
"Run program in Xephyr to support 8BPP and 16BPP color modes",
_("Run program in Xephyr to support 8BPP and 16BPP color modes"),
},
{
"option": "xephyr_resolution",
"type": "string",
"label": "Xephyr resolution",
"label": _("Xephyr resolution"),
"advanced": True,
"help": "Screen resolution of the Xephyr server",
"help": _("Screen resolution of the Xephyr server"),
},
{
"option": "xephyr_fullscreen",
"type": "bool",
"label": "Xephyr Fullscreen",
"label": _("Xephyr Fullscreen"),
"default": True,
"advanced": True,
"help": "Open Xephyr in fullscreen (at the desktop resolution)",
"help": _("Open Xephyr in fullscreen (at the desktop resolution)"),
},
]
@ -487,39 +488,39 @@ discord_options = [
{
"option": "discord_rpc_enabled",
"type": "bool",
"label": "Discord Rich Presence",
"label": _("Discord Rich Presence"),
"default": False,
"condition": discord_presence.available,
"help": "Enable status to Discord of this game being played",
"help": _("Enable status to Discord of this game being played"),
},
{
"option": "discord_show_runner",
"type": "bool",
"label": "Discord Show Runner",
"label": _("Discord Show Runner"),
"default": True,
"condition": discord_presence.available,
"help": "Embed the runner name in the Discord status",
"help": _("Embed the runner name in the Discord status"),
},
{
"option": "discord_custom_game_name",
"type": "string",
"label": "Discord Custom Game Name",
"label": _("Discord Custom Game Name"),
"condition": discord_presence.available,
"help": "Custom name to override with and pass to Discord",
"help": _("Custom name to override with and pass to Discord"),
},
{
"option": "discord_custom_runner_name",
"type": "string",
"label": "Discord Custom Runner Name",
"label": _("Discord Custom Runner Name"),
"condition": discord_presence.available,
"help": "Custom runner name to override with and pass to Discord",
"help": _("Custom runner name to override with and pass to Discord"),
},
{
"option": "discord_client_id",
"type": "string",
"label": "Discord Client ID",
"label": _("Discord Client ID"),
"condition": discord_presence.available,
"help": "Custom Discord Client ID for passing status",
"help": _("Custom Discord Client ID for passing status"),
},
]

View file

@ -10,6 +10,7 @@ import subprocess
import sys
from collections import Counter, defaultdict
from lutris.util import system
# Lutris Modules
from lutris.util import system
from lutris.util.disks import get_drive_for_path

View file

@ -403,7 +403,7 @@
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="action_name">win.show-hidden-games</property>
<property name="text">Show Hidden Games</property>
<property name="text" translatable="yes">Show _Hidden Games</property>
</object>
<packing>
<property name="expand">False</property>
@ -578,7 +578,7 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="action_name">win.show-tray-icon</property>
<property name="text" translatable="yes">Show Tray Icon</property>
<property name="text" translatable="yes">Show _Tray Icon</property>
</object>
<packing>
<property name="expand">False</property>