updated variables translations for js
This commit is contained in:
@@ -957,7 +957,7 @@ class ToolsCore
|
||||
* @param string $string Error message
|
||||
* @param bool $htmlentities By default at true for parsing error message with htmlentities
|
||||
*/
|
||||
public static function displayError($string = 'Fatal error', $htmlentities = true, Context $context = null)
|
||||
public static function displayError($string = 'Fatal error', $htmlentities = true, Context $context = null, $addslashes = false)
|
||||
{
|
||||
global $_ERRORS;
|
||||
|
||||
@@ -975,6 +975,9 @@ class ToolsCore
|
||||
}
|
||||
$key = md5(str_replace('\'', '\\\'', $string));
|
||||
$str = (isset($_ERRORS) && is_array($_ERRORS) && array_key_exists($key, $_ERRORS)) ? $_ERRORS[$key] : $string;
|
||||
if ($addslashes) {
|
||||
$str = addslashes($str);
|
||||
}
|
||||
return $htmlentities ? Tools::htmlentitiesUTF8(stripslashes($str)) : $str;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ class TranslateCore
|
||||
* @param string $source
|
||||
* @return string
|
||||
*/
|
||||
public static function getModuleTranslation($module, $string, $source, $sprintf = null, $js = false, $language = null)
|
||||
public static function getModuleTranslation($module, $string, $source, $sprintf = null, $addslashes = false, $language = null)
|
||||
{
|
||||
global $_MODULES, $_MODULE, $_LANGADM;
|
||||
|
||||
@@ -210,10 +210,10 @@ class TranslateCore
|
||||
$ret = Translate::checkAndReplaceArgs($ret, $sprintf);
|
||||
}
|
||||
|
||||
if ($js) {
|
||||
|
||||
$ret = htmlspecialchars($ret, ENT_COMPAT, 'UTF-8');
|
||||
if ($addslashes) {
|
||||
$ret = addslashes($ret);
|
||||
} else {
|
||||
$ret = htmlspecialchars($ret, ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
|
||||
if ($sprintf === null) {
|
||||
|
||||
@@ -2124,13 +2124,13 @@ abstract class ModuleCore
|
||||
* @param bool|string $specific filename to use in translation key
|
||||
* @return string Translation
|
||||
*/
|
||||
public function l($string, $specific = false)
|
||||
public function l($string, $specific = false, $addslashes = false)
|
||||
{
|
||||
if (self::$_generate_config_xml_mode) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
return Translate::getModuleTranslation($this, $string, ($specific) ? $specific : $this->name);
|
||||
return Translate::getModuleTranslation($this, $string, ($specific) ? $specific : $this->name, null, $addslashes);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -24,17 +24,17 @@ class HotelHelper
|
||||
{
|
||||
$objModule = new HotelreservationSystem();
|
||||
$jsVars = array(
|
||||
'display_name' => $objModule->l('Display', 'HotelHelper'),
|
||||
'records_name' => $objModule->l('records per page', 'HotelHelper'),
|
||||
'no_product' => $objModule->l('No records found', 'HotelHelper'),
|
||||
'show_page' => $objModule->l('Showing page', 'HotelHelper'),
|
||||
'show_of' => $objModule->l('of', 'HotelHelper'),
|
||||
'no_record' => $objModule->l('No records available', 'HotelHelper'),
|
||||
'filter_from' => $objModule->l('filtered from', 'HotelHelper'),
|
||||
't_record' => $objModule->l('total records', 'HotelHelper'),
|
||||
'search_item' => $objModule->l('Search', 'HotelHelper'),
|
||||
'p_page' => $objModule->l('Previous', 'HotelHelper'),
|
||||
'n_page' => $objModule->l('Next', 'HotelHelper'),
|
||||
'display_name' => $objModule->l('Display', 'HotelHelper', fasle, true),
|
||||
'records_name' => $objModule->l('records per page', 'HotelHelper', fasle, true),
|
||||
'no_product' => $objModule->l('No records found', 'HotelHelper', fasle, true),
|
||||
'show_page' => $objModule->l('Showing page', 'HotelHelper', fasle, true),
|
||||
'show_of' => $objModule->l('of', 'HotelHelper', fasle, true),
|
||||
'no_record' => $objModule->l('No records available', 'HotelHelper', fasle, true),
|
||||
'filter_from' => $objModule->l('filtered from', 'HotelHelper', fasle, true),
|
||||
't_record' => $objModule->l('total records', 'HotelHelper', fasle, true),
|
||||
'search_item' => $objModule->l('Search', 'HotelHelper', fasle, true),
|
||||
'p_page' => $objModule->l('Previous', 'HotelHelper', fasle, true),
|
||||
'n_page' => $objModule->l('Next', 'HotelHelper', fasle, true),
|
||||
);
|
||||
|
||||
Media::addJsDef($jsVars);
|
||||
|
||||
@@ -724,11 +724,11 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'filesizeError' => $this->l('File exceeds maximum size.'),
|
||||
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
|
||||
'maxSizeAllowed' => Tools::getMaxUploadSize(),
|
||||
'sortRowsUrl' => $this->context->link->getAdminLink('AdminAddHotel'),
|
||||
'primaryHotelId' => Configuration::get('WK_PRIMARY_HOTEL'),
|
||||
'disableHotelMsg' => $this->l('Primary hotel for website will be updated to first available active hotel.'),
|
||||
'disableHotelMsg' => $this->l('Primary hotel for website will be updated to first available active hotel.', null, true),
|
||||
)
|
||||
);
|
||||
// GOOGLE MAP
|
||||
|
||||
@@ -419,7 +419,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
|
||||
parent::setMedia();
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'filesizeError' => $this->l('File exceeds maximum size.'),
|
||||
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
|
||||
'maxSizeAllowed' => Tools::getMaxUploadSize(),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -807,33 +807,33 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
'rooms_booking_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'),
|
||||
'opt_select_all' => $this->l('All Types'),
|
||||
'slt_another_htl' => $this->l('Select Another Hotel'),
|
||||
'product_type_cond' => $this->l('Product type is required'),
|
||||
'from_date_cond' => $this->l('From date is required'),
|
||||
'to_date_cond' => $this->l('To date is required'),
|
||||
'hotel_name_cond' => $this->l('Hotel Name is required'),
|
||||
'num_rooms_cond' => $this->l('Number of Rooms is required'),
|
||||
'add_to_cart' => $this->l('Add To Cart'),
|
||||
'remove' => $this->l('Remove'),
|
||||
'noRoomTypeAvlTxt' => $this->l('No room type available.'),
|
||||
'no_rm_avail_txt' => $this->l('No rooms available.'),
|
||||
'slct_rm_err' => $this->l('Please select a room first.'),
|
||||
'product_added_cart_txt' => $this->l('Product added in cart'),
|
||||
'opt_select_all' => $this->l('All Types', null, true),
|
||||
'slt_another_htl' => $this->l('Select Another Hotel', null, true),
|
||||
'product_type_cond' => $this->l('Product type is required', null, true),
|
||||
'from_date_cond' => $this->l('From date is required', null, true),
|
||||
'to_date_cond' => $this->l('To date is required', null, true),
|
||||
'hotel_name_cond' => $this->l('Hotel Name is required', null, true),
|
||||
'num_rooms_cond' => $this->l('Number of Rooms is required', null, true),
|
||||
'add_to_cart' => $this->l('Add To Cart', null, true),
|
||||
'remove' => $this->l('Remove', null, true),
|
||||
'noRoomTypeAvlTxt' => $this->l('No room type available.', null, true),
|
||||
'no_rm_avail_txt' => $this->l('No rooms available.', null, true),
|
||||
'slct_rm_err' => $this->l('Please select a room first.', null, true),
|
||||
'product_added_cart_txt' => $this->l('Product added in cart', null, true),
|
||||
'info_icon_path' => _MODULE_DIR_.$this->module->name.'/views/img/Slices/info-icon.svg',
|
||||
'select_age_txt' => 'Select age',
|
||||
'under_1_age' => 'Under 1',
|
||||
'room_txt' => 'Room',
|
||||
'rooms_txt' => 'Rooms',
|
||||
'remove_txt' => 'Remove',
|
||||
'adult_txt' => 'Adults',
|
||||
'adults_txt' => 'Adults',
|
||||
'child_txt' => 'Child',
|
||||
'children_txt' => 'Children',
|
||||
'below_txt' => 'Below',
|
||||
'years_txt' => 'years',
|
||||
'all_children_txt' => 'All Children',
|
||||
'invalid_occupancy_txt' => 'Invalid occupancy(adults/children) found.',
|
||||
'select_age_txt' => $this->l('Select age', null, true),
|
||||
'under_1_age' => $this->l('Under 1', null, true),
|
||||
'room_txt' => $this->l('Room', null, true),
|
||||
'rooms_txt' => $this->l('Rooms', null, true),
|
||||
'remove_txt' => $this->l('Remove', null, true),
|
||||
'adult_txt' => $this->l('Adults', null, true),
|
||||
'adults_txt' => $this->l('Adults', null, true),
|
||||
'child_txt' => $this->l('Child', null, true),
|
||||
'children_txt' => $this->l('Children', null, true),
|
||||
'below_txt' => $this->l('Below', null, true),
|
||||
'years_txt' => $this->l('years', null, true),
|
||||
'all_children_txt' => $this->l('All Children', null, true),
|
||||
'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', null, true),
|
||||
// 'check_calender_var' => $check_calender_var,
|
||||
);
|
||||
if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS ) {
|
||||
|
||||
@@ -171,7 +171,7 @@ class QloHotelReview extends Module
|
||||
'admin_approval_enabled' => (int) Configuration::get('QHR_ADMIN_APPROVAL_ENABLED'),
|
||||
'texts' => array(
|
||||
'num_files' => sprintf(
|
||||
$this->l('You can upload a maximum of %d images.'),
|
||||
$this->l('You can upload a maximum of %d images.', false, true),
|
||||
(int) Configuration::get('QHR_MAX_IMAGES_PER_REVIEW')
|
||||
),
|
||||
),
|
||||
|
||||
@@ -397,7 +397,7 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController
|
||||
parent::setMedia();
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'filesizeError' => $this->l('File exceeds maximum size.'),
|
||||
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
|
||||
'maxSizeAllowed' => Tools::getMaxUploadSize(),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -428,7 +428,7 @@ class AdminFeaturesModuleSettingController extends ModuleAdminController
|
||||
parent::setMedia();
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'filesizeError' => $this->l('File exceeds maximum size.'),
|
||||
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
|
||||
'maxSizeAllowed' => Tools::getMaxUploadSize(),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -66,7 +66,7 @@ class wkhotelfilterblock extends Module
|
||||
$htl_id_category = Tools::getValue('id_category');
|
||||
if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))) {
|
||||
if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) {
|
||||
Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available')));
|
||||
Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available', false, true)));
|
||||
|
||||
$this->context->controller->addJS($this->_path.'/views/js/wkhotelfilterblock.js');
|
||||
$this->context->controller->addCSS($this->_path.'/views/css/wkhotelfilterblock.css');
|
||||
|
||||
@@ -61,26 +61,26 @@ class WkRoomSearchBlock extends Module
|
||||
'wkroomsearchblock',
|
||||
'autocompletesearch'
|
||||
),
|
||||
'no_results_found_cond' => $this->l('No results found for this search'),
|
||||
'hotel_name_cond' => $this->l('Please select a hotel name'),
|
||||
'check_in_time_cond' => $this->l('Please enter Check In time'),
|
||||
'check_out_time_cond' => $this->l('Please enter Check Out time'),
|
||||
'less_checkin_date' => $this->l('Check In date can not be before current date.'),
|
||||
'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.'),
|
||||
'select_htl_txt' => $this->l('Select Hotel'),
|
||||
'select_age_txt' => $this->l('Select age'),
|
||||
'under_1_age' => $this->l('Under 1'),
|
||||
'room_txt' => $this->l('Room'),
|
||||
'rooms_txt' => $this->l('Rooms'),
|
||||
'remove_txt' => $this->l('Remove'),
|
||||
'adult_txt' => $this->l('Adult'),
|
||||
'adults_txt' => $this->l('Adults'),
|
||||
'child_txt' => $this->l('Child'),
|
||||
'children_txt' => $this->l('Children'),
|
||||
'below_txt' => $this->l('Below'),
|
||||
'years_txt' => $this->l('years'),
|
||||
'all_children_txt' => $this->l('All Children'),
|
||||
'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.'),
|
||||
'no_results_found_cond' => $this->l('No results found for this search', false, true),
|
||||
'hotel_name_cond' => $this->l('Please select a hotel name', false, true),
|
||||
'check_in_time_cond' => $this->l('Please enter Check In time', false, true),
|
||||
'check_out_time_cond' => $this->l('Please enter Check Out time', false, true),
|
||||
'less_checkin_date' => $this->l('Check In date can not be before current date.', false, true),
|
||||
'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.', false, true),
|
||||
'select_htl_txt' => $this->l('Select Hotel', false, true),
|
||||
'select_age_txt' => $this->l('Select age', false, true),
|
||||
'under_1_age' => $this->l('Under 1', false, true),
|
||||
'room_txt' => $this->l('Room', false, true),
|
||||
'rooms_txt' => $this->l('Rooms', false, true),
|
||||
'remove_txt' => $this->l('Remove', false, true),
|
||||
'adult_txt' => $this->l('Adult', false, true),
|
||||
'adults_txt' => $this->l('Adults', false, true),
|
||||
'child_txt' => $this->l('Child', false, true),
|
||||
'children_txt' => $this->l('Children', false, true),
|
||||
'below_txt' => $this->l('Below', false, true),
|
||||
'years_txt' => $this->l('years', false, true),
|
||||
'all_children_txt' => $this->l('All Children', false, true),
|
||||
'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', false, true),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ class AdminTestimonialsModuleSettingController extends ModuleAdminController
|
||||
parent::setMedia();
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'filesizeError' => $this->l('File exceeds maximum size.'),
|
||||
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
|
||||
'maxSizeAllowed' => Tools::getMaxUploadSize(),
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user