nikaia / translation-sheet

Translating Laravel languages files using a Google Spreadsheet.
GNU General Public License v3.0
291 stars 60 forks source link

fix vendor subsequent skipped #31

Closed kslr closed 5 years ago

kslr commented 5 years ago

my English is hard to describe, I try to use code.

first https://github.com/nikaia/translation-sheet/blob/master/src/Translation/Reader.php#L82 Stop the loop when you encounter the vendor

function directories

    public function directories($directory)
    {
        $directories = [];

        foreach (Finder::create()->in($directory)->directories()->depth(0)->sortByName() as $dir) {
            $directories[] = $dir->getPathname();
        }

        return $directories;
    }

sortByName return

resources/lang/en
resources/lang/ja
resources/lang/ko
resources/lang/vendor -> stop work
resources/lang/zh-CN

Because, I modified to skip this loop

kslr commented 5 years ago

@nbourguig Can you release a new version?

nbourguig commented 5 years ago

Sorry, but i didn't understand what you want to achieve. If the goal is to make this an option, we need a little more work to make configurable. Is that what you're trying to do ?

kslr commented 5 years ago

This is a bug fix. The directory after the vendor cannot be added

resources/lang/en
resources/lang/ja
resources/lang/ko
resources/lang/vendor -> stop work
resources/lang/zh-CN -> lost

So I am modifying it to not affect subsequent execution.

kslr commented 5 years ago

@nbourguig

AidasK commented 5 years ago

It is a bug fix, can be merged