Skip to content

Commit 24e16a1

Browse files
authored
Merge pull request #6474 from tangix/fix-lang-consistency-2
Fix consistency in language strings
2 parents 7c610bf + be32309 commit 24e16a1

35 files changed

+81
-80
lines changed

system/Language/en/CLI.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
'commandType' => 'Command type',
3232
'databaseGroup' => 'Database group',
3333
'fileCreate' => 'File created: {0}',
34-
'fileError' => 'Error while creating file: {0}',
35-
'fileExist' => 'File exists: {0}',
36-
'fileOverwrite' => 'File overwritten: {0}',
34+
'fileError' => 'Error while creating file: "{0}"',
35+
'fileExist' => 'File exists: "{0}"',
36+
'fileOverwrite' => 'File overwritten: "{0}"',
3737
'parentClass' => 'Parent class',
3838
'returnType' => 'Return type',
3939
'tableName' => 'Table name',
@@ -43,6 +43,6 @@
4343
'helpDescription' => 'Description:',
4444
'helpOptions' => 'Options:',
4545
'helpUsage' => 'Usage:',
46-
'invalidColor' => 'Invalid {0} color: {1}.',
46+
'invalidColor' => 'Invalid "{0}" color: "{1}".',
4747
'namespaceNotDefined' => 'Namespace "{0}" is not defined.',
4848
];

