0

my cakephp3 plugin with name "AdminTheme" has a localisation file.

AdminTheme
/src  
   /Locale  
       /de  
          AdminTheme.po 

The locale change perfectly. In my templates I use the function

__d('AdminTheme', 'Sign In')

The function

\Cake\I18n\MessagesFileLoader::__invoke()

says in line 122 (is_file()): File not found.

pathToMyCake/plugins/AdminTheme/src/Locale/de/AdminTheme.po

public function __invoke()
{
    $package = new Package('default');
    $folders = $this->translationsFolders();
    $ext = $this->_extension;
    $file = false;

    $fileName = $this->_name;
    $pos = strpos($fileName, '/');
    if ($pos !== false) {
        $fileName = substr($fileName, $pos + 1);
    }
    foreach ($folders as $folder) {
        $path = $folder . $fileName . ".$ext";
        if (is_file($path)) {
            $file = $path;
            break;
        }
    }

    if (!$file) {
        return $package;
    }

    $name = ucfirst($ext);
    $class = App::classname($name, 'I18n\Parser', 'FileParser');

    if (!$class) {
        throw new RuntimeException(sprintf('Could not find class %s', "{$name}FileParser"));
    }

    $messages = (new $class)->parse($file);
    $package->setMessages($messages);
    return $package;
}

Why? The file is correctly?

Please help me. Very thank's.

The debugger screens

enter image description here

enter image description here

I'm confused.

phptux
  • 11
  • 2
  • 1
    Are you sure that the same users/groups are accessing the file? Looking at the debug output, all that comes to my mind are permission or caching issues. **http://stackoverflow.com/q/6930150** | **http://stackoverflow.com/q/12173865** – ndm Jan 14 '16 at 15:17
  • Yes the permissions are not correct. Set the rights for the plugin folder to 777 and it goes. Thanks alot :-))) – phptux Jan 14 '16 at 15:30

0 Answers0