I'm trying to change the date format on order emails (both to the customer and store owner). I've modified the language file to make the changes but they don't have any effect. I've emptied the caches and refreshed the mods as well. Does something else need to be changed?
OC 3.0.3.7 - default template
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I'm only using one language in the site (en-gb). Customer language selection is disabled.straightlight wrote: ↑Thu Sep 23, 2021 2:37 amTake note that the customer's language is used when the date short format is used in the customer's email. Which means, ensure to change all the language pack keys' values you may have, not only the ones you might be using as the admin user.
I already mentioned that I cleared the caches.straightlight wrote: ↑Thu Sep 23, 2021 2:37 amTo clear your OC cache, see this post: viewtopic.php?f=134&t=215776#p718325
Storage folder was always outside of public_html.straightlight wrote: ↑Thu Sep 23, 2021 2:37 amand ensure that your storage folder is located outside of your public_html folder with CHMOD 0755 recursive settings on your folders (not on files!) as changes must be done without error messages from FTP or via SSH. Then, to edit both config.php files accordingly with your new storage path.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
straightlight wrote: ↑Thu Sep 23, 2021 3:31 amUnless using an extension already, when modifying the language files, changes should be effective once clearing the cache unless encountering cache issues or if using a text editor that does not support UTF-8 without BOM encoding.
CJC wrote: ↑Thu Sep 23, 2021 2:55 amI'm only using one language in the site (en-gb). Customer language selection is disabled.straightlight wrote: ↑Thu Sep 23, 2021 2:37 amTake note that the customer's language is used when the date short format is used in the customer's email. Which means, ensure to change all the language pack keys' values you may have, not only the ones you might be using as the admin user.
I already mentioned that I cleared the caches.straightlight wrote: ↑Thu Sep 23, 2021 2:37 amTo clear your OC cache, see this post: viewtopic.php?f=134&t=215776#p718325
Storage folder was always outside of public_html.straightlight wrote: ↑Thu Sep 23, 2021 2:37 amand ensure that your storage folder is located outside of your public_html folder with CHMOD 0755 recursive settings on your folders (not on files!) as changes must be done without error messages from FTP or via SSH. Then, to edit both config.php files accordingly with your new storage path.
All and other. So you are using more than one language?CJC wrote: ↑Thu Sep 23, 2021 4:01 amThere are no third party extension installed. All of my other language file edits are working fine.
straightlight wrote: ↑Thu Sep 23, 2021 3:31 amUnless using an extension already, when modifying the language files, changes should be effective once clearing the cache unless encountering cache issues or if using a text editor that does not support UTF-8 without BOM encoding.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Then, please post your language file in BBCode.CJC wrote: ↑Thu Sep 23, 2021 4:15 amNo. One language file as I already explained. I've made some edits to other strings in the same language file.straightlight wrote: ↑Thu Sep 23, 2021 4:09 amAll and other. So you are using more than one language?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Here is catalog/language/en-gb/en-gb.php
There are no modifications directly to this file, which I would assume is normal as the language editor wouldn't modify this file directly.
Code: Select all
<?php
// Locale
$_['code'] = 'en';
$_['direction'] = 'ltr';
$_['date_format_short'] = 'd/m/Y';
$_['date_format_long'] = 'l dS F Y';
$_['time_format'] = 'h:i:s A';
$_['datetime_format'] = 'd/m/Y H:i:s';
$_['decimal_point'] = '.';
$_['thousand_point'] = ',';
// Text
$_['text_home'] = '<i class="fa fa-home"></i>';
$_['text_yes'] = 'Yes';
$_['text_no'] = 'No';
$_['text_none'] = ' --- None --- ';
$_['text_select'] = ' --- Please Select --- ';
$_['text_all_zones'] = 'All Zones';
$_['text_pagination'] = 'Showing %d to %d of %d (%d Pages)';
$_['text_loading'] = 'Loading...';
$_['text_no_results'] = 'No results!';
// Buttons
$_['button_address_add'] = 'Add Address';
$_['button_back'] = 'Back';
$_['button_continue'] = 'Continue';
$_['button_cart'] = 'Add to Cart';
$_['button_cancel'] = 'Cancel';
$_['button_compare'] = 'Compare this Product';
$_['button_wishlist'] = 'Add to Wish List';
$_['button_checkout'] = 'Checkout';
$_['button_confirm'] = 'Confirm Order';
$_['button_coupon'] = 'Apply Coupon';
$_['button_delete'] = 'Delete';
$_['button_download'] = 'Download';
$_['button_edit'] = 'Edit';
$_['button_filter'] = 'Refine Search';
$_['button_new_address'] = 'New Address';
$_['button_change_address'] = 'Change Address';
$_['button_reviews'] = 'Reviews';
$_['button_write'] = 'Write Review';
$_['button_login'] = 'Login';
$_['button_update'] = 'Update';
$_['button_remove'] = 'Remove';
$_['button_reorder'] = 'Reorder';
$_['button_return'] = 'Return';
$_['button_shopping'] = 'Continue Shopping';
$_['button_search'] = 'Search';
$_['button_shipping'] = 'Apply Shipping';
$_['button_submit'] = 'Submit';
$_['button_guest'] = 'Guest Checkout';
$_['button_view'] = 'View';
$_['button_voucher'] = 'Apply Gift Certificate';
$_['button_upload'] = 'Upload File';
$_['button_reward'] = 'Apply Points';
$_['button_quote'] = 'Get Quotes';
$_['button_list'] = 'List';
$_['button_grid'] = 'Grid';
$_['button_map'] = 'View Google Map';
// Error
$_['error_exception'] = 'Error Code(%s): %s in %s on line %s';
$_['error_upload_1'] = 'Warning: The uploaded file exceeds the upload_max_filesize directive in php.ini!';
$_['error_upload_2'] = 'Warning: The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form!';
$_['error_upload_3'] = 'Warning: The uploaded file was only partially uploaded!';
$_['error_upload_4'] = 'Warning: No file was uploaded!';
$_['error_upload_6'] = 'Warning: Missing a temporary folder!';
$_['error_upload_7'] = 'Warning: Failed to write file to disk!';
$_['error_upload_8'] = 'Warning: File upload stopped by extension!';
$_['error_upload_999'] = 'Warning: No error code available!';
$_['error_curl'] = 'CURL: Error Code(%s): %s';
/* When doing translations only include the matching language code */
// Datepicker
//$_['datepicker'] = 'af';
//$_['datepicker'] = 'ar-dz';
//$_['datepicker'] = 'ar-kw';
//$_['datepicker'] = 'ar-ly';
//$_['datepicker'] = 'ar-ma';
//$_['datepicker'] = 'ar-sa';
//$_['datepicker'] = 'ar-tn';
//$_['datepicker'] = 'ar';
//$_['datepicker'] = 'az';
//$_['datepicker'] = 'be';
//$_['datepicker'] = 'bg';
//$_['datepicker'] = 'bn';
//$_['datepicker'] = 'bo';
//$_['datepicker'] = 'br';
//$_['datepicker'] = 'bs';
//$_['datepicker'] = 'ca';
//$_['datepicker'] = 'cs';
//$_['datepicker'] = 'cv';
//$_['datepicker'] = 'cy';
//$_['datepicker'] = 'da';
//$_['datepicker'] = 'de-at';
//$_['datepicker'] = 'de-ch';
//$_['datepicker'] = 'de';
//$_['datepicker'] = 'dv';
//$_['datepicker'] = 'el';
//$_['datepicker'] = 'en-au';
//$_['datepicker'] = 'en-ca';
$_['datepicker'] = 'en-gb';
//$_['datepicker'] = 'en-ie';
//$_['datepicker'] = 'en-nz';
//$_['datepicker'] = 'eo';
//$_['datepicker'] = 'es-do';
//$_['datepicker'] = 'es';
//$_['datepicker'] = 'et';
//$_['datepicker'] = 'eu';
//$_['datepicker'] = 'fa';
//$_['datepicker'] = 'fi';
//$_['datepicker'] = 'fo';
//$_['datepicker'] = 'fr-ca';
//$_['datepicker'] = 'fr-ch';
//$_['datepicker'] = 'fr';
//$_['datepicker'] = 'fy';
//$_['datepicker'] = 'gd';
//$_['datepicker'] = 'gl';
//$_['datepicker'] = 'gom-latn';
//$_['datepicker'] = 'he';
//$_['datepicker'] = 'hi';
//$_['datepicker'] = 'hr';
//$_['datepicker'] = 'hu';
//$_['datepicker'] = 'hy-am';
//$_['datepicker'] = 'id';
//$_['datepicker'] = 'is';
//$_['datepicker'] = 'it';
//$_['datepicker'] = 'ja';
//$_['datepicker'] = 'jv';
//$_['datepicker'] = 'ka';
//$_['datepicker'] = 'kk';
//$_['datepicker'] = 'km';
//$_['datepicker'] = 'kn';
//$_['datepicker'] = 'ko';
//$_['datepicker'] = 'ky';
//$_['datepicker'] = 'lb';
//$_['datepicker'] = 'lo';
//$_['datepicker'] = 'lt';
//$_['datepicker'] = 'lv';
//$_['datepicker'] = 'me';
//$_['datepicker'] = 'mi';
//$_['datepicker'] = 'mk';
//$_['datepicker'] = 'ml';
//$_['datepicker'] = 'mr';
//$_['datepicker'] = 'ms-my';
//$_['datepicker'] = 'ms';
//$_['datepicker'] = 'my';
//$_['datepicker'] = 'nb';
//$_['datepicker'] = 'ne';
//$_['datepicker'] = 'nl-be';
//$_['datepicker'] = 'nl';
//$_['datepicker'] = 'nn';
//$_['datepicker'] = 'pa-in';
//$_['datepicker'] = 'pl';
//$_['datepicker'] = 'pt-br';
//$_['datepicker'] = 'pt';
//$_['datepicker'] = 'ro';
//$_['datepicker'] = 'ru';
//$_['datepicker'] = 'sd';
//$_['datepicker'] = 'se';
//$_['datepicker'] = 'si';
//$_['datepicker'] = 'sk';
//$_['datepicker'] = 'sl';
//$_['datepicker'] = 'sq';
//$_['datepicker'] = 'sr-cyrl';
//$_['datepicker'] = 'sr';
//$_['datepicker'] = 'ss';
//$_['datepicker'] = 'sv';
//$_['datepicker'] = 'sw';
//$_['datepicker'] = 'ta';
//$_['datepicker'] = 'te';
//$_['datepicker'] = 'tet';
//$_['datepicker'] = 'th';
//$_['datepicker'] = 'tl-ph';
//$_['datepicker'] = 'tlh';
//$_['datepicker'] = 'tr';
//$_['datepicker'] = 'tzl';
//$_['datepicker'] = 'tzm-latn';
//$_['datepicker'] = 'tzm';
//$_['datepicker'] = 'uk';
//$_['datepicker'] = 'ur';
//$_['datepicker'] = 'uz-latn';
//$_['datepicker'] = 'uz';
//$_['datepicker'] = 'vi';
//$_['datepicker'] = 'x-pseudo';
//$_['datepicker'] = 'yo';
//$_['datepicker'] = 'zh-cn';
//$_['datepicker'] = 'zh-hk';
//$_['datepicker'] = 'zh-tw';
You need to ensure you are using a text editor supporting UTF-8 without BOM such as: Notepad++ . However, you also need to cover this post first as this seem to be the same issue: viewtopic.php?f=202&t=204081#p829044CJC wrote: ↑Thu Sep 23, 2021 6:53 amHere is catalog/language/en-gb/en-gb.php
There are no modifications directly to this file, which I would assume is normal as the language editor wouldn't modify this file directly.
Code: Select all
<?php // Locale $_['code'] = 'en'; $_['direction'] = 'ltr'; $_['date_format_short'] = 'd/m/Y'; $_['date_format_long'] = 'l dS F Y'; $_['time_format'] = 'h:i:s A'; $_['datetime_format'] = 'd/m/Y H:i:s'; $_['decimal_point'] = '.'; $_['thousand_point'] = ','; // Text $_['text_home'] = '<i class="fa fa-home"></i>'; $_['text_yes'] = 'Yes'; $_['text_no'] = 'No'; $_['text_none'] = ' --- None --- '; $_['text_select'] = ' --- Please Select --- '; $_['text_all_zones'] = 'All Zones'; $_['text_pagination'] = 'Showing %d to %d of %d (%d Pages)'; $_['text_loading'] = 'Loading...'; $_['text_no_results'] = 'No results!'; // Buttons $_['button_address_add'] = 'Add Address'; $_['button_back'] = 'Back'; $_['button_continue'] = 'Continue'; $_['button_cart'] = 'Add to Cart'; $_['button_cancel'] = 'Cancel'; $_['button_compare'] = 'Compare this Product'; $_['button_wishlist'] = 'Add to Wish List'; $_['button_checkout'] = 'Checkout'; $_['button_confirm'] = 'Confirm Order'; $_['button_coupon'] = 'Apply Coupon'; $_['button_delete'] = 'Delete'; $_['button_download'] = 'Download'; $_['button_edit'] = 'Edit'; $_['button_filter'] = 'Refine Search'; $_['button_new_address'] = 'New Address'; $_['button_change_address'] = 'Change Address'; $_['button_reviews'] = 'Reviews'; $_['button_write'] = 'Write Review'; $_['button_login'] = 'Login'; $_['button_update'] = 'Update'; $_['button_remove'] = 'Remove'; $_['button_reorder'] = 'Reorder'; $_['button_return'] = 'Return'; $_['button_shopping'] = 'Continue Shopping'; $_['button_search'] = 'Search'; $_['button_shipping'] = 'Apply Shipping'; $_['button_submit'] = 'Submit'; $_['button_guest'] = 'Guest Checkout'; $_['button_view'] = 'View'; $_['button_voucher'] = 'Apply Gift Certificate'; $_['button_upload'] = 'Upload File'; $_['button_reward'] = 'Apply Points'; $_['button_quote'] = 'Get Quotes'; $_['button_list'] = 'List'; $_['button_grid'] = 'Grid'; $_['button_map'] = 'View Google Map'; // Error $_['error_exception'] = 'Error Code(%s): %s in %s on line %s'; $_['error_upload_1'] = 'Warning: The uploaded file exceeds the upload_max_filesize directive in php.ini!'; $_['error_upload_2'] = 'Warning: The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form!'; $_['error_upload_3'] = 'Warning: The uploaded file was only partially uploaded!'; $_['error_upload_4'] = 'Warning: No file was uploaded!'; $_['error_upload_6'] = 'Warning: Missing a temporary folder!'; $_['error_upload_7'] = 'Warning: Failed to write file to disk!'; $_['error_upload_8'] = 'Warning: File upload stopped by extension!'; $_['error_upload_999'] = 'Warning: No error code available!'; $_['error_curl'] = 'CURL: Error Code(%s): %s'; /* When doing translations only include the matching language code */ // Datepicker //$_['datepicker'] = 'af'; //$_['datepicker'] = 'ar-dz'; //$_['datepicker'] = 'ar-kw'; //$_['datepicker'] = 'ar-ly'; //$_['datepicker'] = 'ar-ma'; //$_['datepicker'] = 'ar-sa'; //$_['datepicker'] = 'ar-tn'; //$_['datepicker'] = 'ar'; //$_['datepicker'] = 'az'; //$_['datepicker'] = 'be'; //$_['datepicker'] = 'bg'; //$_['datepicker'] = 'bn'; //$_['datepicker'] = 'bo'; //$_['datepicker'] = 'br'; //$_['datepicker'] = 'bs'; //$_['datepicker'] = 'ca'; //$_['datepicker'] = 'cs'; //$_['datepicker'] = 'cv'; //$_['datepicker'] = 'cy'; //$_['datepicker'] = 'da'; //$_['datepicker'] = 'de-at'; //$_['datepicker'] = 'de-ch'; //$_['datepicker'] = 'de'; //$_['datepicker'] = 'dv'; //$_['datepicker'] = 'el'; //$_['datepicker'] = 'en-au'; //$_['datepicker'] = 'en-ca'; $_['datepicker'] = 'en-gb'; //$_['datepicker'] = 'en-ie'; //$_['datepicker'] = 'en-nz'; //$_['datepicker'] = 'eo'; //$_['datepicker'] = 'es-do'; //$_['datepicker'] = 'es'; //$_['datepicker'] = 'et'; //$_['datepicker'] = 'eu'; //$_['datepicker'] = 'fa'; //$_['datepicker'] = 'fi'; //$_['datepicker'] = 'fo'; //$_['datepicker'] = 'fr-ca'; //$_['datepicker'] = 'fr-ch'; //$_['datepicker'] = 'fr'; //$_['datepicker'] = 'fy'; //$_['datepicker'] = 'gd'; //$_['datepicker'] = 'gl'; //$_['datepicker'] = 'gom-latn'; //$_['datepicker'] = 'he'; //$_['datepicker'] = 'hi'; //$_['datepicker'] = 'hr'; //$_['datepicker'] = 'hu'; //$_['datepicker'] = 'hy-am'; //$_['datepicker'] = 'id'; //$_['datepicker'] = 'is'; //$_['datepicker'] = 'it'; //$_['datepicker'] = 'ja'; //$_['datepicker'] = 'jv'; //$_['datepicker'] = 'ka'; //$_['datepicker'] = 'kk'; //$_['datepicker'] = 'km'; //$_['datepicker'] = 'kn'; //$_['datepicker'] = 'ko'; //$_['datepicker'] = 'ky'; //$_['datepicker'] = 'lb'; //$_['datepicker'] = 'lo'; //$_['datepicker'] = 'lt'; //$_['datepicker'] = 'lv'; //$_['datepicker'] = 'me'; //$_['datepicker'] = 'mi'; //$_['datepicker'] = 'mk'; //$_['datepicker'] = 'ml'; //$_['datepicker'] = 'mr'; //$_['datepicker'] = 'ms-my'; //$_['datepicker'] = 'ms'; //$_['datepicker'] = 'my'; //$_['datepicker'] = 'nb'; //$_['datepicker'] = 'ne'; //$_['datepicker'] = 'nl-be'; //$_['datepicker'] = 'nl'; //$_['datepicker'] = 'nn'; //$_['datepicker'] = 'pa-in'; //$_['datepicker'] = 'pl'; //$_['datepicker'] = 'pt-br'; //$_['datepicker'] = 'pt'; //$_['datepicker'] = 'ro'; //$_['datepicker'] = 'ru'; //$_['datepicker'] = 'sd'; //$_['datepicker'] = 'se'; //$_['datepicker'] = 'si'; //$_['datepicker'] = 'sk'; //$_['datepicker'] = 'sl'; //$_['datepicker'] = 'sq'; //$_['datepicker'] = 'sr-cyrl'; //$_['datepicker'] = 'sr'; //$_['datepicker'] = 'ss'; //$_['datepicker'] = 'sv'; //$_['datepicker'] = 'sw'; //$_['datepicker'] = 'ta'; //$_['datepicker'] = 'te'; //$_['datepicker'] = 'tet'; //$_['datepicker'] = 'th'; //$_['datepicker'] = 'tl-ph'; //$_['datepicker'] = 'tlh'; //$_['datepicker'] = 'tr'; //$_['datepicker'] = 'tzl'; //$_['datepicker'] = 'tzm-latn'; //$_['datepicker'] = 'tzm'; //$_['datepicker'] = 'uk'; //$_['datepicker'] = 'ur'; //$_['datepicker'] = 'uz-latn'; //$_['datepicker'] = 'uz'; //$_['datepicker'] = 'vi'; //$_['datepicker'] = 'x-pseudo'; //$_['datepicker'] = 'yo'; //$_['datepicker'] = 'zh-cn'; //$_['datepicker'] = 'zh-hk'; //$_['datepicker'] = 'zh-tw';
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I'm not using a text editor. I'm editing in the back end using OC's Language Editorstraightlight wrote: ↑Thu Sep 23, 2021 9:06 amYou need to ensure you are using a text editor supporting UTF-8 without BOM such as: Notepad++ . However, you also need to cover this post first as this seem to be the same issue: viewtopic.php?f=202&t=204081#p829044
See if that solution works: viewtopic.php?f=202&t=206449&p=786660&h ... er#p786660 . If not, try with an external editor with UTF-8 without BOM encoding and re-upload the file and noticing the difference.CJC wrote: ↑Thu Sep 23, 2021 9:53 amI'm not using a text editor. I'm editing in the back end using OC's Language Editorstraightlight wrote: ↑Thu Sep 23, 2021 9:06 amYou need to ensure you are using a text editor supporting UTF-8 without BOM such as: Notepad++ . However, you also need to cover this post first as this seem to be the same issue: viewtopic.php?f=202&t=204081#p829044
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
There is an issue with the way the language is loaded for the order emails. It uses $language->load to load the language files. This doesn't trigger the translation event so your changes aren't used. The admin alert email should work as that uses $this->load->language.CJC wrote: ↑Thu Sep 23, 2021 2:26 amHello,
I'm trying to change the date format on order emails (both to the customer and store owner). I've modified the language file to make the changes but they don't have any effect. I've emptied the caches and refreshed the mods as well. Does something else need to be changed?
OC 3.0.3.7 - default template
There is also another couple of issues that affect the loading of catalog/language/en-gb/en-gb.php. First, although it is set to auto load in framework.php, it never gets loaded because $this->load->language sanitises the route, so it tries to load engb.php. Which doesn't exist.
Next, when the second attempt is made to load en-gb.php (order another language) startup.php. $language->load is used, which again doesn't trigger the translation event. It's only when a controller loads another language file that the translations finally get loaded.
It would require some thought to get this working. I think you would be best just edition the language file directly.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thank you for the detailed response. I'm glad that I wasn't doing something incorrectly. This does seem like a big miss and I'm surprised it is still a problem so far along in the 3.x release stream.ADD Creative wrote: ↑Thu Sep 23, 2021 6:53 pmThere is an issue with the way the language is loaded for the order emails. It uses $language->load to load the language files. This doesn't trigger the translation event so your changes aren't used. The admin alert email should work as that uses $this->load->language.
There is also another couple of issues that affect the loading of catalog/language/en-gb/en-gb.php. First, although it is set to auto load in framework.php, it never gets loaded because $this->load->language sanitises the route, so it tries to load engb.php. Which doesn't exist.
Next, when the second attempt is made to load en-gb.php (order another language) startup.php. $language->load is used, which again doesn't trigger the translation event. It's only when a controller loads another language file that the translations finally get loaded.
It would require some thought to get this working. I think you would be best just edition the language file directly.
Users browsing this forum: No registered users and 519 guests