system/Language/en/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// Cache language settings
1313
return [
14-
'unableToWrite' => 'Cache unable to write to {0}.',
14+
'unableToWrite' => 'Cache unable to write to "{0}".',
1515
'invalidHandlers' => 'Cache config must have an array of $validHandlers.',
1616
'noBackup' => 'Cache config must have a handler and backupHandler set.',
1717
'handlerNotFound' => 'Cache config has an invalid handler or backup handler specified.',

system/Language/en/Core.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
// Core language settings
1313
return [
14-
'copyError' => 'An error was encountered while attempting to replace the file ({0}). Please make sure your file directory is writable.',
14+
'copyError' => 'An error was encountered while attempting to replace the file "{0}". Please make sure your file directory is writable.',
1515
'enabledZlibOutputCompression' => 'Your zlib.output_compression ini directive is turned on. This will not work well with output buffers.',
16-
'invalidFile' => 'Invalid file: {0}',
16+
'invalidFile' => 'Invalid file: "{0}"',
1717
'invalidPhpVersion' => 'Your PHP version must be {0} or higher to run CodeIgniter. Current version: {1}',
18-
'missingExtension' => 'The framework needs the following extension(s) installed and loaded: {0}.',
19-
'noHandlers' => '{0} must provide at least one Handler.',
18+
'missingExtension' => 'The framework needs the following extension(s) installed and loaded: "{0}".',
19+
'noHandlers' => '"{0}" must provide at least one Handler.',
2020
];

system/Language/en/Database.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111

1212
// Database language settings
1313
return [
14-
'invalidEvent' => '{0} is not a valid Model Event callback.',
15-
'invalidArgument' => 'You must provide a valid {0}.',
16-
'invalidAllowedFields' => 'Allowed fields must be specified for model: {0}',
14+
'invalidEvent' => '"{0}" is not a valid Model Event callback.',
15+
'invalidArgument' => 'You must provide a valid "{0}".',
16+
'invalidAllowedFields' => 'Allowed fields must be specified for model: "{0}"',
1717
'emptyDataset' => 'There is no data to {0}.',
1818
'emptyPrimaryKey' => 'There is no primary key defined when trying to make {0}.',
1919
'failGetFieldData' => 'Failed to get field data from database.',
2020
'failGetIndexData' => 'Failed to get index data from database.',
2121
'failGetForeignKeyData' => 'Failed to get foreign key data from database.',
2222
'parseStringFail' => 'Parsing key string failed.',
2323
'featureUnavailable' => 'This feature is not available for the database you are using.',
24-
'tableNotFound' => 'Table `{0}` was not found in the current database.',
25-
'noPrimaryKey' => '`{0}` model class does not specify a Primary Key.',
26-
'noDateFormat' => '`{0}` model class does not have a valid dateFormat.',
27-
'fieldNotExists' => 'Field `{0}` not found.',
28-
'forEmptyInputGiven' => 'Empty statement is given for the field `{0}`',
24+
'tableNotFound' => 'Table "{0}" was not found in the current database.',
25+
'noPrimaryKey' => '"{0}" model class does not specify a Primary Key.',
26+
'noDateFormat' => '"{0}" model class does not have a valid dateFormat.',
27+
'fieldNotExists' => 'Field "{0}" not found.',
28+
'forEmptyInputGiven' => 'Empty statement is given for the field "{0}"',
2929
'forFindColumnHaveMultipleColumns' => 'Only single column allowed in Column name.',
30-
'methodNotAvailable' => 'You cannot use `{1}` in `{0}`. This is a method of the `Query Builder` class.',
30+
'methodNotAvailable' => 'You cannot use "{1}" in "{0}". This is a method of the Query Builder Class.',
3131
];

system/Language/en/Email.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// Email language settings
1313
return [
1414
'mustBeArray' => 'The email validation method must be passed an array.',
15-
'invalidAddress' => 'Invalid email address: {0}',
16-
'attachmentMissing' => 'Unable to locate the following email attachment: {0}',
17-
'attachmentUnreadable' => 'Unable to open this attachment: {0}',
15+
'invalidAddress' => 'Invalid email address: "{0}"',
16+
'attachmentMissing' => 'Unable to locate the following email attachment: "{0}"',
17+
'attachmentUnreadable' => 'Unable to open this attachment: "{0}"',
1818
'noFrom' => 'Cannot send mail with no "From" header.',
1919
'noRecipients' => 'You must include recipients: To, Cc, or Bcc',
2020
'sendFailurePHPMail' => 'Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.',

system/Language/en/Encryption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Encryption language settings
1313
return [
1414
'noDriverRequested' => 'No driver requested; Miss Daisy will be so upset!',
15-
'noHandlerAvailable' => 'Unable to find an available {0} encryption handler.',
15+
'noHandlerAvailable' => 'Unable to find an available "{0}" encryption handler.',
1616
'unKnownHandler' => '"{0}" cannot be configured.',
1717
'starterKeyNeeded' => 'Encrypter needs a starter key.',
1818
'authenticationFailed' => 'Decrypting: authentication failed.',

system/Language/en/Fabricator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
return [
1414
'invalidModel' => 'Invalid model supplied for fabrication.',
1515
'missingFormatters' => 'No valid formatters defined.',
16-
'createFailed' => 'Fabricator failed to insert on table {0}: {1}',
16+
'createFailed' => 'Fabricator failed to insert on table "{0}": {1}',
1717
];

system/Language/en/Files.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
// Files language settings
1313
return [
14-
'fileNotFound' => 'File not found: {0}',
15-
'cannotMove' => 'Could not move file {0} to {1} ({2}).',
14+
'fileNotFound' => 'File not found: "{0}"',
15+
'cannotMove' => 'Could not move file "{0}" to "{1}". Reason: {2}',
1616
'expectedDirectory' => '{0} expects a valid directory.',
1717
'expectedFile' => '{0} expects a valid file.',
1818
];

system/Language/en/Filters.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
// Filters language settings
1313
return [
14-
'noFilter' => '{0} filter must have a matching alias defined.',
15-
'incorrectInterface' => '{0} must implement CodeIgniter\Filters\FilterInterface.',
14+
'noFilter' => '"{0}" filter must have a matching alias defined.',
15+
'incorrectInterface' => '"{0}" must implement CodeIgniter\Filters\FilterInterface.',
1616
];

system/Language/en/Format.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Format language settings
1313
return [
1414
'invalidFormatter' => '"{0}" is not a valid Formatter class.',
15-
'invalidJSON' => 'Failed to parse json string, error: "{0}".',
15+
'invalidJSON' => 'Failed to parse JSON string. Error: {0}',
1616
'invalidMime' => 'No Formatter defined for mime type: "{0}".',
1717
'missingExtension' => 'The SimpleXML extension is required to format XML.',
1818
];

system/Language/en/HTTP.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
return [
1414
// CurlRequest
1515
'missingCurl' => 'CURL must be enabled to use the CURLRequest class.',
16-
'invalidSSLKey' => 'Cannot set SSL Key. {0} is not a valid file.',
17-
'sslCertNotFound' => 'SSL certificate not found at: {0}',
16+
'invalidSSLKey' => 'Cannot set SSL Key. "{0}" is not a valid file.',
17+
'sslCertNotFound' => 'SSL certificate not found at: "{0}"',
1818
'curlError' => '{0} : {1}',
1919

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

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

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

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

5050
// Page Not Found
5151
'pageNotFound' => 'Page Not Found',
5252
'emptyController' => 'No Controller specified.',
5353
'controllerNotFound' => 'Controller or its method is not found: {0}::{1}',
54-
'methodNotFound' => 'Controller method is not found: {0}',
54+
'methodNotFound' => 'Controller method is not found: "{0}"',
5555
'localeNotSupported' => 'Locale is not supported: {0}',
5656

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

6666
'uploadErrOk' => 'The file uploaded with success.',
6767
'uploadErrIniSize' => 'The file "%s" exceeds your upload_max_filesize ini directive.',

system/Language/en/Images.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
'unsupportedImageCreate' => 'Your server does not support the GD function required to process this type of image.',
2323
'jpgOrPngRequired' => 'The image resize protocol specified in your preferences only works with JPEG or PNG image types.',
2424
'rotateUnsupported' => 'Image rotation does not appear to be supported by your server.',
25-
'libPathInvalid' => 'The path to your image library is not correct. Please set the correct path in your image preferences. {0}',
25+
'libPathInvalid' => 'The path to your image library is not correct. Please set the correct path in your image preferences. "{0}"',
2626
'imageProcessFailed' => 'Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct.',
2727
'rotationAngleRequired' => 'An angle of rotation is required to rotate the image.',
2828
'invalidPath' => 'The path to the image is not correct.',
2929
'copyFailed' => 'The image copy routine failed.',
3030
'missingFont' => 'Unable to find a font to use.',
3131
'saveFailed' => 'Unable to save the image. Please make sure the image and file directory are writable.',
32-
'invalidDirection' => 'Flip direction can be only `vertical` or `horizontal`. Given: {0}',
32+
'invalidDirection' => 'Flip direction can be only "vertical" or "horizontal". Given: "{0}"',
3333
'exifNotSupported' => 'Reading EXIF data is not supported by this PHP installation.',
3434
];

system/Language/en/Log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
// Log language settings
1313
return [
14-
'invalidLogLevel' => '{0} is an invalid log level.',
14+
'invalidLogLevel' => '"{0}" is an invalid log level.',
1515
'invalidMessageType' => 'The given message type "{0}" is not supported.',
1616
];

system/Language/en/Pager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
'last' => 'Last',
1919
'older' => 'Older',
2020
'newer' => 'Newer',
21-
'invalidTemplate' => '{0} is not a valid Pager template.',
22-
'invalidPaginationGroup' => '{0} is not a valid Pagination group.',
21+
'invalidTemplate' => '"{0}" is not a valid Pager template.',
22+
'invalidPaginationGroup' => '"{0}" is not a valid Pagination group.',
2323
];

system/Language/en/Publisher.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

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

1818
// Publish Command
1919
'publishMissing' => 'No Publisher classes detected in {0} across all namespaces.',
20-
'publishSuccess' => '{0} published {1} file(s) to {2}.',
21-
'publishFailure' => '{0} failed to publish to {1}!',
20+
'publishSuccess' => '"{0}" published {1} file(s) to "{2}".',
21+
'publishFailure' => '"{0}" failed to publish to "{1}".',
2222
];

system/Language/en/Router.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
return [
1414
'invalidParameter' => 'A parameter does not match the expected type.',
1515
'missingDefaultRoute' => 'Unable to determine what should be displayed. A default route has not been specified in the routing file.',
16-
'invalidDynamicController' => 'A dynamic controller is not allowed for security reasons. Route handler: {0}',
17-
'invalidControllerName' => 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: {0}',
16+
'invalidDynamicController' => 'A dynamic controller is not allowed for security reasons. Route handler: "{0}"',
17+
'invalidControllerName' => 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: "{0}"',
1818
];

system/Language/en/Security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
'disallowedAction' => 'The action you requested is not allowed.',
1515

1616
// @deprecated
17-
'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: {0}',
17+
'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: "{0}"',
1818
];

