original_string: public function translatedLanguages($onlyPublished = false)
      {
          $filename = substr($this->name, 0, -(strlen($this->extension())));
          $config = Grav::instance()['config'];
          $languages = $config->get('system.languages.supported', []);
          $translatedLanguages = [];
  
          foreach ($languages as $language) {
              $path = $this->path . DS . $this->folder . DS . $filename . '.' . $language . '.md';
              if (file_exists($path)) {
                  $aPage = new Page();
                  $aPage->init(new \SplFileInfo($path), $language . '.md');
  
                  $route = $aPage->header()->routes['default'] ?? $aPage->rawRoute();
                  if (!$route) {
                      $route = $aPage->route();
                  }
  
                  if ($onlyPublished && !$aPage->published()) {
                      continue;
                  }
  
                  $translatedLanguages[$language] = $route;
              }
          }
  
          return $translatedLanguages;
      }
code: public function translatedLanguages($onlyPublished = false)
      {
          $filename = substr($this->name, 0, -(strlen($this->extension())));
          $config = Grav::instance()['config'];
          $languages = $config->get('system.languages.supported', []);
          $translatedLanguages = [];
  
          foreach ($languages as $language) {
              $path = $this->path . DS . $this->folder . DS . $filename . '.' . $language . '.md';
              if (file_exists($path)) {
                  $aPage = new Page();
                  $aPage->init(new \SplFileInfo($path), $language . '.md');
  
                  $route = $aPage->header()->routes['default'] ?? $aPage->rawRoute();
                  if (!$route) {
                      $route = $aPage->route();
                  }
  
                  if ($onlyPublished && !$aPage->published()) {
                      continue;
                  }
  
                  $translatedLanguages[$language] = $route;
              }
          }
  
          return $translatedLanguages;
      }
code_tokens: public function translatedLanguages ( $ onlyPublished = false ) { $ filename = substr ( $ this -> name , 0 , - ( strlen ( $ this -> extension ( ) ) ) ) ; $ config = Grav :: instance ( ) [ 'config' ] ; $ languages = $ config -> get ( 'system.languages.supported' , [ ] ) ; $ translatedLanguages = [ ] ; foreach ( $ languages as $ language ) { $ path = $ this -> path . DS . $ this -> folder . DS . $ filename . '.' . $ language . '.md' ; if ( file_exists ( $ path ) ) { $ aPage = new Page ( ) ; $ aPage -> init ( new \ SplFileInfo ( $ path ) , $ language . '.md' ) ; $ route = $ aPage -> header ( ) -> routes [ 'default' ] ?? $ aPage -> rawRoute ( ) ; if ( ! $ route ) { $ route = $ aPage -> route ( ) ; } if ( $ onlyPublished && ! $ aPage -> published ( ) ) { continue ; } $ translatedLanguages [ $ language ] = $ route ; } } return $ translatedLanguages ; }
docstring: Return an array with the routes of other translated languages
  
  @param bool $onlyPublished only return published translations
  
  @return array the page translated languages
docstring_tokens: Return an array with the routes of other translated languages