$provider = self::
createProvider((new MockHttpClient([ $getLanguagesResponse,
$createLanguagesResponse,
$getKeysIdsForMessagesDomainResponse,
$getKeysIdsForValidatorsDomainResponse,
$createKeysForMessagesDomainResponse,
$createKeysForValidatorsDomainResponse,
$updateTranslationsResponse,
]))->
withOptions([ 'base_uri' => 'https://api.lokalise.com/api2/projects/PROJECT_ID/',
'headers' =>
['X-Api-Token' => 'API_KEY'
],
]),
$this->
getLoader(),
$this->
getLogger(),
$this->
getDefaultLocale(), 'api.lokalise.com'
);
$translatorBag =
new TranslatorBag();
$translatorBag->
addCatalogue(new MessageCatalogue('en',
[ 'messages' =>
['young_dog' => 'puppy'
],
'validators' =>
['post.num_comments' => '{count, plural, one {# comment} other {# comments}}'
],
]));
$translatorBag->
addCatalogue(new MessageCatalogue('fr',
[ 'messages' =>
['young_dog' => 'chiot'
],
'validators' =>
['post.num_comments' => '{count, plural, one {# commentaire} other {# commentaires}}'
],
]));