system/Language/en/Session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
'invalidSavePath' => 'Session: Configured save path "{0}" is not a directory, does not exist or cannot be created.',
1616
'writeProtectedSavePath' => 'Session: Configured save path "{0}" is not writable by the PHP process.',
1717
'emptySavePath' => 'Session: No save path configured.',
18-
'invalidSavePathFormat' => 'Session: Invalid Redis save path format: {0}',
18+
'invalidSavePathFormat' => 'Session: Invalid Redis save path format: "{0}"',
1919

2020
// @deprecated
21-
'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: {0}',
21+
'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: "{0}"',
2222
];

system/Language/en/Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111

1212
// Testing language settings
1313
return [
14-
'invalidMockClass' => '{0} is not a valid Mock class',
14+
'invalidMockClass' => '"{0}" is not a valid Mock class',
1515
];

system/Language/en/Validation.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
// Validation language settings
1313
return [
1414
// Core Messages
15-
'noRuleSets' => 'No rulesets specified in Validation configuration.',
16-
'ruleNotFound' => '{0} is not a valid rule.',
17-
'groupNotFound' => '{0} is not a validation rules group.',
18-
'groupNotArray' => '{0} rule group must be an array.',
19-
'invalidTemplate' => '{0} is not a valid Validation template.',
15+
'noRuleSets' => 'No rule sets specified in Validation configuration.',
16+
'ruleNotFound' => '"{0}" is not a valid rule.',
17+
'groupNotFound' => '"{0}" is not a validation rules group.',
18+
'groupNotArray' => '"{0}" rule group must be an array.',
19+
'invalidTemplate' => '"{0}" is not a valid Validation template.',
2020

2121
// Rule Messages
2222
'alpha' => 'The {field} field may only contain alphabetical characters.',
@@ -31,7 +31,7 @@
3131
'exact_length' => 'The {field} field must be exactly {param} characters in length.',
3232
'greater_than' => 'The {field} field must contain a number greater than {param}.',
3333
'greater_than_equal_to' => 'The {field} field must contain a number greater than or equal to {param}.',
34-
'hex' => 'The {field} field may only contain hexidecimal characters.',
34+
'hex' => 'The {field} field may only contain hexadecimal characters.',
3535
'in_list' => 'The {field} field must be one of: {param}.',
3636
'integer' => 'The {field} field must contain an integer.',
3737
'is_natural' => 'The {field} field must only contain digits.',

system/Language/en/View.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
return [
1414
'invalidCellMethod' => '{class}::{method} is not a valid method.',
1515
'missingCellParameters' => '{class}::{method} has no params.',
16-
'invalidCellParameter' => '{0} is not a valid param name.',
16+
'invalidCellParameter' => '"{0}" is not a valid param name.',
1717
'noCellClass' => 'No view cell class provided.',
18-
'invalidCellClass' => 'Unable to locate view cell class: {0}.',
19-
'tagSyntaxError' => 'You have a syntax error in your Parser tags: {0}',
20-
'invalidDecoratorClass' => '{0} is not a valid View Decorator.',
18+
'invalidCellClass' => 'Unable to locate view cell class: "{0}".',
19+
'tagSyntaxError' => 'You have a syntax error in your Parser tags: "{0}"',
20+
'invalidDecoratorClass' => '"{0}" is not a valid View Decorator.',
2121
];

tests/system/CLI/CLITest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ public function testNewLine()
126126
public function testColorExceptionForeground()
127127
{
128128
$this->expectException(RuntimeException::class);
129-
$this->expectExceptionMessage('Invalid foreground color: Foreground');
129+
$this->expectExceptionMessage('Invalid "foreground" color: "Foreground"');
130130

131131
CLI::color('test', 'Foreground');
132132
}
133133

134134
public function testColorExceptionBackground()
135135
{
136136
$this->expectException(RuntimeException::class);
137-
$this->expectExceptionMessage('Invalid background color: Background');
137+
$this->expectExceptionMessage('Invalid "background" color: "Background"');
138138

139139
CLI::color('test', 'white', 'Background');
140140
}

tests/system/Commands/CommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testCommandCall()
8181
$command = new $commands['app:info']['class']($this->logger, $this->commands);
8282

8383
$command->bomb();
84-
$this->assertStringContainsString('Invalid background color:', $this->getBuffer());
84+
$this->assertStringContainsString('Invalid "background" color:', $this->getBuffer());
8585
}
8686

8787
public function testAbstractCommand()

0 commit comments

Comments
 (0)