$url
$url :
API class
This class manages all of our calls to the API. This class does not return data, it only allows validating in the controller that the API query is technically correct
Calls are like this:
api/
Example for the list of locales supported for a repo: https://transvision.mozfr.org/api/v1/locales/mozilla_org/
List of services: entity: Return translations for all locales of a Mozilla entity locales: Return all the locales supported for a repository repositories : Return the list of repositories supported by Transvision that can be used in the API search: Return translations + entity as key for a locale matching a search query tm: Return translations for a locale with a quality index transliterate: Return a transliterated string versions: Return the list of API versions supported with their status (stable, beta, deprecated)
This API is versioned, currently we are at v1. If we make api changes that change the results or remove services, we need to create a v2 api.
verifyRepositoryExists(string $repository, boolean $alias = false) : boolean
Check that the repository asked for is one we support
string | $repository | Name of the repository |
boolean | $alias | Do we allow aliases for repository names, ex: 'global', to query all repositories. Default to False |
True if we support this repository, False if we don't
verifyLocaleExists(string $locale, string $repository) : boolean
Check that a locale is available for a repository
string | $locale | Locale code we want to check |
string | $repository | Repository name we want to check the locale for |
True if we support the locale, False if we don't