roundcubemail/program/include/rcmail.php
public function localize_foldername($name, $with_path = false, $path_remove = false)
    {
        $realnames = $this->config->get('show_real_foldernames');

        if (!$realnames && ($folder_class = $this->folder_classname($name))) {
            return $this->gettext($folder_class);
        }

        $storage   = $this->get_storage();
        $delimiter = $storage->get_hierarchy_delimiter();

        // Remove the path
        if ($path_remove) {
            if (strpos($name, $delimiter)) {
                $path = explode($delimiter, $name);
                $name = array_pop($path);
            }
        }
        // try to localize path of the folder
        else if ($with_path && !$realnames) {
            $path  = explode($delimiter, $name);
            $count = count($path);

            if ($count > 1) {
                for ($i = 1; $i < $count; $i++) {
                    $folder = implode($delimiter, array_slice($path, 0, -$i));
                    if ($folder_class = $this->folder_classname($folder)) {
                        $name = implode($delimiter, array_slice($path, $count - $i));
                        $name = rcube_charset::convert($name, 'UTF7-IMAP');

                        return $this->gettext($folder_class) . $delimiter . $name;
                    }
                }
            }
        }

        return rcube_charset::convert($name, 'UTF7-IMAP');
    }
public function localize_foldername($name, $with_path = false, $path_remove = false)
    {
        $realnames = $this->config->get('show_real_foldernames');

        if (!$realnames && ($folder_class = $this->folder_classname($name))) {
            return $this->gettext($folder_class);
        }

        $storage   = $this->get_storage();
        $delimiter = $storage->get_hierarchy_delimiter();

        // Remove the path
        if ($path_remove) {
            if (strpos($name, $delimiter)) {
                $path = explode($delimiter, $name);
                $name = array_pop($path);
            }
        }
        // try to localize path of the folder
        else if ($with_path && !$realnames) {
            $path  = explode($delimiter, $name);
            $count = count($path);

            if ($count > 1) {
                for ($i = 1; $i < $count; $i++) {
                    $folder = implode($delimiter, array_slice($path, 0, -$i));
                    if ($folder_class = $this->folder_classname($folder)) {
                        $name = implode($delimiter, array_slice($path, $count - $i));
                        $name = rcube_charset::convert($name, 'UTF7-IMAP');

                        return $this->gettext($folder_class) . $delimiter . $name;
                    }
                }
            }
        }

        return rcube_charset::convert($name, 'UTF7-IMAP');
    }
public function localize_foldername ( $ name , $ with_path = false , $ path_remove = false ) { $ realnames = $ this -> config -> get ( 'show_real_foldernames' ) ; if ( ! $ realnames && ( $ folder_class = $ this -> folder_classname ( $ name ) ) ) { return $ this -> gettext ( $ folder_class ) ; } $ storage = $ this -> get_storage ( ) ; $ delimiter = $ storage -> get_hierarchy_delimiter ( ) ; // Remove the path if ( $ path_remove ) { if ( strpos ( $ name , $ delimiter ) ) { $ path = explode ( $ delimiter , $ name ) ; $ name = array_pop ( $ path ) ; } } // try to localize path of the folder else if ( $ with_path && ! $ realnames ) { $ path = explode ( $ delimiter , $ name ) ; $ count = count ( $ path ) ; if ( $ count > 1 ) { for ( $ i = 1 ; $ i < $ count ; $ i ++ ) { $ folder = implode ( $ delimiter , array_slice ( $ path , 0 , - $ i ) ) ; if ( $ folder_class = $ this -> folder_classname ( $ folder ) ) { $ name = implode ( $ delimiter , array_slice ( $ path , $ count - $ i ) ) ; $ name = rcube_charset :: convert ( $ name , 'UTF7-IMAP' ) ; return $ this -> gettext ( $ folder_class ) . $ delimiter . $ name ; } } } } return rcube_charset :: convert ( $ name , 'UTF7-IMAP' ) ; }
Try to localize the given IMAP folder name.
UTF-7 decode it in case no localized text was found

@param string $name        Folder name
@param bool   $with_path   Enable path localization
@param bool   $path_remove Remove the path

@return string Localized folder name in UTF-8 encoding
Try to localize the given IMAP folder name . UTF - 7 decode it in case no localized text was found