<?php

namespace PWH_DCFH\App\Base;

if (!defined('ABSPATH')) exit;
if (!class_exists('PWH_DCFH_Strings')) {
    class PWH_DCFH_Strings
    {
        private static $_instance;

        /**
         * Get Class Instance
         * @return PWH_DCFH_Strings
         */
        public static function instance()
        {
            if (self::$_instance == null) {
                self::$_instance = new self();
            }

            return self::$_instance;
        }

        public function strings($key)
        {
            $strings = [
                'admin_js_i10' => [
                    'please_wait_text' => __('Please wait...', 'pwh-dcfh'),
                    'smtp_host' => __('SMTP host required.', 'pwh-dcfh'),
                    'smtp_from_email' => __('SMTP from email required.', 'pwh-dcfh'),
                    'smtp_from_name' => __('SMTP from name required.', 'pwh-dcfh'),
                    'smtp_port' => __('SMTP port required.', 'pwh-dcfh'),
                    'smtp_username' => __('SMTP username required.', 'pwh-dcfh'),
                    'smtp_password' => __('SMTP password required.', 'pwh-dcfh'),
                    'smtp_settings_alert' => __('Have you saved your SMTP settings? Please save the settings before testing SMTP.', 'pwh-dcfh'),
                    'select_term' => __('Please Select Term', 'pwh-dcfh'),
                    'not_applicable' => __('Not Applicable', 'pwh-dcfh'),
                    'custom_field_name' => __('Enter custom field name.', 'pwh-dcfh'),
                    'choose_custom_field_name' => __('Choose Custom Field', 'pwh-dcfh'),
                ],
                'frontend_i10' => [
                    'duplicate_form_id_text' => __('Attention: multiple contact forms currently have the same unique ID. Please open the module settings and open the Admin Label toggle and change the Contact Form Unique ID.', 'pwh-dcfh'),
                    'file_upload_btn_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_file_upload_btn_text', 'Choose Files'),
                    'accepted_file_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_accepted_file_text', 'Accepted file types:'),
                    'max_filesize_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_max_filesize_text', 'Max. file size:'),
                    'chosen_file_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_chosen_file_text', 'No file chosen'),
                    'selected_files_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_selected_files_text', '{chosen_files_count} file{_s_} selected'),
                    'uploading_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_uploading_text', '{percentage} uploaded your files, please wait for the system to continue.'),
                    'already_attached_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_already_attached_text', 'File {filename} has already attached. Please choose another file.'),
                    'allow_filesize_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_allow_filesize_text', 'File {filename} not uploaded. Maximum file size {allowed_filesize}.'),
                    'x_files_allow_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_x_files_allow_text', 'Only {allowed_files} files are allowed to upload.'),
                    'remove_file_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_remove_file_text', 'Are you sure you want to remove {filename}?'),
                    'delete_file_icon_hover_text' => pwh_dcfh_db()::get_setting('pwh_dcfh_delete_file_icon_hover_text', 'Remove an attachment'),
                    'security_reason_text' => pwh_dcfh_db()::get_setting('security_reason_text', 'File {filename} has failed to upload. Sorry, this file type is not permitted for security reasons.'),
                ]
            ];

            return $strings[$key];
        }
    }
}