mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed ErrorPage::get_filepath_for_errorcode() to work with locale values instead of short language subtags
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75791 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d0761a3e78
commit
7e41cc2b8e
@ -150,12 +150,12 @@ class ErrorPage extends Page {
|
||||
* which is generated through {@link publish()}.
|
||||
*
|
||||
* @param int $statusCode A HTTP Statuscode, mostly 404 or 500
|
||||
* @param String $lang A language code in short locale format, e.g. 'de' (Optional)
|
||||
* @param String $locale A locale, e.g. 'de_DE' (Optional)
|
||||
* @return String
|
||||
*/
|
||||
static function get_filepath_for_errorcode($statusCode, $lang = null) {
|
||||
if(singleton('SiteTree')->hasExtension('Translatable') && $lang && $lang != Translatable::default_locale()) {
|
||||
return self::$static_filepath . "/error-{$statusCode}-{$lang}.html";
|
||||
static function get_filepath_for_errorcode($statusCode, $locale = null) {
|
||||
if(singleton('SiteTree')->hasExtension('Translatable') && $locale && $locale != Translatable::default_locale()) {
|
||||
return self::$static_filepath . "/error-{$statusCode}-{$locale}.html";
|
||||
} else {
|
||||
return self::$static_filepath . "/error-{$statusCode}.html";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user