src/Panda/Localization/Processors/JsonProcessor.php
public function loadTranslations($locale, $package = 'default')
    {
        $package = $package ?: 'default';
        if (empty(static::$translations[$locale])) {
            // Get full file path
            $fileName = $locale . DIRECTORY_SEPARATOR . $package . '.json';
            $filePath = $this->getBaseDirectory() . DIRECTORY_SEPARATOR . $fileName;

            // Check if is valid and load translations
            if (is_file($filePath)) {
                $fileContents = file_get_contents($filePath);
                static::$translations[$locale] = json_decode($fileContents, true);
            } else {
                throw new FileNotFoundException($fileName);
            }
        }
    }
public function loadTranslations($locale, $package = 'default')
    {
        $package = $package ?: 'default';
        if (empty(static::$translations[$locale])) {
            // Get full file path
            $fileName = $locale . DIRECTORY_SEPARATOR . $package . '.json';
            $filePath = $this->getBaseDirectory() . DIRECTORY_SEPARATOR . $fileName;

            // Check if is valid and load translations
            if (is_file($filePath)) {
                $fileContents = file_get_contents($filePath);
                static::$translations[$locale] = json_decode($fileContents, true);
            } else {
                throw new FileNotFoundException($fileName);
            }
        }
    }
public function loadTranslations ( $ locale , $ package = 'default' ) { $ package = $ package ? : 'default' ; if ( empty ( static :: $ translations [ $ locale ] ) ) { // Get full file path $ fileName = $ locale . DIRECTORY_SEPARATOR . $ package . '.json' ; $ filePath = $ this -> getBaseDirectory ( ) . DIRECTORY_SEPARATOR . $ fileName ; // Check if is valid and load translations if ( is_file ( $ filePath ) ) { $ fileContents = file_get_contents ( $ filePath ) ; static :: $ translations [ $ locale ] = json_decode ( $ fileContents , true ) ; } else { throw new FileNotFoundException ( $ fileName ) ; } } }
Load translations from file.

@param string $locale
@param string $package

@throws FileNotFoundException
Load translations from file .