Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop into master #71

Merged
merged 5 commits into from Jun 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion resources/helpers.php
Expand Up @@ -97,7 +97,13 @@ function array_undot(array $dotNotationArray)
{
$array = [];
foreach ($dotNotationArray as $key => $value) {
array_set($array, $key, $value);
// if there is a space after the dot, this could legitimately be
// a single key and not nested.
if (count(explode('. ', $key)) > 1) {
$array[$key] = $value;
} else {
array_set($array, $key, $value);
}
}

return $array;
Expand Down
3 changes: 0 additions & 3 deletions routes/web.php
@@ -1,8 +1,5 @@
<?php

use JoeDixon\Translation\Drivers\Translation;
use JoeDixon\Translation\Http\Controllers\LanguageTranslationController;

Route::group(config('translation.route_group_config') + ['namespace' => 'JoeDixon\\Translation\\Http\\Controllers'], function ($router) {
$router->get(config('translation.ui_url'), 'LanguageController@index')
->name('languages.index');
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/File.php
Expand Up @@ -277,7 +277,7 @@ private function saveGroupTranslations($language, $group, $translations)
*/
private function saveNamespacedGroupTranslations($language, $group, $translations)
{
list($namespace, $group) = explode('::', $group);
[$namespace, $group] = explode('::', $group);
$directory = "{$this->languageFilesPath}".DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR."{$namespace}".DIRECTORY_SEPARATOR."{$language}";

if (! $this->disk->exists($directory)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Scanner.php
Expand Up @@ -47,7 +47,7 @@ public function findTranslations()
if (preg_match_all("/$matchingPattern/siU", $file->getContents(), $matches)) {
foreach ($matches[2] as $key) {
if (preg_match("/(^[a-zA-Z0-9:_-]+([.][^\1)\ ]+)+$)/siU", $key, $arrayMatches)) {
list($file, $k) = explode('.', $arrayMatches[0], 2);
[$file, $k] = explode('.', $arrayMatches[0], 2);
$results['group'][$file][$k] = '';
continue;
} else {
Expand Down