Skip to content

Commit

Permalink
Merge pull request #6474 from tangix/fix-lang-consistency-2
Browse files Browse the repository at this point in the history
Fix consistency in language strings
  • Loading branch information
kenjis committed Sep 2, 2022
2 parents 7c610bf + be32309 commit 24e16a1
Show file tree
Hide file tree
Showing 35 changed files with 81 additions and 80 deletions.
8 changes: 4 additions & 4 deletions system/Language/en/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
'commandType' => 'Command type',
'databaseGroup' => 'Database group',
'fileCreate' => 'File created: {0}',
'fileError' => 'Error while creating file: {0}',
'fileExist' => 'File exists: {0}',
'fileOverwrite' => 'File overwritten: {0}',
'fileError' => 'Error while creating file: "{0}"',
'fileExist' => 'File exists: "{0}"',
'fileOverwrite' => 'File overwritten: "{0}"',
'parentClass' => 'Parent class',
'returnType' => 'Return type',
'tableName' => 'Table name',
Expand All @@ -43,6 +43,6 @@
'helpDescription' => 'Description:',
'helpOptions' => 'Options:',
'helpUsage' => 'Usage:',
'invalidColor' => 'Invalid {0} color: {1}.',
'invalidColor' => 'Invalid "{0}" color: "{1}".',
'namespaceNotDefined' => 'Namespace "{0}" is not defined.',
];
2 changes: 1 addition & 1 deletion system/Language/en/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// Cache language settings
return [
'unableToWrite' => 'Cache unable to write to {0}.',
'unableToWrite' => 'Cache unable to write to "{0}".',
'invalidHandlers' => 'Cache config must have an array of $validHandlers.',
'noBackup' => 'Cache config must have a handler and backupHandler set.',
'handlerNotFound' => 'Cache config has an invalid handler or backup handler specified.',
Expand Down
8 changes: 4 additions & 4 deletions system/Language/en/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

// Core language settings
return [
'copyError' => 'An error was encountered while attempting to replace the file ({0}). Please make sure your file directory is writable.',
'copyError' => 'An error was encountered while attempting to replace the file "{0}". Please make sure your file directory is writable.',
'enabledZlibOutputCompression' => 'Your zlib.output_compression ini directive is turned on. This will not work well with output buffers.',
'invalidFile' => 'Invalid file: {0}',
'invalidFile' => 'Invalid file: "{0}"',
'invalidPhpVersion' => 'Your PHP version must be {0} or higher to run CodeIgniter. Current version: {1}',
'missingExtension' => 'The framework needs the following extension(s) installed and loaded: {0}.',
'noHandlers' => '{0} must provide at least one Handler.',
'missingExtension' => 'The framework needs the following extension(s) installed and loaded: "{0}".',
'noHandlers' => '"{0}" must provide at least one Handler.',
];
18 changes: 9 additions & 9 deletions system/Language/en/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

// Database language settings
return [
'invalidEvent' => '{0} is not a valid Model Event callback.',
'invalidArgument' => 'You must provide a valid {0}.',
'invalidAllowedFields' => 'Allowed fields must be specified for model: {0}',
'invalidEvent' => '"{0}" is not a valid Model Event callback.',
'invalidArgument' => 'You must provide a valid "{0}".',
'invalidAllowedFields' => 'Allowed fields must be specified for model: "{0}"',
'emptyDataset' => 'There is no data to {0}.',
'emptyPrimaryKey' => 'There is no primary key defined when trying to make {0}.',
'failGetFieldData' => 'Failed to get field data from database.',
'failGetIndexData' => 'Failed to get index data from database.',
'failGetForeignKeyData' => 'Failed to get foreign key data from database.',
'parseStringFail' => 'Parsing key string failed.',
'featureUnavailable' => 'This feature is not available for the database you are using.',
'tableNotFound' => 'Table `{0}` was not found in the current database.',
'noPrimaryKey' => '`{0}` model class does not specify a Primary Key.',
'noDateFormat' => '`{0}` model class does not have a valid dateFormat.',
'fieldNotExists' => 'Field `{0}` not found.',
'forEmptyInputGiven' => 'Empty statement is given for the field `{0}`',
'tableNotFound' => 'Table "{0}" was not found in the current database.',
'noPrimaryKey' => '"{0}" model class does not specify a Primary Key.',
'noDateFormat' => '"{0}" model class does not have a valid dateFormat.',
'fieldNotExists' => 'Field "{0}" not found.',
'forEmptyInputGiven' => 'Empty statement is given for the field "{0}"',
'forFindColumnHaveMultipleColumns' => 'Only single column allowed in Column name.',
'methodNotAvailable' => 'You cannot use `{1}` in `{0}`. This is a method of the `Query Builder` class.',
'methodNotAvailable' => 'You cannot use "{1}" in "{0}". This is a method of the Query Builder Class.',
];
6 changes: 3 additions & 3 deletions system/Language/en/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// Email language settings
return [
'mustBeArray' => 'The email validation method must be passed an array.',
'invalidAddress' => 'Invalid email address: {0}',
'attachmentMissing' => 'Unable to locate the following email attachment: {0}',
'attachmentUnreadable' => 'Unable to open this attachment: {0}',
'invalidAddress' => 'Invalid email address: "{0}"',
'attachmentMissing' => 'Unable to locate the following email attachment: "{0}"',
'attachmentUnreadable' => 'Unable to open this attachment: "{0}"',
'noFrom' => 'Cannot send mail with no "From" header.',
'noRecipients' => 'You must include recipients: To, Cc, or Bcc',
'sendFailurePHPMail' => 'Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.',
Expand Down
2 changes: 1 addition & 1 deletion system/Language/en/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Encryption language settings
return [
'noDriverRequested' => 'No driver requested; Miss Daisy will be so upset!',
'noHandlerAvailable' => 'Unable to find an available {0} encryption handler.',
'noHandlerAvailable' => 'Unable to find an available "{0}" encryption handler.',
'unKnownHandler' => '"{0}" cannot be configured.',
'starterKeyNeeded' => 'Encrypter needs a starter key.',
'authenticationFailed' => 'Decrypting: authentication failed.',
Expand Down
2 changes: 1 addition & 1 deletion system/Language/en/Fabricator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
return [
'invalidModel' => 'Invalid model supplied for fabrication.',
'missingFormatters' => 'No valid formatters defined.',
'createFailed' => 'Fabricator failed to insert on table {0}: {1}',
'createFailed' => 'Fabricator failed to insert on table "{0}": {1}',
];
4 changes: 2 additions & 2 deletions system/Language/en/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

// Files language settings
return [
'fileNotFound' => 'File not found: {0}',
'cannotMove' => 'Could not move file {0} to {1} ({2}).',
'fileNotFound' => 'File not found: "{0}"',
'cannotMove' => 'Could not move file "{0}" to "{1}". Reason: {2}',
'expectedDirectory' => '{0} expects a valid directory.',
'expectedFile' => '{0} expects a valid file.',
];
4 changes: 2 additions & 2 deletions system/Language/en/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

// Filters language settings
return [
'noFilter' => '{0} filter must have a matching alias defined.',
'incorrectInterface' => '{0} must implement CodeIgniter\Filters\FilterInterface.',
'noFilter' => '"{0}" filter must have a matching alias defined.',
'incorrectInterface' => '"{0}" must implement CodeIgniter\Filters\FilterInterface.',
];
2 changes: 1 addition & 1 deletion system/Language/en/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Format language settings
return [
'invalidFormatter' => '"{0}" is not a valid Formatter class.',
'invalidJSON' => 'Failed to parse json string, error: "{0}".',
'invalidJSON' => 'Failed to parse JSON string. Error: {0}',
'invalidMime' => 'No Formatter defined for mime type: "{0}".',
'missingExtension' => 'The SimpleXML extension is required to format XML.',
];
16 changes: 8 additions & 8 deletions system/Language/en/HTTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
return [
// CurlRequest
'missingCurl' => 'CURL must be enabled to use the CURLRequest class.',
'invalidSSLKey' => 'Cannot set SSL Key. {0} is not a valid file.',
'sslCertNotFound' => 'SSL certificate not found at: {0}',
'invalidSSLKey' => 'Cannot set SSL Key. "{0}" is not a valid file.',
'sslCertNotFound' => 'SSL certificate not found at: "{0}"',
'curlError' => '{0} : {1}',

// IncomingRequest
'invalidNegotiationType' => '{0} is not a valid negotiation type. Must be one of: media, charset, encoding, language.',
'invalidNegotiationType' => '"{0}" is not a valid negotiation type. Must be one of: media, charset, encoding, language.',

// Message
'invalidHTTPProtocol' => 'Invalid HTTP Protocol Version. Must be one of: {0}',
Expand All @@ -31,7 +31,7 @@

// DownloadResponse
'cannotSetBinary' => 'When setting filepath cannot set binary.',
'cannotSetFilepath' => 'When setting binary cannot set filepath: {0}',
'cannotSetFilepath' => 'When setting binary cannot set filepath: "{0}"',
'notFoundDownloadSource' => 'Not found download body source.',
'cannotSetCache' => 'It does not support caching for downloading.',
'cannotSetStatusCode' => 'It does not support change status code for downloading. code: {0}, reason: {1}',
Expand All @@ -42,16 +42,16 @@
'unknownStatusCode' => 'Unknown HTTP status code provided with no message: {0}',

// URI
'cannotParseURI' => 'Unable to parse URI: {0}',
'segmentOutOfRange' => 'Request URI segment is out of range: {0}',
'cannotParseURI' => 'Unable to parse URI: "{0}"',
'segmentOutOfRange' => 'Request URI segment is out of range: "{0}"',
'invalidPort' => 'Ports must be between 0 and 65535. Given: {0}',
'malformedQueryString' => 'Query strings may not include URI fragments.',

// Page Not Found
'pageNotFound' => 'Page Not Found',
'emptyController' => 'No Controller specified.',
'controllerNotFound' => 'Controller or its method is not found: {0}::{1}',
'methodNotFound' => 'Controller method is not found: {0}',
'methodNotFound' => 'Controller method is not found: "{0}"',
'localeNotSupported' => 'Locale is not supported: {0}',

// CSRF
Expand All @@ -61,7 +61,7 @@
// Uploaded file moving
'alreadyMoved' => 'The uploaded file has already been moved.',
'invalidFile' => 'The original file is not a valid file.',
'moveFailed' => 'Could not move file {0} to {1} ({2})',
'moveFailed' => 'Could not move file "{0}" to "{1}". Reason: {2}',

'uploadErrOk' => 'The file uploaded with success.',
'uploadErrIniSize' => 'The file "%s" exceeds your upload_max_filesize ini directive.',
Expand Down
4 changes: 2 additions & 2 deletions system/Language/en/Images.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
'unsupportedImageCreate' => 'Your server does not support the GD function required to process this type of image.',
'jpgOrPngRequired' => 'The image resize protocol specified in your preferences only works with JPEG or PNG image types.',
'rotateUnsupported' => 'Image rotation does not appear to be supported by your server.',
'libPathInvalid' => 'The path to your image library is not correct. Please set the correct path in your image preferences. {0}',
'libPathInvalid' => 'The path to your image library is not correct. Please set the correct path in your image preferences. "{0}"',
'imageProcessFailed' => 'Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct.',
'rotationAngleRequired' => 'An angle of rotation is required to rotate the image.',
'invalidPath' => 'The path to the image is not correct.',
'copyFailed' => 'The image copy routine failed.',
'missingFont' => 'Unable to find a font to use.',
'saveFailed' => 'Unable to save the image. Please make sure the image and file directory are writable.',
'invalidDirection' => 'Flip direction can be only `vertical` or `horizontal`. Given: {0}',
'invalidDirection' => 'Flip direction can be only "vertical" or "horizontal". Given: "{0}"',
'exifNotSupported' => 'Reading EXIF data is not supported by this PHP installation.',
];
2 changes: 1 addition & 1 deletion system/Language/en/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

// Log language settings
return [
'invalidLogLevel' => '{0} is an invalid log level.',
'invalidLogLevel' => '"{0}" is an invalid log level.',
'invalidMessageType' => 'The given message type "{0}" is not supported.',
];
4 changes: 2 additions & 2 deletions system/Language/en/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
'last' => 'Last',
'older' => 'Older',
'newer' => 'Newer',
'invalidTemplate' => '{0} is not a valid Pager template.',
'invalidPaginationGroup' => '{0} is not a valid Pagination group.',
'invalidTemplate' => '"{0}" is not a valid Pager template.',
'invalidPaginationGroup' => '"{0}" is not a valid Pagination group.',
];
10 changes: 5 additions & 5 deletions system/Language/en/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

// Publisher language settings
return [
'collision' => 'Publisher encountered an unexpected {0} while copying {1} to {2}.',
'destinationNotAllowed' => 'Destination is not on the allowed list of Publisher directories: {0}',
'fileNotAllowed' => '{0} fails the following restriction for {1}: {2}',
'collision' => 'Publisher encountered an unexpected "{0}" while copying "{1}" to "{2}".',
'destinationNotAllowed' => 'Destination is not on the allowed list of Publisher directories: "{0}"',
'fileNotAllowed' => '"{0}" fails the following restriction for "{1}": {2}',

// Publish Command
'publishMissing' => 'No Publisher classes detected in {0} across all namespaces.',
'publishSuccess' => '{0} published {1} file(s) to {2}.',
'publishFailure' => '{0} failed to publish to {1}!',
'publishSuccess' => '"{0}" published {1} file(s) to "{2}".',
'publishFailure' => '"{0}" failed to publish to "{1}".',
];
4 changes: 2 additions & 2 deletions system/Language/en/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
return [
'invalidParameter' => 'A parameter does not match the expected type.',
'missingDefaultRoute' => 'Unable to determine what should be displayed. A default route has not been specified in the routing file.',
'invalidDynamicController' => 'A dynamic controller is not allowed for security reasons. Route handler: {0}',
'invalidControllerName' => 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: {0}',
'invalidDynamicController' => 'A dynamic controller is not allowed for security reasons. Route handler: "{0}"',
'invalidControllerName' => 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: "{0}"',
];
2 changes: 1 addition & 1 deletion system/Language/en/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
'disallowedAction' => 'The action you requested is not allowed.',

// @deprecated
'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: {0}',
'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: "{0}"',
];
4 changes: 2 additions & 2 deletions system/Language/en/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
'invalidSavePath' => 'Session: Configured save path "{0}" is not a directory, does not exist or cannot be created.',
'writeProtectedSavePath' => 'Session: Configured save path "{0}" is not writable by the PHP process.',
'emptySavePath' => 'Session: No save path configured.',
'invalidSavePathFormat' => 'Session: Invalid Redis save path format: {0}',
'invalidSavePathFormat' => 'Session: Invalid Redis save path format: "{0}"',

// @deprecated
'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: {0}',
'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: "{0}"',
];
2 changes: 1 addition & 1 deletion system/Language/en/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

