from parallels.hosting_check.messages.utils import format_message

MESSAGES = dict()

MESSAGES['web_availability_signature_found_on_target'] = format_message("""
An error message was found on the target server web page (while there is no such message on the source server).
The web page URL: {url}
The error message: {error_message}
""")

MESSAGES['web_availability_signature_found_in_target_log'] = format_message("""
An error message was found on the target server error log.
Error log file: {error_log_file}
The error message: {error_message}
""")

MESSAGES['web_availability_signature_found_on_source'] = format_message("""
An error message was found on the source server web page and on the target server web page.
The error message on the source: {source_error_message}
The error message on the target: {target_error_message}
The web page URL: {url}
""")

MESSAGES['web_availability_webserver_returned_http_code_target'] = format_message("""
An HTTP status code 4xx or 5xx is returned by the web server.
Server: {server_description}
The HTTP status code: {status_code}
The web page URL: {url}
""")

MESSAGES['web_availability_webserver_returned_http_code_both'] = format_message("""
An HTTP status code 4xx or 5xx is returned by both the {source_server_description} and the {target_server_description}.
Most probably that could be ignored: the site did not work on the source server,
and it does not work on the target server.

The HTTP status code: {status_code}
The web page URL: {url} 
""")

MESSAGES['web_availability_different_http_code'] = format_message(""" 
The HTTP status code of a web page has changed after the migration.
The status code returned by the {source_server_description}: {source_status_code}
The status code returned by the {target_server_description}: {target_status_code}
The web page URL: {url} 
""")

MESSAGES['web_availability_request_error'] = format_message("""
Web server is accessible, but the web page cannot be retrieved.
Server: {server_description}
URL: {url}
The error message: {error_message}
""")

MESSAGES['web_availability_failed_to_connect'] = format_message("""
The hosting checker cannot connect to the web server.
Server: {server_description}
URL: {url}
The error message: {error_message}
""")

MESSAGES['web_availability_internal_error'] = format_message("""
An internal error occurred in the hosting checker.
Server: {server_description}
URL: {url}
The error message: {error_message}
""")

MESSAGES['web_availability_title_missing_target'] = format_message("""
A web page returned by the target server has no HTML title.
The web page URL: {url}.
""")

MESSAGES['web_availability_title_missing_source'] = format_message("""
A web page returned by the source server has no HTML title.
The web page URL: {url}.
""")

MESSAGES['web_availability_title_changed'] = format_message("""
The title of a web page has changed after the migration.
The page title on the source server: {title_source}
The page title on the target server: {title_target}
The target web page URL: {url}
""")
MESSAGES['cannot_decode_url'] = format_message("""
Domain web page contains a link that cannot be decoded.

The URL that cannot be decoded: {url}
""")
