Returns available styles with translations
@return array
517367
public function geti18nStyles()
    {
        $i18nStyles = [];
        foreach ($this->styles as $key => $label) {
            $i18nStyles[$key] = _t(__CLASS__ . '.STYLE' . strtoupper($key), $label);
        }
        $this->extend('updatei18nStyles', $i18nStyles);
        return $i18nStyles;
    }
981862
public function getFilters() {
		$translation_filter = new \Twig_SimpleFilter('trans', function (\Twig_Environment $env, $string) {
			$globals = $env->getGlobals();
			$translation = $globals['env']['translation'];
			return \Skeleton\I18n\Translation::translate($string, $translation);
		}, ['needs_environment' => true]);
		return [
			$translation_filter
		];
	}
426229
public function getStyles($names = [])
    {
        $styles = [];
        
        foreach ($names as $name) {
            $styles[] = $this->getStyle($name);
        }
        
        return array_filter($styles);
    }
942467
public function getAllLangs(): array
    {
        $domainInfo = $this->intuition->getDomainInfo($this->domain);
        $messageFiles = glob($domainInfo['dir'].'/*.json');
        $languages = array_values(array_unique(array_map(
            function ($filename) {
                return basename($filename, '.json');
            },
            $messageFiles
        )));
        $availableLanguages = [];
        foreach ($languages as $lang) {
            $availableLanguages[$lang] = $this->intuition->getLangName($lang);
        }
        ksort($availableLanguages);
        return $availableLanguages;
    }
180709
protected function getImageStyleFieldsSettings()
    {
        return array(
            'image_style_category' => $this->text('Category page'),
            'image_style_category_child' => $this->text('Category page (child)'),
            'image_style_product' => $this->text('Product page'),
            'image_style_page' => $this->text('Page'),
            'image_style_product_grid' => $this->text('Product catalog (grid)'),
            'image_style_product_list' => $this->text('Product catalog (list)'),
            'image_style_cart' => $this->text('Cart'),
            'image_style_option' => $this->text('Product option'),
            'image_style_collection_file' => $this->text('File collection (banners)'),
            'image_style_collection_page' => $this->text('Page collection (news/articles)'),
            'image_style_collection_product' => $this->text('Product collection (featured products)'),
        );
    }
993819
protected function exportableColumns(): array
    {
        if (method_exists($this->module, 'exportableColumns')) {
            return $this->module->exportableColumns();
        }

        /**
         * @var Model
         */
        $model = $this->module->model();

        return collect($model->getFillable())
            ->prepend('id')
            ->diff($model->getHidden())
            ->map(function ($column) use ($model) {
                return "{$model->getTable()}.{$column}";
            })
            ->when($model instanceof Translatable, function (Collection $collection) use ($model) {
                return $collection->merge(
                    collect($model->getTranslatedAttributes())
                        ->map(function ($column) use ($model) {
                            return "tt.{$column}";
                        })
                );
            })
            ->all();
    }
451890
public function getStylesAttribute()
    {
        if (!$this->isImage)
            return null;

        $styles = [];
        foreach ($this->image_styles as $style)
            $styles[$style->style->name] = $style->file;

        return $styles;
    }
202836
public function getFilters()
    {
        $language = $this->container->get('language');

        return [
            new \Twig_SimpleFilter('trans', [$language, 'translate']),
            new \Twig_SimpleFilter('lang', [$language, 'translate']),
            new \Twig_SimpleFilter('translate', [$language, 'translate']),
            new \Twig_SimpleFilter('_', [$language, 'translate']),
            new \Twig_SimpleFilter('sprintf', function (...$args) use ($language) {
                return $language->sprintf(...$args);
            }),
            new \Twig_SimpleFilter('plural', function (...$args) use ($language) {
                return $language->plural(...$args);
            }),
        ];
    }
1050063
public function getAvailableLocales()
    {
        $availableLocales = [];
        $translations = $this->getTranslations();
        foreach ($translations as $translation) {
            $availableLocales[] = $translation->getLocale();
        }

        return $availableLocales;
    }
