Get an array of device jack types

@see $JACK_TYPES
@param boolean $translate If true, return the string representation
@return array An array of interface jack types
540775
public function jackTypes($translate = false) {
        $types = $this->getSNMP()->subOidWalk(self::OID_JACK_TYPE, 12);

        if (!$translate)
            return $types;

        return $this->getSNMP()->translate($types, self::$JACK_TYPES);
    }
1291399
protected static function getSupported()
    {
        $folders = File::directories(root().'resources/translator');

        foreach ($folders as $folder) {
            $lang = explode(root().'resources/translator/', $folder);

            self::$supported[] = $lang[1];
        }
    }
1002458
public static function get_request_types() {
        return [
            api::DATAREQUEST_TYPE_EXPORT => get_string('requesttypeexport', 'tool_dataprivacy'),
            api::DATAREQUEST_TYPE_DELETE => get_string('requesttypedelete', 'tool_dataprivacy'),
            api::DATAREQUEST_TYPE_OTHERS => get_string('requesttypeothers', 'tool_dataprivacy'),
        ];
    }
703815
public function filter($translations)
    {
        foreach ($translations as $pluginName => $pluginTranslations) {
            foreach ($pluginTranslations as $key => $translation) {

                if (isset($this->baseTranslations[$pluginName][$key]) &&
                    $this->baseTranslations[$pluginName][$key] != Translate::clean($this->baseTranslations[$pluginName][$key])) {
                    continue; // skip if base translation already contains encoded entities
                }

                // remove encoded entities
                $decoded = Translate::clean($translation);
                if ($translation != $decoded) {
                    $this->filteredData[$pluginName][$key] = $translation;
                    $translations[$pluginName][$key] = $decoded;
                    continue;
                }

            }
        }

        return $translations;
    }
232075
public function transform($translation)
    {
        $translation = $this->entityToArray(ContentTranslation::class, $translation);
        return [
            'id'             => (int) $translation['id'],
            'langCode'       => $translation['lang_code'],
            'title'          => $translation['title'],
            'teaser'         => $translation['teaser'],
            'body'           => $translation['body'],
            'seoTitle'       => $translation['seo_title'],
            'seoDescription' => $translation['seo_description'],
            'isActive'       => (bool) $translation['is_active'],
            'createdAt'      => $translation['created_at'],
            'updatedAt'      => $translation['updated_at'],
        ];
    }
965880
protected function mapTranslationDataResult(array $translationData): array
    {
        $result = [];
        foreach ($translationData as $data) {
            $result[] = TranslationData::createFromArray($data);
        }
        return $result;
    }
836489
public function states($translate = false) {
        $states = $this->getSNMP()->subOidWalk(self::OID_STATUS, 12);

        if (!$translate)
            return $states;

        return $this->getSNMP()->translate($states, self::$STATES);
    }
801187
public function ifLoopbackModeFlags( $translate = false )
    {
        $states = $this->getSNMP()->walk1d( self::OID_VLAN_IF_LOOPBACK_MODE_FLAG );

        if( !$translate )
            return $states;

        return $this->getSNMP()->translate( $states, self::$IF_VLAN_LOOPBACK_MODE_FLAGS );
    }
150272
private function translationToString(Translation $translation)
    {
        $values = $translation->values;
        if ($translation instanceof Translation\Plural) {
            if (current($values) === 1) {
                return $translation->singular;
            } else {
                return $translation->plural;
            }
        } else {
            return $translation->message;
        }
    }
525441
public function getSortationString( array $types, array $translations = array() )
	{
		$sortation = '';

		foreach( $this->_sortations as $sortitem )
		{
			if( ( $string = $sortitem->toString( $types, $translations ) ) !== '' ) {
				$sortation .= $string;
			}
		}

		return $sortation;
	}
50587
public function filter($translations)
    {
        $cleanedTranslations = array();

        foreach ($translations as $pluginName => $pluginTranslations) {

            if (empty($this->baseTranslations[$pluginName])) {
                $this->filteredData[$pluginName] = $pluginTranslations;
                continue;
            }

            foreach ($pluginTranslations as $key => $translation) {
                if (isset($this->baseTranslations[$pluginName][$key])) {
                    $cleanedTranslations[$pluginName][$key] = $translation;
                }
            }

            if (!empty($cleanedTranslations[$pluginName])) {
                $diff = array_diff($translations[$pluginName], $cleanedTranslations[$pluginName]);
            } else {
                $diff = $translations[$pluginName];
            }
            if (!empty($diff)) {
                $this->filteredData[$pluginName] = $diff;
            }
        }

        return $cleanedTranslations;
    }
30224
protected function _getTranslations( $domain )
	{
		if( !isset( $this->_translations[$domain] ) )
		{
			if ( !isset( $this->_translationSources[$domain] ) )
			{
				$msg = sprintf( 'No translation directory for domain "%1$s" available', $domain );
				throw new MW_Translation_Exception( $msg );
			}

			// Reverse locations so the former gets not overwritten by the later
			$locations = array_reverse( $this->_getTranslationFileLocations( $this->_translationSources[$domain], $this->getLocale() ) );
			$options = $this->_options;

			foreach( $locations as $location )
			{
				$options['content'] = $location;
				$this->_translations[$domain][] = new Zend_Translate( $options );
			}
		}

		return ( isset( $this->_translations[$domain] ) ? $this->_translations[$domain] : array() );
	}
978870
public function transform($translation)
    {
        $translation = $this->entityToArray(FileTranslation::class, $translation);
        return [
            'id'          => (int) $translation['id'],
            'langCode'    => $translation['lang_code'],
            'title'       => $translation['title'],
            'description' => $translation['description'],
            'createdAt'   => $translation['created_at'],
            'updatedAt'   => $translation['updated_at'],
        ];
    }
303611
public function getTranslations($lang)
    {
        $path = $this->getTranslationPathBaseDirectory('lang', $lang);

        if (!is_readable($path)) {
            return array();
        }

        $data = file_get_contents($path);
        $translations = json_decode($data, true);

        return $translations;
    }
398179
public function getSortationString( array $types, array $translations = array() )
	{
		if( empty( $this->_sortations ) )
		{
			reset( $types );

			if( ( $name = key( $types ) ) === false ) {
				throw new MW_Common_Exception( 'No sortation types available' );
			}

			return $this->sort( '+', $name )->toString( $types, $translations );
		}


		$sortation = array();

		foreach( $this->_sortations as $sortitem )
		{
			if( ( $string = $sortitem->toString( $types, $translations ) ) !== '' ) {
				$sortation[] = $string;
			}
		}

		return implode( ' ', $sortation );
	}
93299
private static function generateHeaders(Translations $translations)
    {
        $headers = '';

        foreach ($translations->getHeaders() as $name => $value) {
            $headers .= "$name: $value\n";
        }

        return $headers;
    }
1106682
public function convertArrayToCSV($translates)
    {
        $content = '';

        foreach ($translates as $key => $value) {
            $content .= $key.';'.$value."\n";
        }
        
        return $content;
    }