| 1 |
<?php |
| 2 |
namespace YayMail; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || exit; |
| 5 |
/** |
| 6 |
* I18n Logic |
| 7 |
*/ |
| 8 |
class I18n { |
| 9 |
|
| 10 |
protected static $instance = null; |
| 11 |
|
| 12 |
public static function getInstance() { |
| 13 |
if ( null == self::$instance ) { |
| 14 |
self::$instance = new self(); |
| 15 |
self::$instance->doHooks(); |
| 16 |
} |
| 17 |
|
| 18 |
return self::$instance; |
| 19 |
} |
| 20 |
|
| 21 |
private function doHooks() {} |
| 22 |
|
| 23 |
private function __construct() {} |
| 24 |
|
| 25 |
public static function loadPluginTextdomain() { |
| 26 |
if ( function_exists( 'determine_locale' ) ) { |
| 27 |
$locale = determine_locale(); |
| 28 |
} else { |
| 29 |
$locale = is_admin() ? get_user_locale() : get_locale(); |
| 30 |
} |
| 31 |
|
| 32 |
unload_textdomain( 'yaymail' ); |
| 33 |
load_textdomain( 'yaymail', YAYMAIL_PLUGIN_PATH . '/i18n/languages/yaymail-' . $locale . '.mo' ); |
| 34 |
|
| 35 |
load_plugin_textdomain( |
| 36 |
'yaymail', |
| 37 |
false, |
| 38 |
YAYMAIL_PLUGIN_URL . 'i18n/languages/' |
| 39 |
); |
| 40 |
} |
| 41 |
|
| 42 |
public static function jsTranslate() { |
| 43 |
return array( |
| 44 |
'ELEMENTS' => __( 'ELEMENTS', 'yaymail' ), |
| 45 |
'SETTINGS' => __( 'SETTINGS', 'yaymail' ), |
| 46 |
'WooCommerceEmailCustomizer' => __( 'WooCommerce Email Customizer', 'yaymail' ), |
| 47 |
'BACKGROUNDCOLOR' => __( 'BACKGROUND COLOR', 'yaymail' ), |
| 48 |
'SelectColor' => __( 'Select Color', 'yaymail' ), |
| 49 |
'Basic' => __( 'Basic', 'yaymail' ), |
| 50 |
'General' => __( 'General', 'yaymail' ), |
| 51 |
'WooCommerce' => __( 'WooCommerce', 'yaymail' ), |
| 52 |
'DIRECTIONRTL' => __( 'DIRECTION RTL', 'yaymail' ), |
| 53 |
'CONTAINERWIDTHPX' => __( 'CONTAINER WIDTH (PX)', 'yaymail' ), |
| 54 |
'Emailwidthmustbe' => __( 'Email width must be 480px (min) - 900px (max)', 'yaymail' ), |
| 55 |
'Pleaseinputcontainerwidth' => __( 'Please input container width!', 'yaymail' ), |
| 56 |
'DISPLAYPAYMENTINSTRUCTIONANDDETAILS' => __( 'DISPLAY PAYMENT INSTRUCTION AND DETAILS', 'yaymail' ), |
| 57 |
'Yes' => __( 'Yes', 'yaymail' ), |
| 58 |
'No' => __( 'No', 'yaymail' ), |
| 59 |
'Onlyforcustomer' => __( 'Only for customer', 'yaymail' ), |
| 60 |
'SHOWPRODUCTIMAGE' => __( 'SHOW PRODUCT IMAGE', 'yaymail' ), |
| 61 |
'PRODUCTIMAGEPOSITION' => __( 'PRODUCT IMAGE POSITION', 'yaymail' ), |
| 62 |
'IMAGESIZE' => __( 'IMAGE SIZE', 'yaymail' ), |
| 63 |
'Thumbnail' => __( 'Thumbnail', 'yaymail' ), |
| 64 |
'Full' => __( 'Full', 'yaymail' ), |
| 65 |
'IMAGEHEIGHT' => __( 'IMAGE HEIGHT (PX)', 'yaymail' ), |
| 66 |
'Imageheightmustbe' => __( 'Image height must be 30px (min) - 300px (max)', 'yaymail' ), |
| 67 |
'Pleaseinputimgageheight' => __( 'Please input imgage height!', 'yaymail' ), |
| 68 |
'IMAGEWIDTH' => __( 'IMAGE WIDTH (PX)', 'yaymail' ), |
| 69 |
'Imagewidthmustbe' => __( 'Image width must be 30px (min) - 300px (max)', 'yaymail' ), |
| 70 |
'Pleaseinputimgagewidth' => __( 'Please input imgage width!', 'yaymail' ), |
| 71 |
'SHOWPRODUCTSKU' => __( 'SHOW PRODUCT SKU', 'yaymail' ), |
| 72 |
'SHOWPRODUCTDESCRIPTION' => __( 'SHOW PRODUCT DESCRIPTION', 'yaymail' ), |
| 73 |
'SHOWPRODUCTHYPERLINKS' => __( 'SHOW PRODUCT HYPERLINKS', 'yaymail' ), |
| 74 |
'SHOWPRODUCTREGULARPRICE' => __( 'SHOW PRODUCT REGULAR PRICE', 'yaymail' ), |
| 75 |
'SHOWPRODUCTITEMCOST' => __( 'SHOW PRODUCT ITEM COST', 'yaymail' ), |
| 76 |
'CUSTOMCSS' => __( 'CUSTOM CSS', 'yaymail' ), |
| 77 |
'Refresh' => __( 'Refresh', 'yaymail' ), |
| 78 |
'Cancel' => __( 'Cancel', 'yaymail' ), |
| 79 |
'Changeemailsubjectandformname' => __( 'Change email subject and form name', 'yaymail' ), |
| 80 |
'Clickhere' => __( 'Click here', 'yaymail' ), |
| 81 |
'Pleasecheckagain' => __( 'Please check again', 'yaymail' ), |
| 82 |
'Save' => __( 'Save', 'yaymail' ), |
| 83 |
'PleaserefreshpagetoapplyCustomCSS' => __( 'Please refresh page to apply Custom CSS. Make sure to save your changes before refreshing.', 'yaymail' ), |
| 84 |
'EmailSettings' => __( 'Email Settings', 'yaymail' ), |
| 85 |
'BACKGROUNDCOLOR' => __( 'BACKGROUND COLOR', 'yaymail' ), |
| 86 |
'SelectColor' => __( 'Select Color', 'yaymail' ), |
| 87 |
'EMAILCONTENTBACKGROUNDCOLOR' => __( 'EMAIL CONTENT BACKGROUND COLOR', 'yaymail' ), |
| 88 |
'ResetDefault' => __( 'Reset Default', 'yaymail' ), |
| 89 |
'TEXTLINKCOLOR' => __( 'TEXT LINK COLOR', 'yaymail' ), |
| 90 |
'EnableDisableTemplates' => __( 'Enable/Disable Templates', 'yaymail' ), |
| 91 |
'ResetTemplates' => __( 'Reset Templates', 'yaymail' ), |
| 92 |
'RESETALLTEMPLATESTODEFAULT' => __( 'RESET ALL TEMPLATES TO DEFAULT', 'yaymail' ), |
| 93 |
'Reset' => __( 'Reset', 'yaymail' ), |
| 94 |
'Yessure' => __( 'Yes, sure!', 'yaymail' ), |
| 95 |
'Allyoursavedtemplatewillberesettodefault' => __( 'All your saved template will be reset to default', 'yaymail' ), |
| 96 |
'ImportExportTemplates' => __( 'Import/Export Templates', 'yaymail' ), |
| 97 |
'EXPORT' => __( 'EXPORT', 'yaymail' ), |
| 98 |
'ExportTemplates' => __( 'Export Templates', 'yaymail' ), |
| 99 |
'IMPORTTEMPLATES' => __( 'IMPORT TEMPLATES', 'yaymail' ), |
| 100 |
'ChooseFile' => __( 'Choose File1', 'yaymail' ), |
| 101 |
'Import' => __( 'Import', 'yaymail' ), |
| 102 |
'Nofilechosen' => __( 'No file chosen', 'yaymail' ), |
| 103 |
'BACKTOWORDPRESS' => __( 'BACK TO DASHBOARD', 'yaymail' ), |
| 104 |
'Sampleordertoshow' => __( 'Sample order to show', 'yaymail' ), |
| 105 |
'Shortcodes' => __( 'Shortcodes', 'yaymail' ), |
| 106 |
'generals' => __( 'generals', 'yaymail' ), |
| 107 |
'orderDetails' => __( 'order Details', 'yaymail' ), |
| 108 |
'shippings' => __( 'shippings', 'yaymail' ), |
| 109 |
'billings' => __( 'billings', 'yaymail' ), |
| 110 |
'Vendor' => __( 'Vendor', 'yaymail' ), |
| 111 |
'payments' => __( 'payments', 'yaymail' ), |
| 112 |
'newusers' => __( 'new users', 'yaymail' ), |
| 113 |
'resetpassword' => __( 'reset password', 'yaymail' ), |
| 114 |
'ORDERTAXES' => __( 'ORDER TAXES', 'yaymail' ), |
| 115 |
'CUSTOMORDERMETA' => __( 'CUSTOM ORDER META', 'yaymail' ), |
| 116 |
'AUTOMATEWOO' => __( 'AUTOMATEWOO', 'yaymail' ), |
| 117 |
'SendEmail' => __( 'Send Email', 'yaymail' ), |
| 118 |
'Emailaddressfortest' => __( 'Email address for test', 'yaymail' ), |
| 119 |
'Emailsentsuccessfully' => __( 'Yay! Email sent successfully.', 'yaymail' ), |
| 120 |
'Tosendemailstoinboxwerecommend' => __( 'To send emails to inbox, we recommend:', 'yaymail' ), |
| 121 |
'YaySMTPSimpleWPSMTPMail' => __( 'YaySMTP – Simple WP SMTP Mail', 'yaymail' ), |
| 122 |
'Details' => __( 'Details', 'yaymail' ), |
| 123 |
'FreeInstallNow' => __( 'Free Install Now', 'yaymail' ), |
| 124 |
'Areyousureyouwanttoleave' => __( 'Are you sure you want to leave?', 'yaymail' ), |
| 125 |
'Leave' => __( 'Leave', 'yaymail' ), |
| 126 |
'Copytemplate' => __( 'Import template from', 'yaymail' ), |
| 127 |
'Import' => __( 'Import', 'yaymail' ), |
| 128 |
'CopyFrom' => __( 'Copy From', 'yaymail' ), |
| 129 |
'Areyousureyouwanttoresetthistemplate' => __( 'Are you sure you want to reset this template?', 'yaymail' ), |
| 130 |
'Allchangesyoumadewontbesaved' => __( 'All changes you made won\'t be saved.', 'yaymail' ), |
| 131 |
'Preview' => __( 'Preview', 'yaymail' ), |
| 132 |
'Emailpreview' => __( 'Email preview', 'yaymail' ), |
| 133 |
'Desktoppreview' => __( 'Desktop preview', 'yaymail' ), |
| 134 |
'Mobilepreview' => __( 'Mobile preview', 'yaymail' ), |
| 135 |
'UpgradeTitle' => __( 'Yay! You\'ve made the right choice!', 'yaymail' ), |
| 136 |
'GetYayMailPro' => __( 'Get YayMail Pro', 'yaymail' ), |
| 137 |
'Unlockfullfeaturesandpremiumsupport' => __( 'Unlock full features and premium support', 'yaymail' ), |
| 138 |
'Undo&Redo' => __( 'Undo & Redo', 'yaymail' ), |
| 139 |
'Getrecenteditingactionsandrevisions' => __( 'Get recent editing actions and revisions', 'yaymail' ), |
| 140 |
'Compatiblewith20+third-partyplugins' => __( 'Compatible with 20+ third-party plugins', 'yaymail' ), |
| 141 |
'CustomOrderStatus' => __( 'Custom Order Status', 'yaymail' ), |
| 142 |
'WooCommerceShipmentTracking' => __( 'WooCommerce Shipment Tracking', 'yaymail' ), |
| 143 |
'CheckoutFieldEditor' => __( 'Checkout Field Editor', 'yaymail' ), |
| 144 |
'WPML,Polylang,TranslatePress,and more!' => __( 'WPML, Polylang, TranslatePress, and more!', 'yaymail' ), |
| 145 |
'BuyNow' => __( 'Buy Now', 'yaymail' ), |
| 146 |
); |
| 147 |
} |
| 148 |
} |
| 149 |
|