lokalise / lokalise-cli-2-go

Lokalise CLI v2
Other
108 stars 52 forks source link

PHP Format is being downloaded totally wrong #98

Closed brunogaspar closed 2 years ago

brunogaspar commented 2 years ago

Hello

So i'm having an issue exporting it to PHP format and i'm unsure which version caused this change / issue, but i'm latest version:

lokalise2 version 2.6.8

Basically when performing the following command:

lokalise2 file download --token REDACTED --project-id REDACTED --format php --add-newline-eof 1 --unzip-to lang --original-filenames 1 --directory-prefix '' --export-sort first_added --include-tags MY-TAGS --export-empty-as skip --replace-breaks 1

The downloaded files are not being downloaded in the format that i'm expecting, where previously it was working as expected:

Current, not expected format

<?php

$lang["accepted"] = "The :attribute must be accepted.";
$lang["active_url"] = "The :attribute is not a valid URL.";
$lang["after"] = "The :attribute must be a date after :date.";
...

Expected format

<?php

return array (
  'accepted' => 'The :attribute must be accepted.',
  'active_url' => 'The :attribute is not a valid URL.',
  'after' => 'The :attribute must be a date after :date.',
  ...
);

Do i need to change something? Or is it just broken?

Thank you!

brunogaspar commented 2 years ago

Figured it out, instead of using --format php i had to change to --format php_laravel.

Haven't seen this documented anywhere, but asked on support to hopefully document this a bit better :)