// Testing language settings
return [
'invalidMockClass' => '{0} is not a valid Mock class',
'invalidMockClass' => '"{0}" is not a valid Mock class',
];
12 changes: 6 additions & 6 deletions system/Language/en/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// Validation language settings
return [
// Core Messages
'noRuleSets' => 'No rulesets specified in Validation configuration.',
'ruleNotFound' => '{0} is not a valid rule.',
'groupNotFound' => '{0} is not a validation rules group.',
'groupNotArray' => '{0} rule group must be an array.',
'invalidTemplate' => '{0} is not a valid Validation template.',
'noRuleSets' => 'No rule sets specified in Validation configuration.',
'ruleNotFound' => '"{0}" is not a valid rule.',
'groupNotFound' => '"{0}" is not a validation rules group.',
'groupNotArray' => '"{0}" rule group must be an array.',
'invalidTemplate' => '"{0}" is not a valid Validation template.',

// Rule Messages
'alpha' => 'The {field} field may only contain alphabetical characters.',
Expand All @@ -31,7 +31,7 @@
'exact_length' => 'The {field} field must be exactly {param} characters in length.',
'greater_than' => 'The {field} field must contain a number greater than {param}.',
'greater_than_equal_to' => 'The {field} field must contain a number greater than or equal to {param}.',
'hex' => 'The {field} field may only contain hexidecimal characters.',
'hex' => 'The {field} field may only contain hexadecimal characters.',
'in_list' => 'The {field} field must be one of: {param}.',
'integer' => 'The {field} field must contain an integer.',
'is_natural' => 'The {field} field must only contain digits.',
Expand Down
8 changes: 4 additions & 4 deletions system/Language/en/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
return [
'invalidCellMethod' => '{class}::{method} is not a valid method.',
'missingCellParameters' => '{class}::{method} has no params.',
'invalidCellParameter' => '{0} is not a valid param name.',
'invalidCellParameter' => '"{0}" is not a valid param name.',
'noCellClass' => 'No view cell class provided.',
'invalidCellClass' => 'Unable to locate view cell class: {0}.',
'tagSyntaxError' => 'You have a syntax error in your Parser tags: {0}',
'invalidDecoratorClass' => '{0} is not a valid View Decorator.',
'invalidCellClass' => 'Unable to locate view cell class: "{0}".',
'tagSyntaxError' => 'You have a syntax error in your Parser tags: "{0}"',
'invalidDecoratorClass' => '"{0}" is not a valid View Decorator.',
];
4 changes: 2 additions & 2 deletions tests/system/CLI/CLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ public function testNewLine()
public function testColorExceptionForeground()
{
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Invalid foreground color: Foreground');
$this->expectExceptionMessage('Invalid "foreground" color: "Foreground"');

CLI::color('test', 'Foreground');
}

public function testColorExceptionBackground()
{
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Invalid background color: Background');
$this->expectExceptionMessage('Invalid "background" color: "Background"');

CLI::color('test', 'white', 'Background');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testCommandCall()
$command = new $commands['app:info']['class']($this->logger, $this->commands);

$command->bomb();
$this->assertStringContainsString('Invalid background color:', $this->getBuffer());
$this->assertStringContainsString('Invalid "background" color:', $this->getBuffer());
}

public function testAbstractCommand()
Expand Down
Loading

0 comments on commit 24e16a1

Please sign in to comment.