-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt load_config hook to fallback to english if no valid language is
present Move CI system language files back to their correct location (form_validation_lang) Add upload_lang.php and email_lang.php to system files (default english version for the time being) Add account_number check when importing customer data from excel Avoid unnecessary calls to check_item_number when importing items from excel
- Loading branch information
Showing
27 changed files
with
410 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); | ||
|
||
class MY_Lang extends CI_Lang | ||
{ | ||
|
||
function MY_Lang() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
function switch_to( $idiom ) | ||
{ | ||
$CI =& get_instance(); | ||
if( is_string( $idiom ) ) | ||
{ | ||
$CI->config->set_item( 'language', $idiom ); | ||
$loaded = $this->is_loaded; | ||
$this->is_loaded = array(); | ||
|
||
foreach($loaded as $file) | ||
{ | ||
$this->load( str_replace( '_lang.php', '', $file ) ); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Fetch a single line of text from the language array. Takes variable number | ||
* of arguments and supports wildcards in the form of '%1', '%2', etc. | ||
* Overloaded function. | ||
* | ||
* @access public | ||
* @return mixed false if not found or the language string | ||
*/ | ||
function line($line = '') | ||
{ | ||
//get the arguments passed to the function | ||
$args = func_get_args(); | ||
|
||
//count the number of arguments | ||
$c = count($args); | ||
|
||
//if one or more arguments, perform the necessary processing | ||
if ($c) | ||
{ | ||
//first argument should be the actual language line key | ||
//so remove it from the array (pop from front) | ||
$line = array_shift($args); | ||
|
||
//check to make sure the key is valid and load the line | ||
if ($line == '') | ||
{ | ||
$line = FALSE; | ||
} | ||
else | ||
{ | ||
if (isset($this->language[$line])) | ||
{ | ||
$line = $this->language[$line]; | ||
//if the line exists and more function arguments remain | ||
//perform wildcard replacements | ||
if ($args) | ||
{ | ||
$i = 1; | ||
foreach ($args as $arg) | ||
{ | ||
$line = preg_replace('/\%'.$i.'/', $arg, $line); | ||
$i++; | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
// just return label name (with TBD) | ||
$line = $line . ' (TBD)'; | ||
log_message('error', 'Could not find the language line "'.$line.'"'); | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
//if no arguments given, no language line available | ||
$line = false; | ||
} | ||
|
||
return $line; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
$lang['email_must_be_array'] = "The email validation method must be passed an array."; | ||
$lang['email_invalid_address'] = "Invalid email address: %s"; | ||
$lang['email_attachment_missing'] = "Unable to locate the following email attachment: %s"; | ||
$lang['email_attachment_unreadable'] = "Unable to open this attachment: %s"; | ||
$lang['email_no_recipients'] = "You must include recipients: To, Cc, or Bcc"; | ||
$lang['email_send_failure_phpmail'] = "Unable to send email using PHP mail(). Your server might not be configured to send mail using this method."; | ||
$lang['email_send_failure_sendmail'] = "Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method."; | ||
$lang['email_send_failure_smtp'] = "Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method."; | ||
$lang['email_sent'] = "Your message has been successfully sent using the following protocol: %s"; | ||
$lang['email_no_socket'] = "Unable to open a socket to Sendmail. Please check settings."; | ||
$lang['email_no_hostname'] = "You did not specify a SMTP hostname."; | ||
$lang['email_smtp_error'] = "The following SMTP error was encountered: %s"; | ||
$lang['email_no_smtp_unpw'] = "Error: You must assign a SMTP username and password."; | ||
$lang['email_failed_smtp_login'] = "Failed to send AUTH LOGIN command. Error: %s"; | ||
$lang['email_smtp_auth_un'] = "Failed to authenticate username. Error: %s"; | ||
$lang['email_smtp_auth_pw'] = "Failed to authenticate password. Error: %s"; | ||
$lang['email_smtp_data_failure'] = "Unable to send data: %s"; | ||
$lang['email_exit_status'] = "Exit status code: %s"; | ||
|
||
|
||
/* End of file email_lang.php */ | ||
/* Location: ./system/language/english/email_lang.php */ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
$lang['upload_userfile_not_set'] = "Unable to find a post variable called userfile."; | ||
$lang['upload_file_exceeds_limit'] = "The uploaded file exceeds the maximum allowed size in your PHP configuration file."; | ||
$lang['upload_file_exceeds_form_limit'] = "The uploaded file exceeds the maximum size allowed by the submission form."; | ||
$lang['upload_file_partial'] = "The file was only partially uploaded."; | ||
$lang['upload_no_temp_directory'] = "The temporary folder is missing."; | ||
$lang['upload_unable_to_write_file'] = "The file could not be written to disk."; | ||
$lang['upload_stopped_by_extension'] = "The file upload was stopped by extension."; | ||
$lang['upload_no_file_selected'] = "You did not select a file to upload."; | ||
$lang['upload_invalid_filetype'] = "The filetype you are attempting to upload is not allowed."; | ||
$lang['upload_invalid_filesize'] = "The file you are attempting to upload is larger than the permitted size."; | ||
$lang['upload_invalid_dimensions'] = "The image you are attempting to upload exceeds the maximum height or width."; | ||
$lang['upload_destination_error'] = "A problem was encountered while attempting to move the uploaded file to the final destination."; | ||
$lang['upload_no_filepath'] = "The upload path does not appear to be valid."; | ||
$lang['upload_no_file_types'] = "You have not specified any allowed file types."; | ||
$lang['upload_bad_filename'] = "The file name you submitted already exists on the server."; | ||
$lang['upload_not_writable'] = "The upload destination folder does not appear to be writable."; | ||
|
||
|
||
/* End of file upload_lang.php */ | ||
/* Location: ./system/language/english/upload_lang.php */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
$lang['email_must_be_array'] = "The email validation method must be passed an array."; | ||
$lang['email_invalid_address'] = "Invalid email address: %s"; | ||
$lang['email_attachment_missing'] = "Unable to locate the following email attachment: %s"; | ||
$lang['email_attachment_unreadable'] = "Unable to open this attachment: %s"; | ||
$lang['email_no_recipients'] = "You must include recipients: To, Cc, or Bcc"; | ||
$lang['email_send_failure_phpmail'] = "Unable to send email using PHP mail(). Your server might not be configured to send mail using this method."; | ||
$lang['email_send_failure_sendmail'] = "Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method."; | ||
$lang['email_send_failure_smtp'] = "Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method."; | ||
$lang['email_sent'] = "Your message has been successfully sent using the following protocol: %s"; | ||
$lang['email_no_socket'] = "Unable to open a socket to Sendmail. Please check settings."; | ||
$lang['email_no_hostname'] = "You did not specify a SMTP hostname."; | ||
$lang['email_smtp_error'] = "The following SMTP error was encountered: %s"; | ||
$lang['email_no_smtp_unpw'] = "Error: You must assign a SMTP username and password."; | ||
$lang['email_failed_smtp_login'] = "Failed to send AUTH LOGIN command. Error: %s"; | ||
$lang['email_smtp_auth_un'] = "Failed to authenticate username. Error: %s"; | ||
$lang['email_smtp_auth_pw'] = "Failed to authenticate password. Error: %s"; | ||
$lang['email_smtp_data_failure'] = "Unable to send data: %s"; | ||
$lang['email_exit_status'] = "Exit status code: %s"; | ||
|
||
|
||
/* End of file email_lang.php */ | ||
/* Location: ./system/language/english/email_lang.php */ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
$lang['upload_userfile_not_set'] = "Unable to find a post variable called userfile."; | ||
$lang['upload_file_exceeds_limit'] = "The uploaded file exceeds the maximum allowed size in your PHP configuration file."; | ||
$lang['upload_file_exceeds_form_limit'] = "The uploaded file exceeds the maximum size allowed by the submission form."; | ||
$lang['upload_file_partial'] = "The file was only partially uploaded."; | ||
$lang['upload_no_temp_directory'] = "The temporary folder is missing."; | ||
$lang['upload_unable_to_write_file'] = "The file could not be written to disk."; | ||
$lang['upload_stopped_by_extension'] = "The file upload was stopped by extension."; | ||
$lang['upload_no_file_selected'] = "You did not select a file to upload."; | ||
$lang['upload_invalid_filetype'] = "The filetype you are attempting to upload is not allowed."; | ||
$lang['upload_invalid_filesize'] = "The file you are attempting to upload is larger than the permitted size."; | ||
$lang['upload_invalid_dimensions'] = "The image you are attempting to upload exceeds the maximum height or width."; | ||
$lang['upload_destination_error'] = "A problem was encountered while attempting to move the uploaded file to the final destination."; | ||
$lang['upload_no_filepath'] = "The upload path does not appear to be valid."; | ||
$lang['upload_no_file_types'] = "You have not specified any allowed file types."; | ||
$lang['upload_bad_filename'] = "The file name you submitted already exists on the server."; | ||
$lang['upload_not_writable'] = "The upload destination folder does not appear to be writable."; | ||
|
||
|
||
/* End of file upload_lang.php */ | ||
/* Location: ./system/language/english/upload_lang.php */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
<html> | ||
<head> | ||
<title>403 Forbidden</title> | ||
</head> | ||
<body> | ||
<?php | ||
|
||
<p>Directory access is forbidden.</p> | ||
$lang['email_must_be_array'] = "The email validation method must be passed an array."; | ||
$lang['email_invalid_address'] = "Invalid email address: %s"; | ||
$lang['email_attachment_missing'] = "Unable to locate the following email attachment: %s"; | ||
$lang['email_attachment_unreadable'] = "Unable to open this attachment: %s"; | ||
$lang['email_no_recipients'] = "You must include recipients: To, Cc, or Bcc"; | ||
$lang['email_send_failure_phpmail'] = "Unable to send email using PHP mail(). Your server might not be configured to send mail using this method."; | ||
$lang['email_send_failure_sendmail'] = "Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method."; | ||
$lang['email_send_failure_smtp'] = "Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method."; | ||
$lang['email_sent'] = "Your message has been successfully sent using the following protocol: %s"; | ||
$lang['email_no_socket'] = "Unable to open a socket to Sendmail. Please check settings."; | ||
$lang['email_no_hostname'] = "You did not specify a SMTP hostname."; | ||
$lang['email_smtp_error'] = "The following SMTP error was encountered: %s"; | ||
$lang['email_no_smtp_unpw'] = "Error: You must assign a SMTP username and password."; | ||
$lang['email_failed_smtp_login'] = "Failed to send AUTH LOGIN command. Error: %s"; | ||
$lang['email_smtp_auth_un'] = "Failed to authenticate username. Error: %s"; | ||
$lang['email_smtp_auth_pw'] = "Failed to authenticate password. Error: %s"; | ||
$lang['email_smtp_data_failure'] = "Unable to send data: %s"; | ||
$lang['email_exit_status'] = "Exit status code: %s"; | ||
|
||
</body> | ||
</html> | ||
|
||
/* End of file email_lang.php */ | ||
/* Location: ./system/language/english/email_lang.php */ |
Oops, something went wrong.