Skip to content

Commit

Permalink
ENH additional error codes, tidy translations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewandante committed Sep 25, 2023
1 parent 8f73e6f commit 9e1cde4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,36 @@ en:
CODE_415: '415 - Unsupported Media Type'
CODE_416: '416 - Request Range Not Satisfiable'
CODE_417: '417 - Expectation Failed'
CODE_418: "418 - I'm a teapot"
CODE_421: '421 - Misdirected Request'
CODE_422: '422 - Unprocessable Entity'
CODE_423: '423 - Locked'
CODE_424: '424 - Failed Dependency'
CODE_425: '425 - Too Early'
CODE_426: '426 - Upgrade Required'
CODE_428: '428 - Precondition Required'
CODE_429: '429 - Too Many Requests'
CODE_431: '431 - Request Header Fields Too Large'
CODE_451: '451 - Unavailable For Legal Reasons'
CODE_500: '500 - Internal Server Error'
CODE_501: '501 - Not Implemented'
CODE_502: '502 - Bad Gateway'
CODE_503: '503 - Service Unavailable'
CODE_504: '504 - Gateway Timeout'
CODE_505: '505 - HTTP Version Not Supported'
CODE_506: '506 - Variant Also Negotiates'
CODE_507: '507 - Insufficient Storage'
CODE_508: '508 - Loop Detected'
CODE_510: '510 - Not Extended'
CODE_511: '511 - Network Authentication Required'
DEFAULTERRORPAGECONTENT: "<p>Sorry, it seems you were trying to access a page that doesn't exist.</p><p>Please check the spelling of the URL you were trying to access and try again.</p>"
DEFAULTERRORPAGETITLE: 'Page not found'
DEFAULTSERVERERRORPAGECONTENT: '<p>Sorry, there was a problem with handling your request.</p>'
DEFAULTSERVERERRORPAGETITLE: 'Server error'
DESCRIPTION: 'Custom content for different error cases (e.g. "Page not found")'
PLURALNAME: 'Base Pages'
PLURALNAME: 'Error Pages'
PLURALS:
one: 'An Error Page'
other: '{count} Base Pages'
other: '{count} Error Pages'
SINGULARNAME: 'Error Page'
db_ErrorCode: 'Error code'
13 changes: 13 additions & 0 deletions src/ErrorPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,28 @@ protected function getCodes()
415 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_415', '415 - Unsupported Media Type'),
416 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_416', '416 - Request Range Not Satisfiable'),
417 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_417', '417 - Expectation Failed'),
418 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_418', "418 - I'm a teapot"),
421 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_421', '421 - Misdirected Request'),
422 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_422', '422 - Unprocessable Entity'),
423 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_423', '423 - Locked'),
424 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_424', '424 - Failed Dependency'),
425 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_425', '425 - Too Early'),
426 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_426', '426 - Upgrade Required'),
428 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_428', '428 - Precondition Required'),
429 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_429', '429 - Too Many Requests'),
431 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_431', '431 - Request Header Fields Too Large'),
451 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_451', '451 - Unavailable For Legal Reasons'),
500 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_500', '500 - Internal Server Error'),
501 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_501', '501 - Not Implemented'),
502 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_502', '502 - Bad Gateway'),
503 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_503', '503 - Service Unavailable'),
504 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_504', '504 - Gateway Timeout'),
505 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_505', '505 - HTTP Version Not Supported'),
506 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_506', '506 - Variant Also Negotiates'),
507 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_507', '507 - Insufficient Storage'),
508 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_508', '508 - Loop Detected'),
510 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_510', '510 - Not Extended'),
511 => _t('SilverStripe\\ErrorPage\\ErrorPage.CODE_511', '511 - Network Authentication Required'),
];
}

Expand Down

0 comments on commit 9e1cde4

Please sign in to comment.