1193857
public function availableLanguages()
    {
        $languages = array();
        $languageObjects = $this->languages();

        foreach ( $languageObjects as $languageObject )
        {
            $languages[] = $languageObject->attribute( 'locale' );
        }

        return $languages;
    }
492415
public function styles()
	{
		$assets = array();
		
		foreach ($this->assets as $asset) {
			if ('css' !== $asset['ext'] && 'less' !== $asset['ext']) {
				continue;
			}
			
			$assets[] = $this->route ? $asset : $this->process($asset);
		}
		
		if (empty($assets)) {
			return '';
		}
		
		if ($this->route) {
			return $this->prepareForController($assets, 'style');
		}
		
		if ($this->combine) {
			$assets = $this->combine($assets, 'style');
		}
		
		$links = array();
		foreach ($assets as $asset) {
			$url = $this->cdn ? $this->cdn . $asset['url'] : $asset['url'];
			$links[] = HTML::style($url, $asset['attributes']);
		}
		
		return implode('', $links);
	}
1213591
public function getAvailableLanguages()
    {
        if (!is_null($this->languageNames)) {
            return $this->languageNames;
        }
        $path = PIWIK_INCLUDE_PATH . "/lang/";
        $languagesPath = _glob($path . "*.json");

        $pathLength = strlen($path);
        $languages = array();
        if ($languagesPath) {
            foreach ($languagesPath as $language) {
                $languages[] = substr($language, $pathLength, -strlen('.json'));
            }
        }

        $this->enableDevelopmentLanguageInDevEnvironment($languages);

        /**
         * Hook called after loading available language files.
         *
         * Use this hook to customise the list of languagesPath available in Matomo.
         *
         * @param array
         */
        Piwik::postEvent('LanguagesManager.getAvailableLanguages', array(&$languages));

        /**
         * Hook called after loading available language files.
         *
         * @param array
         *
         * @deprecated since v3.9.0 use LanguagesManager.getAvailableLanguages instead. Will be removed in Matomo 4.0.0
         */
        Piwik::postEvent('LanguageManager.getAvailableLanguages', array(&$languages));

        $this->languageNames = $languages;
        return $languages;
    }
826196
public function getSourceDirs()
    {
        if (!$this->sourceDirs) {
            $this->setSourceDirs(i18n::getSources()->getLangDirs());
        }
        return $this->sourceDirs;
    }
