# coding=utf-8
from parallels.core.utils.message_utils import single_line_message, multi_line_message, load_overrides

UNABLE_TO_GET_DUMP_PATH = single_line_message("""
    Unable to retrieve path to Plesk configuration dump "%s"
""")
ACTION_COPY_MAIL_MESSAGES_FAILURE = single_line_message("""
    Failed to copy mail messages of subscription
""")
ACTION_RESTORE_DATABASES_FROM_DUMPS_DESCRIPTION = single_line_message("""
    Restore databases from dump files
""")
ACTION_RESTORE_DATABASES_FROM_DUMPS_FAILURE = single_line_message("""
    Failed to restore databases of subscription from dump files
""")
ACTION_CREATE_DUMP_FAILURE = single_line_message("""
    Failed to create Plesk configuration dump out of hosting description file
""")
ACTION_CREATE_DUMP_DESCRIPTION = single_line_message("""
    Create Plesk configuration dump out of hosting description file
""")
LOG_CREATE_DUMP = single_line_message("""
    Create Plesk configuration dump for '%s'
""")
LOG_RESTORE_DB_DUMP = single_line_message("""
    Restore database dump for {db_type} database '{db_name}' from '{dump}'
""")
DB_WILL_NOT_BE_RESTORED_NO_DB_SERVER = single_line_message("""
    Database '{db_name}' of {db_type} will not be restored from dump
    as no {db_type} DB server is assigned to subscription
""")
ACTION_COPY_MAIL_MESSAGES = single_line_message("""
    Copy mail messages
""")
INVALID_FORMAT = single_line_message("""
    Invalid format: %s"
""")
UNSUPPORTED_SOURCE_WEB_PATH_TYPE = single_line_message("""
    Unsupported source web path type
""")
ACTION_COPY_LOCAL_WEB_FILES = single_line_message("""
    Put web files to domain directories
""")
FAIL_TO_COPY_LOCAL_WEB_FILES = single_line_message("""
    Failed to put web files to domain directories
""")
COMMAND_CREATE_DUMP_FROM_HOSTING_DESCRIPTION = single_line_message("""
    Create Plesk configuration dump out of hosting description file (YAML/JSON/XML)
""")
COMMAND_VALIDATE_HOSTING_DESCRIPTION = single_line_message("""
    Validate hosting description files specified in tool's configuration file
""")
COMMAND_DEPLOY_AGENT = single_line_message("""
    Deploy agent and required components to source server
""")
SOURCE_HOSTING_DESCRIPTION_FILE_OPTION = single_line_message("""
    Path to source hosting description file
""")
SOURCE_HOSTING_DESCRIPTION_FORMAT_OPTION = single_line_message("""
    Format of source hosting description file: YAML, JSON or XML (default is YAML)
""")
TARGET_DUMP_FILE_OPTION = single_line_message("""
    Path to target full Plesk configuration dump file
""")
ACTION_FAILED_VALIDATE_HOSTING_DESCRIPTION = single_line_message("""
    Failed to validate hosting description file
""")
ACTION_DESCRIPTION_VALIDATE_HOSTING_DESCRIPTION = single_line_message("""
    Validate hosting description file
""")
VALIDATION_FAILED = multi_line_message("""
    Hosting description file '{file}' validation failed:
    {errors}
""")
VALIDATION_FAILED_MIGRATION_STOPPED = multi_line_message("""
    Hosting description file '{file}' validation failed:
    {errors}

    Migration will be stopped. To continue migration fix the errors listed above.
    For details on hosting description format refer to the official migration tool's documentation.

    If you are sure that these errors won't affect migration, you could try
    to specify 'validation-mode: warn' or 'validation-mode: skip' in corresponding source section of migrator's
    configuration file to ignore these errors and force migrator to proceed.
""")
VALIDATION_PASSED = multi_line_message("""
    Hosting description file '{file}' successfully passed validation
""")
FAILED_TO_FIND_SUBSCRIPTION_IN_DUMP = single_line_message("""
    Failed to find subscription '%s' in hosting description file
""")
COPY_MAILBOX_WITH_IMAP = single_line_message("""
    Copy messages of mailbox '{mailbox}' with IMAP
""")
COPY_MAILBOX_WITH_MAIL_MIGRATOR = single_line_message("""
    Copy messages of mailbox '{mailbox}' with MailMigrator
""")
COPY_MAILBOX_WITH_RSYNC = single_line_message("""
    Copy messages of mailbox '{mailbox}' with rsync
""")
SKIP_COPY_MAILBOX_WITH_RSYNC = single_line_message("""
    Skip copy messages of mailbox '{mailbox}' with rsync because source directory is not defined
""")
COPY_MAILBOX_FROM_LOCAL_DIR = single_line_message("""
    Copy messages of mailbox '{mailbox}' from local directory
""")
SKIP_COPY_MAILBOX_FROM_LOCAL_DIR = single_line_message("""
    Skip copy messages of mailbox '{mailbox}' from local directory because source directory is not defined
""")
COPY_MAILBOX_NONE = single_line_message("""
    Do not copy messages of mailbox '{mailbox}'
""")
COPY_MAILBOX_UNKNOWN = single_line_message("""
    Unknown mode '{mode}' to copy messages of mailbox '{mailbox}'
""")
FAILED_TO_COPY_MAILBOX = single_line_message("""
    Failed to copy mail messages of mailbox '{mailbox}': {reason}
""")
COPY_MESSAGES_OF_MAILBOX = single_line_message("""
    Copy mail messages of mailbox '{mailbox}'
""")
ACTION_FAILED_CREATE_HOSTING_DESCRIPTION = single_line_message("""
    Failed to collect information about objects on source server
""")
ACTION_DESCRIPTION_CREATE_HOSTING_DESCRIPTION = single_line_message("""
    Collect information about objects on source server
""")
ACTION_FAILED_DEPLOY_AGENT = single_line_message("""
    Failed to deploy agent to source server
""")
ACTION_DESCRIPTION_DEPLOY_AGENT = single_line_message("""
    Deploy agent to source server
""")
ACTION_FAILED_AGENT_START_INFO = single_line_message("""
    Failed to inform about manual agent execution
""")
ACTION_DESCRIPTION_AGENT_START_INFO = single_line_message("""
    Inform about manual agent execution
""")
ACTION_FAILED_REMOVE_AGENT = single_line_message("""
    Failed to remove agent from source server
""")
ACTION_DESCRIPTION_REMOVE_AGENT = single_line_message("""
    Remove agent from source server
""")
ACTION_FAILED_DEPLOY_MIGRATOR_PYTHON = single_line_message("""
    Failed to deploy Python on source server
""")
ACTION_DESCRIPTION_DEPLOY_MIGRATOR_PYTHON = single_line_message("""
    Deploy Python on source server
""")
COPY_AGENT_TO_SOURCE = single_line_message("""
    Copy agent '{agent}' to {server}
""")
RUN_AGENT_ON_SOURCE = single_line_message("""
    Run agent '{agent}' on {server}
""")
REMOVE_AGENT_FROM_SOURCE = single_line_message("""
    Remove agent from {server}
""")
GET_HOSTING_DESCRIPTION_FROM_SOURCE = single_line_message("""
    Copy hosting description from source server
""")
SKIP_LOADING_HOSTING_DESCRIPTION_FILE = single_line_message("""
    Hosting description file '{hosting_description_file}' already exists, skip loading
""")
SKIP_DEPLOY_AGENT = single_line_message("""
    Hosting description file '{hosting_description_file}' already exists, skip deploy agent
""")
REMOVE_AGENT_EXECUTION_RESULTS_FROM_SOURCE = single_line_message("""
    Remove agent execution results from source server
""")
FAILED_TO_GET_AGENT_EXECUTION_RESULTS_FROM_SOURCE = multi_line_message("""
    Failed to get agent execution results from source server:
    {details}
""")
SOURCE_OS_DETECTED = single_line_message("""
    OS '{source_os_type} {source_os_version} {source_os_arch}' is detected on {source_description}
""")
SOURCE_OS_NOT_SUPPORTED = single_line_message("""
    Source server OS '{source_os_type} {source_os_version} {source_os_arch}' on {source_description} is not supported
""")
INSTALL_PYTHON = single_line_message("""
    Installing Python to {source_description} required to fetch information from the server
""")
NOT_INSTALLED_PACKAGES = single_line_message("""
    The following required packages were not installed on {source_description}
    (OS: {source_os_type} {source_os_version} {source_os_arch}): {packages}
""")
SKIP_INSTALL_PYTHON = single_line_message("""
    Hosting description file '{hosting_description_file}' already exists, skip Python installation
""")
PYTHON_ALREADY_INSTALLED = single_line_message("""
    Python packages are already installed, skip Python installation on {source_description}
""")
AGENT_MANUAL_START_INFO = multi_line_message("""
    Agent '{agent}' on {server} can be executed with command:
    {command}
""")
NO_AGENT_MANUAL_START_INFO = single_line_message("""
    There are no source servers configured where the agent should be deployed
""")

# Load language and UI type overrides. That must be the last line of root messages file.
load_overrides(__name__, locals())
