\TransvisionProject

Project class

This is data used across the project to remove them from global scope and make this data accessible from other classes.

Summary

Methods
Properties
Constants
getSupportedRepositories()
getRepositories()
getRepositoriesNames()
getDesktopRepositories()
isDesktopRepository()
getRepositoryLocales()
getLocaleRepositories()
getReferenceLocale()
isValidRepository()
getLocaleInContext()
getComponents()
getLocaleTool()
$components_names
$repos_info
$repos_lists
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$components_names

$components_names : 

This array maps different subfolders name for Desktop products with their display name

Type

$repos_info

$repos_info : 

Type

$repos_lists

$repos_lists : 

Type

Methods

getSupportedRepositories()

getSupportedRepositories() : array

Create a list of all supported repositories.

Returns

array —

List of supported repositories, key is the repo, value is the nice name for the repo for display purposes.

getRepositories()

getRepositories() : array

Get the list of repositories.

Returns

array —

list of local repositories values

getRepositoriesNames()

getRepositoriesNames() : array

Get the list of repositories with their Display name.

The array has repo folder names as keys and Display names as value: ex: ['firefox_ios' => 'Firefox for iOS', 'mozilla_org' => 'mozilla.org']

Returns

array —

list of local repositories and their Display names

getDesktopRepositories()

getDesktopRepositories() : array

Get the list of repositories for desktop applications

Returns

array —

list of local repositories folder names

isDesktopRepository()

isDesktopRepository(  $repo) : boolean

Check if the repository belongs to a desktop application

Parameters

$repo

Returns

boolean —

True if repository is used for a desktop application

getRepositoryLocales()

getRepositoryLocales(string  $repository, array  $ignored = array()) : array

Get the list of locales available for a repository, exclude a subset if needed

Parameters

string $repository

ID of the repository

array $ignored

Array of excluded locales

Returns

array —

A sorted list of locales

getLocaleRepositories()

getLocaleRepositories(string  $locale) : array

Get the list of repositories available for a locale

Parameters

string $locale

Mozilla locale code

Returns

array —

A sorted list of repositories available for the locale

getReferenceLocale()

getReferenceLocale(string  $repository) : string

Return the reference locale for a repository We used to have en-GB as reference locale for mozilla.org Now all projects use en-US but we may need this method in the future

Parameters

string $repository

Name of the folder for the repository

Returns

string —

Name of the reference locale

isValidRepository()

isValidRepository(string  $repository) : boolean

Check if the specified repository is supported

Parameters

string $repository

Name of the folder for the repository

Returns

boolean —

True if supported repository, False if unknown

getLocaleInContext()

getLocaleInContext(string  $locale, string  $context) : string

Return the correct locale code based on context For example: given "es", returns "es-ES" for Bugzilla.

Parameters

string $locale

Name of the current locale

string $context

The context we need to use this locale in

Returns

string —

Locale code to use in the requested context

getComponents()

getComponents(  $strings) : array

Return the list of components by parsing a set of entities.

Components are folders at the root of desktop repos ("desktop", "mobile", etc.)

Parameters

$strings

Returns

array —

List of components

getLocaleTool()

getLocaleTool(  $locale) : string

Return the name of the tool the requested locale is working in.

Parameters

$locale

Returns

string —

Name of the tool, empty if not available