816495
public function get_styles() {

		// Get an array of all our fields.
		$fields = self::$fields;

		// Check if we need to exit early.
		if ( empty( self::$fields ) || ! is_array( $fields ) ) {
			return;
		}

		// Initially we're going to format our styles as an array.
		// This is going to make processing them a lot easier
		// and make sure there are no duplicate styles etc.
		$css = array();

		// Start parsing our fields.
		foreach ( $fields as $field ) {

			// No need to process fields without an output, or an improperly-formatted output.
			if ( ! isset( $field['output'] ) || empty( $field['output'] ) || ! is_array( $field['output'] ) ) {
				continue;
			}

			// Get the value of this field.
			$value = self::get_option( $field['kirki_config'], $field['settings'] );

			// Start parsing the output arguments of the field.
			foreach ( $field['output'] as $output ) {
				$output = wp_parse_args(
					$output,
					array(
						'element'       => '',
						'property'      => '',
						'media_query'   => 'global',
						'prefix'        => '',
						'units'         => '',
						'suffix'        => '',
						'value_pattern' => '$',
						'choice'        => '',
					)
				);

				// If element is an array, convert it to a string.
				if ( is_array( $output['element'] ) ) {
					$output['element'] = implode( ',', $output['element'] );
				}

				// Simple fields.
				if ( ! is_array( $value ) ) {
					$value = str_replace( '$', $value, $output['value_pattern'] );
					if ( ! empty( $output['element'] ) && ! empty( $output['property'] ) ) {
						$css[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['units'] . $output['suffix'];
					}
				} else {
					if ( 'typography' === $field['type'] ) {

						foreach ( $value as $key => $subvalue ) {

							// Add double quotes if needed to font-families.
							if ( 'font-family' === $key && false !== strpos( $subvalue, ' ' ) && false === strpos( $subvalue, '"' ) ) {
								$css[ $output['media_query'] ][ $output['element'] ]['font-family'] = '"' . $subvalue . '"';
							}

							// Variants contain both font-weight & italics.
							if ( 'variant' === $key ) {
								$font_weight = str_replace( 'italic', '', $subvalue );
								$font_weight = ( in_array( $font_weight, array( '', 'regular' ), true ) ) ? '400' : $font_weight;
								$css[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight;

								// Is this italic?
								if ( false !== strpos( $subvalue, 'italic' ) ) {
									$css[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic';
								}
							} else {
								$css[ $output['media_query'] ][ $output['element'] ][ $key ] = $subvalue;
							}
						}
					} elseif ( 'multicolor' === $field['type'] ) {

						if ( ! empty( $output['element'] ) && ! empty( $output['property'] ) && ! empty( $output['choice'] ) ) {
							$css[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value[ $output['choice'] ] . $output['units'] . $output['suffix'];
						}
					} else {

						foreach ( $value as $key => $subvalue ) {
							$property = $key;
							if ( false !== strpos( $output['property'], '%%' ) ) {
								$property = str_replace( '%%', $key, $output['property'] );
							} elseif ( ! empty( $output['property'] ) ) {
								$output['property'] = $output['property'] . '-' . $key;
							}
							if ( 'background-image' === $output['property'] && false === strpos( $subvalue, 'url(' ) ) {
								$subvalue = 'url("' . set_url_scheme( $subvalue ) . '")';
							}
							if ( $subvalue ) {
								$css[ $output['media_query'] ][ $output['element'] ][ $property ] = $subvalue;
							}
						}
					}
				}
			}
		}

		// Process the array of CSS properties and produce the final CSS.
		$final_css = '';
		if ( ! is_array( $css ) || empty( $css ) ) {
			return '';
		}

		// Parse the generated CSS array and create the CSS string for the output.
		foreach ( $css as $media_query => $styles ) {

			// Handle the media queries.
			$final_css .= ( 'global' !== $media_query ) ? $media_query . '{' : '';
			foreach ( $styles as $style => $style_array ) {

				$final_css .= $style . '{';
				foreach ( $style_array as $property => $value ) {

					$value = ( is_string( $value ) ) ? $value : '';

					// Make sure background-images are properly formatted.
					if ( 'background-image' === $property ) {
						if ( false === strrpos( $value, 'url(' ) ) {
							$value = set_url_scheme( $value );
							$value = 'url("' . esc_url_raw( $value ) . '")';
						}
					} else {
						$value = esc_textarea( $value );
					}
					$final_css .= $property . ':' . $value . ';';
				}
				$final_css .= '}';
			}
			$final_css .= ( 'global' !== $media_query ) ? '}' : '';
		}
		return $final_css;
	}
1266276
protected function packageTranslations()
    {
        return collect($this->app['translator']->getLoader()->namespaces())->flatMap(function ($path, $namespace) {
            return [
                ($namespace .= '::') => collect($this->getFiles($path))->flatMap(function ($file) use ($namespace) {
                    return [
                        ($translation = $file->getBasename('.php')) => trans($namespace . $translation),
                    ];
                }),
            ];
        })->filter(function ($translations) {
            return $translations->isNotEmpty();
        });
    }
689666
public function getResources()
    {
        $data = $this->executeJson(sprintf('project/%s/resources/', $this->ensureParameter('slug')));

        $resources = array();
        foreach ($data as $entry) {
            $resource = new TranslationResource($this->getTransport());
            $resource->setProject($this);
            $resource->setFromResult($entry);
            $resources[$resource->getSlug()] = $resource;
        }

        return $resources;
    }
862766
protected function chartStyles(): array
    {
        return [
            /* I18N: layout option for the fan chart */
            self::STYLE_HALF_CIRCLE          => I18N::translate('half circle'),
            /* I18N: layout option for the fan chart */
            self::STYLE_THREE_QUARTER_CIRCLE => I18N::translate('three-quarter circle'),
            /* I18N: layout option for the fan chart */
            self::STYLE_FULL_CIRCLE          => I18N::translate('full circle'),
        ];
    }