3 namespace Drupal\locale\StreamWrapper;
5 use Drupal\Core\StreamWrapper\LocalStream;
6 use Drupal\Core\StreamWrapper\StreamWrapperInterface;
9 * Defines a Drupal translations (translations://) stream wrapper class.
11 * Provides support for storing translation files.
13 class TranslationsStream extends LocalStream {
18 public static function getType() {
19 return StreamWrapperInterface::LOCAL_HIDDEN;
25 public function getName() {
26 return t('Translation files');
32 public function getDescription() {
33 return t('Translation files');
39 public function getDirectoryPath() {
40 return \Drupal::config('locale.settings')->get('translation.path');
44 * Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl().
45 * @throws \LogicException
46 * PO files URL should not be public.
48 public function getExternalUrl() {
49 throw new \LogicException('PO files URL should not be public.');