| 1 | <?php |
||
| 8 | class CachedTranslationFile |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Local filesystem. Already contains the path to our translation files |
||
| 12 | * e.g. storage/app/trans |
||
| 13 | * |
||
| 14 | * @var Filesystem |
||
| 15 | */ |
||
| 16 | private $filesystem; |
||
| 17 | |||
| 18 | 3 | public function __construct(Filesystem $filesystem) |
|
| 22 | |||
| 23 | /** |
||
| 24 | * Write all translations to cache |
||
| 25 | */ |
||
| 26 | 3 | public function write() |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Create new cached translation files based on database entries |
||
| 37 | * |
||
| 38 | * @param $locale |
||
| 39 | * @param array $lines - flat array of key-value pairs e.g. foo.bar => 'translation of foo' |
||
| 40 | */ |
||
| 41 | 3 | protected function writeLocale($locale, array $lines = []) |
|
| 52 | |||
| 53 | 3 | public function delete($locale = null) |
|
| 69 | } |
||
| 70 |