-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Laravel-Lang/1.x
First Release
- Loading branch information
Showing
34 changed files
with
1,795 additions
and
19 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
* text=auto | ||
|
||
.github/ export-ignore | ||
tests/ export-ignore | ||
|
||
.editorconfig export-ignore | ||
.env.example export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
|
||
phpunit.xml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Bug Report | ||
url: https://github.com/Laravel-Lang/common/issues/new?assignees=andrey-helldar&labels=bug%2Croutes&template=bug_report.yml&title=%5BBug%5D%3A+&environment-package-name=laravel-lang%2Froutes | ||
about: Report a bug or other issue | ||
- name: Feature Request | ||
url: https://github.com/Laravel-Lang/common/issues/new?labels=feature%2Croutes&projects=&template=feature_request.yml | ||
about: Propose a new feature | ||
- name: Questions & Other | ||
url: https://github.com/Laravel-Lang/common/discussions | ||
about: 'If you want to ask about something else, use the discussions.' | ||
- name: Laravel Issue | ||
url: https://github.com/laravel/framework/issues | ||
about: 'If you have a question about your Laravel implementation, ask it in your Laravel project.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
labels: | ||
- dependabot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Close Stale Issues and PRs | ||
|
||
on: | ||
schedule: | ||
- cron: 34 0 * * * | ||
workflow_dispatch: | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
stale: | ||
name: Close Stale | ||
uses: Laravel-Lang/.github/.github/workflows/close-stale-issues.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Code Style | ||
|
||
on: [ push, pull_request ] | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
style: | ||
name: Code Style | ||
uses: TheDragonCode/.github/.github/workflows/code-style.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate docs trigger | ||
uses: myrotvorets/[email protected] | ||
with: | ||
token: ${{ secrets.COMPOSER_TOKEN }} | ||
repo: Laravel-Lang/docs | ||
type: docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
- unpublished | ||
- released | ||
- prereleased | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Update: | ||
uses: Laravel-Lang/.github/.github/workflows/release-drafter.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'projects/**' | ||
pull_request: | ||
branches-ignore: | ||
- 'projects/**' | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php: [ "8.2", "8.3" ] | ||
laravel: [ "10.0", "11.0" ] | ||
|
||
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv | ||
coverage: xdebug | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }} | ||
|
||
- name: Install dependencies | ||
run: composer require laravel/framework:^${{ matrix.laravel }} | ||
|
||
- name: Execute tests | ||
run: composer test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.idea/ | ||
vendor/ | ||
|
||
.cache | ||
.DS_Store | ||
.env | ||
.php_cs.cache | ||
.phpintel | ||
.temp | ||
|
||
*.bak | ||
*.cache | ||
*.clover | ||
*.orig | ||
|
||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
MIT License | ||
# MIT License | ||
|
||
Copyright (c) 2024 Laravel Lang | ||
Copyright (c) 2024 Laravel-Lang Team | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
> Permission is hereby granted, free of charge, to any person obtaining a copy | ||
> of this software and associated documentation files (the "Software"), to deal | ||
> in the Software without restriction, including without limitation the rights | ||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
> copies of the Software, and to permit persons to whom the Software is | ||
> furnished to do so, subject to the following conditions: | ||
> | ||
> The above copyright notice and this permission notice shall be included in | ||
> all copies or substantial portions of the Software. | ||
> | ||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
> THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"name": "laravel-lang/routes", | ||
"description": "Easy and fast way to localize routes", | ||
"license": "MIT", | ||
"keywords": [ | ||
"laravel", | ||
"languages", | ||
"routes", | ||
"translations", | ||
"translate", | ||
"localization", | ||
"l18n" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Andrey Helldar", | ||
"email": "[email protected]", | ||
"homepage": "https://dragon-code.pro" | ||
}, | ||
{ | ||
"name": "Laravel-Lang Team", | ||
"homepage": "https://github.com/Laravel-Lang" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/Laravel-Lang/routes/issues", | ||
"source": "https://github.com/Laravel-Lang/routes" | ||
}, | ||
"require": { | ||
"php": "^8.2", | ||
"dragon-code/support": "^6.13", | ||
"illuminate/config": "^10.0 || ^11.0", | ||
"illuminate/http": "^10.0 || ^11.0", | ||
"illuminate/support": "^10.0 || ^11.0", | ||
"laravel-lang/config": "^1.1", | ||
"laravel-lang/locales": "^2.8" | ||
}, | ||
"require-dev": { | ||
"orchestra/testbench": "^8.23 || ^9.1", | ||
"pestphp/pest": "^2.34", | ||
"pestphp/pest-plugin-laravel": "^2.4", | ||
"symfony/var-dumper": "^6.0 || ^7.0" | ||
}, | ||
"minimum-stability": "stable", | ||
"prefer-stable": true, | ||
"autoload": { | ||
"psr-4": { | ||
"LaravelLang\\Routes\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\": "tests/" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"composer/package-versions-deprecated": true, | ||
"dragon-code/codestyler": true, | ||
"ergebnis/composer-normalize": true, | ||
"pestphp/pest-plugin": true, | ||
"php-http/discovery": true, | ||
"symfony/thanks": true | ||
}, | ||
"preferred-install": "dist", | ||
"sort-packages": true | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"LaravelLang\\Routes\\ServiceProvider" | ||
] | ||
} | ||
}, | ||
"scripts": { | ||
"test": "vendor/bin/pest --parallel" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory suffix="Test.php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./app</directory> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</source> | ||
<php> | ||
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF" /> | ||
|
||
<env name="SESSION_DRIVER" value="array" /> | ||
<env name="CACHE_STORE" value="array" /> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace LaravelLang\Routes\Concerns; | ||
|
||
use LaravelLang\Config\Data\RouteNameData; | ||
use LaravelLang\Config\Facades\Config; | ||
|
||
trait KeyNames | ||
{ | ||
public function names(): RouteNameData | ||
{ | ||
return Config::shared()->routes->names; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace LaravelLang\Routes\Middlewares; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
class CookiesLocale extends Middleware | ||
{ | ||
protected function detect(Request $request): bool|float|int|string|null | ||
{ | ||
return $request->cookie($this->names()->cookie); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace LaravelLang\Routes\Middlewares; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
class HeaderLocale extends Middleware | ||
{ | ||
protected function detect(Request $request): bool|float|int|string|null | ||
{ | ||
return $request->header($this->names()->header); | ||
} | ||
} |
Oops, something went wrong.