original_string: protected function loadLanguages(Config $config)
      {
          /** @var UniformResourceLocator $locator */
          $locator = $this->grav['locator'];
  
          if ($config->get('system.languages.translations', true)) {
              $language_file = $locator->findResource('theme://languages' . YAML_EXT);
              if ($language_file) {
                  $language = CompiledYamlFile::instance($language_file)->content();
                  $this->grav['languages']->mergeRecursive($language);
              }
              $languages_folder = $locator->findResource('theme://languages');
              if (file_exists($languages_folder)) {
                  $languages = [];
                  $iterator = new \DirectoryIterator($languages_folder);
  
                  /** @var \DirectoryIterator $directory */
                  foreach ($iterator as $file) {
                      if ($file->getExtension() !== 'yaml') {
                          continue;
                      }
                      $languages[$file->getBasename('.yaml')] = CompiledYamlFile::instance($file->getPathname())->content();
                  }
                  $this->grav['languages']->mergeRecursive($languages);
              }
          }
      }
code: protected function loadLanguages(Config $config)
      {
          /** @var UniformResourceLocator $locator */
          $locator = $this->grav['locator'];
  
          if ($config->get('system.languages.translations', true)) {
              $language_file = $locator->findResource('theme://languages' . YAML_EXT);
              if ($language_file) {
                  $language = CompiledYamlFile::instance($language_file)->content();
                  $this->grav['languages']->mergeRecursive($language);
              }
              $languages_folder = $locator->findResource('theme://languages');
              if (file_exists($languages_folder)) {
                  $languages = [];
                  $iterator = new \DirectoryIterator($languages_folder);
  
                  /** @var \DirectoryIterator $directory */
                  foreach ($iterator as $file) {
                      if ($file->getExtension() !== 'yaml') {
                          continue;
                      }
                      $languages[$file->getBasename('.yaml')] = CompiledYamlFile::instance($file->getPathname())->content();
                  }
                  $this->grav['languages']->mergeRecursive($languages);
              }
          }
      }
code_tokens: protected function loadLanguages ( Config $ config ) { /** @var UniformResourceLocator $locator */ $ locator = $ this -> grav [ 'locator' ] ; if ( $ config -> get ( 'system.languages.translations' , true ) ) { $ language_file = $ locator -> findResource ( 'theme://languages' . YAML_EXT ) ; if ( $ language_file ) { $ language = CompiledYamlFile :: instance ( $ language_file ) -> content ( ) ; $ this -> grav [ 'languages' ] -> mergeRecursive ( $ language ) ; } $ languages_folder = $ locator -> findResource ( 'theme://languages' ) ; if ( file_exists ( $ languages_folder ) ) { $ languages = [ ] ; $ iterator = new \ DirectoryIterator ( $ languages_folder ) ; /** @var \DirectoryIterator $directory */ foreach ( $ iterator as $ file ) { if ( $ file -> getExtension ( ) !== 'yaml' ) { continue ; } $ languages [ $ file -> getBasename ( '.yaml' ) ] = CompiledYamlFile :: instance ( $ file -> getPathname ( ) ) -> content ( ) ; } $ this -> grav [ 'languages' ] -> mergeRecursive ( $ languages ) ; } } }
docstring: Load theme languages.
  
  @param Config $config Configuration class
docstring_tokens: Load theme languages .