Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"illuminate/redis": "^13",
"illuminate/reflection": "^13",
"illuminate/session": "^13",
"illuminate/support": "^13",
"illuminate/support": "^13",
"illuminate/translation": "^13",
"illuminate/view": "^13",
"ircmaxell/password-compat": "~1.0",
"laravel/serializable-closure": "^2.0.10",
Expand Down Expand Up @@ -68,7 +69,6 @@
"illuminate/mail": "self.version",
"illuminate/queue": "self.version",
"illuminate/routing": "self.version",
"illuminate/translation": "self.version",
"illuminate/validation": "self.version",
"illuminate/workbench": "self.version"
},
Expand Down
17 changes: 17 additions & 0 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ public function bindInstallPaths(array $paths)
{
$this->instance("path.{$key}", realpath($value));
}

// ponytail: v13 TranslationServiceProvider reads path.lang (absent from L4.2 install
// paths). Bind it here; remove once Foundation swaps to v13 (bootstrap sets langPath).
$this->instance('path.lang', $this['path'].'/lang');
}

/**
Expand Down Expand Up @@ -1218,6 +1222,19 @@ public function getLocale()
return $this['config']->get('app.locale');
}

/**
* Get the current application fallback locale.
*
* ponytail: v13 TranslationServiceProvider calls getFallbackLocale(); the L4.2 fork
* Application lacks it. Remove once Foundation swaps to v13.
*
* @return string
*/
public function getFallbackLocale()
{
return $this['config']->get('app.fallback_locale');
}

/**
* Set the current application locale.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Validation/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Closure;
use Illuminate\Container\Container;
use Symfony\Contracts\Translation\TranslatorInterface;
use Illuminate\Contracts\Translation\Translator as TranslatorInterface;

class Factory {

Expand Down
12 changes: 6 additions & 6 deletions src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Illuminate\Support\MessageBag;
use Illuminate\Container\Container;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Contracts\Translation\TranslatorInterface;
use Illuminate\Contracts\Translation\Translator as TranslatorInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Illuminate\Support\Contracts\MessageProviderInterface;

Expand Down Expand Up @@ -1511,7 +1511,7 @@ protected function getMessage($attribute, $rule)

$customKey = "validation.custom.{$attribute}.{$lowerRule}";

$customMessage = $this->translator->trans($customKey);
$customMessage = $this->translator->get($customKey);

// First we check for a custom defined validation message for the attribute
// and rule. This allows the developer to specify specific messages for
Expand All @@ -1534,7 +1534,7 @@ protected function getMessage($attribute, $rule)
// messages out of the translator service for this validation rule.
$key = "validation.{$lowerRule}";

if ($key != ($value = $this->translator->trans($key)))
if ($key != ($value = $this->translator->get($key)))
{
return $value;
}
Expand Down Expand Up @@ -1585,7 +1585,7 @@ protected function getSizeMessage($attribute, $rule)

$key = "validation.{$lowerRule}.{$type}";

return $this->translator->trans($key);
return $this->translator->get($key);
}

/**
Expand Down Expand Up @@ -1682,7 +1682,7 @@ protected function getAttribute($attribute)
// We allow for the developer to specify language lines for each of the
// attributes allowing for more displayable counterparts of each of
// the attributes. This provides the ability for simple formats.
if (($line = $this->translator->trans($key)) !== $key)
if (($line = $this->translator->get($key)) !== $key)
{
return $line;
}
Expand All @@ -1709,7 +1709,7 @@ public function getDisplayableValue($attribute, $value)

$key = "validation.values.{$attribute}.{$value}";

if (($line = $this->translator->trans($key)) !== $key)
if (($line = $this->translator->get($key)) !== $key)
{
return $line;
}
Expand Down
72 changes: 0 additions & 72 deletions tests/Translation/TranslationFileLoaderTest.php

This file was deleted.

206 changes: 0 additions & 206 deletions tests/Translation/TranslationTranslatorTest.php

This file was deleted.

Loading
Loading