Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1714136d4 | ||
|
|
55e8c36cda | ||
|
|
57bdaeaa6f | ||
|
|
776cb2e96a | ||
|
|
a3d6115daa | ||
|
|
32c0eca8d9 | ||
|
|
439ba86dea |
No files matched your search
@@ -1,16 +0,0 @@
|
||||
* text=auto
|
||||
|
||||
.github/ export-ignore
|
||||
tests/ export-ignore
|
||||
|
||||
app/ export-ignore
|
||||
docs/ export-ignore
|
||||
excludes/ export-ignore
|
||||
|
||||
.editorconfig export-ignore
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
|
||||
package.json export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
@@ -1 +0,0 @@
|
||||
open_collective: "laravel-lang"
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
name: "Bug report"
|
||||
about: "Report something that's broken. Please ensure your Laravel version is still supported: https://github.com/Laravel-Lang/lang#via-composer"
|
||||
---
|
||||
|
||||
<!-- DO NOT THROW THIS AWAY -->
|
||||
<!-- Fill out the FULL versions with patch versions -->
|
||||
|
||||
- Laravel-Lang Version: #.#.#
|
||||
- PHP Version: #.#.#
|
||||
|
||||
### Description:
|
||||
|
||||
|
||||
### Steps To Reproduce:
|
||||
@@ -1,11 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Feature, Questions & Other
|
||||
url: https://github.com/Laravel-Lang/lang/discussions
|
||||
about: 'If you have a question or need help using the library, click:'
|
||||
- name: Laravel issue
|
||||
url: https://laravel.com/docs
|
||||
about: 'If you have a question about your Laravel implementation, ask it in your Laravel project.'
|
||||
- name: Package Manager issue
|
||||
url: https://github.com/Laravel-Lang/lang#projects-based-on-this-package
|
||||
about: 'If you have a question about the work of a translation manager, ask their developers:'
|
||||
@@ -1,46 +0,0 @@
|
||||
name: docs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- generate-docs
|
||||
|
||||
jobs:
|
||||
handle-dispatch:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
id: npm-cache
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-npm-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.npm-cache.outputs.cache-hit != 'true'
|
||||
run: npm i
|
||||
|
||||
- name: Build VuePress site
|
||||
run: npm run build
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: crazy-max/ghaction-github-pages@v2
|
||||
with:
|
||||
target_branch: gh-pages
|
||||
build_dir: docs/.vuepress/dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,24 +0,0 @@
|
||||
name: phpunit
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: PHP Unit
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json
|
||||
coverage: none
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer update --prefer-stable --prefer-dist --no-progress --no-interaction
|
||||
|
||||
- name: Execute tests
|
||||
run: sudo vendor/bin/phpunit
|
||||
@@ -1,125 +0,0 @@
|
||||
name: update
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json
|
||||
coverage: none
|
||||
|
||||
- name: Git setup
|
||||
if: success()
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer update --prefer-stable --prefer-dist --no-progress --no-interaction
|
||||
composer global require ergebnis/composer-normalize
|
||||
|
||||
- name: Normalize composer.json
|
||||
id: normalize
|
||||
if: success()
|
||||
run: |
|
||||
IS_DIRTY=1
|
||||
|
||||
composer normalize
|
||||
|
||||
{ git add . && git commit -a -m "Normalize composer.json"; } || IS_DIRTY=0
|
||||
|
||||
echo ::set-output name=is_dirty::${IS_DIRTY}
|
||||
|
||||
- name: Scanning packages
|
||||
id: packages
|
||||
if: success()
|
||||
run: |
|
||||
IS_DIRTY=1
|
||||
|
||||
php app/packages.php
|
||||
|
||||
{ git add . && git commit -a -m "Updating package files"; } || IS_DIRTY=0
|
||||
|
||||
echo ::set-output name=is_dirty::${IS_DIRTY}
|
||||
|
||||
- name: Keys actualization
|
||||
id: keys
|
||||
if: success()
|
||||
run: |
|
||||
IS_DIRTY=1
|
||||
|
||||
php app/keys.php
|
||||
|
||||
{ git add . && git commit -a -m "Updating translations keys"; } || IS_DIRTY=0
|
||||
|
||||
echo ::set-output name=is_dirty::${IS_DIRTY}
|
||||
|
||||
- name: Updating referents
|
||||
id: referents
|
||||
if: success()
|
||||
run: |
|
||||
IS_DIRTY=1
|
||||
|
||||
php app/referents.php
|
||||
|
||||
{ git add . && git commit -a -m "Updating the docs/referents.md file"; } || IS_DIRTY=0
|
||||
|
||||
echo ::set-output name=is_dirty::${IS_DIRTY}
|
||||
|
||||
- name: Checking for excludes
|
||||
id: excludes
|
||||
if: success()
|
||||
run: |
|
||||
IS_DIRTY=1
|
||||
|
||||
php app/excludes.php
|
||||
|
||||
{ git add . && git commit -a -m "Updating excludes files"; } || IS_DIRTY=0
|
||||
|
||||
echo ::set-output name=is_dirty::${IS_DIRTY}
|
||||
|
||||
- name: Update statuses
|
||||
id: status
|
||||
if: success()
|
||||
run: |
|
||||
IS_DIRTY=1
|
||||
|
||||
php app/status.php
|
||||
|
||||
{ git add . && git commit -a -m "Updated status of translations"; } || IS_DIRTY=0
|
||||
|
||||
echo ::set-output name=is_dirty::${IS_DIRTY}
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
if: |
|
||||
success() && (
|
||||
steps.excludes.outputs.is_dirty == 1 ||
|
||||
steps.keys.outputs.is_dirty == 1 ||
|
||||
steps.normalize.outputs.is_dirty == 1 ||
|
||||
steps.packages.outputs.is_dirty == 1 ||
|
||||
steps.referents.outputs.is_dirty == 1 ||
|
||||
steps.status.outputs.is_dirty == 1
|
||||
)
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Generate Docs Trigger
|
||||
uses: myrotvorets/trigger-repository-dispatch-action@1.1.0
|
||||
if: success()
|
||||
with:
|
||||
token: ${{ secrets.HELLDAR_GITHUB_TOKEN }}
|
||||
repo: Laravel-Lang/lang
|
||||
type: generate-docs
|
||||
|
||||
+2
-19
@@ -1,20 +1,3 @@
|
||||
.idea/
|
||||
_site/
|
||||
build/
|
||||
node_modules/
|
||||
vendor/
|
||||
|
||||
.cache
|
||||
_site
|
||||
/vendor/
|
||||
.DS_Store
|
||||
.php_cs.cache
|
||||
.phpintel
|
||||
.temp
|
||||
|
||||
*.bak
|
||||
*.cache
|
||||
*.clover
|
||||
*.orig
|
||||
|
||||
composer.lock
|
||||
package-lock.json
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
|
||||
<package-json value="$PROJECT_DIR$/package.json" />
|
||||
<command value="run" />
|
||||
<scripts>
|
||||
<script value="build" />
|
||||
</scripts>
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,12 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="dev" type="js.build_tools.npm" nameIsGenerated="true">
|
||||
<package-json value="$PROJECT_DIR$/package.json" />
|
||||
<command value="run" />
|
||||
<scripts>
|
||||
<script value="dev" />
|
||||
</scripts>
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
+511
@@ -0,0 +1,511 @@
|
||||
# Changelog
|
||||
|
||||
16 December 2014
|
||||
|
||||
* Add Lithunian (lt) by [trigras](https://github.com/trigras)
|
||||
|
||||
17 November 2014
|
||||
|
||||
* Update French (fr) by [Youghourta Benali](https://github.com/djug)
|
||||
|
||||
16 November 2014
|
||||
|
||||
* Update Portuguese (pt) by [Francisco Neves](https://github.com/fntneves)
|
||||
* Update Arabic (ar) by [Youghourta Benali](https://github.com/djug)
|
||||
|
||||
14 November 2014
|
||||
|
||||
* Update Swedish (sv) by [Robin Hallabro](https://github.com/hallabro)
|
||||
|
||||
31 October 2014
|
||||
|
||||
* Update Catalan (ca) by [Gerard Nesta](https://github.com/gerardnll)
|
||||
|
||||
22 October 2014
|
||||
|
||||
* Update Farsi (fa) by [Reza](https://github.com/PlangCoder)
|
||||
|
||||
14 October 2014
|
||||
|
||||
* Update Bosnian (bs) by [mrakodol](https://github.com/mrakodol)
|
||||
|
||||
05 October 2014
|
||||
|
||||
* Update Indonesian (id) by [Ivo Idham Perdameian](https://github.com/idhamperdameian)
|
||||
|
||||
30 September 2014
|
||||
|
||||
* Update Turkish (tr) for validation.email by [Isa Ishangulyyev](https://github.com/isa424)
|
||||
|
||||
28 September 2014
|
||||
|
||||
* Update Turkish (tr) for reminders.reset and validation.timezone by [azakhi](https://github.com/azakhi)
|
||||
|
||||
22 September 2014
|
||||
|
||||
* Update Bulgarian (bg) for reminders.reset by [Roumen Damianoff](https://github.com/RoumenDamianoff)
|
||||
* Update German (de) for reminders.reset, validation.boolean and validation.timezone by [Marius Gebhardt](https://github.com/gbhrdt)
|
||||
* Update Greek (el) for reminders and validations by [Nikos Gr](https://github.com/grrnikos)
|
||||
|
||||
18 September 2014
|
||||
|
||||
* Update Spanish (es) for reminders.reset and validation.timezone by [Facundo Farias](https://github.com/facundofarias)
|
||||
|
||||
15 September 2014
|
||||
|
||||
* Update Italian (it) for validations and reminders.reset by [Budi Irawan](https://github.com/deerawan)
|
||||
|
||||
14 September 2014
|
||||
|
||||
* Update Vietnamese (vi) for reminders.reset and validation.timezone by [Nguyễn Văn Ánh](https://github.com/anhskohbo)
|
||||
|
||||
10 September 2014
|
||||
|
||||
* Update Bulgarian (bg) for validation.timezone, required*, boolean by [starstreak](https://github.com/starstreak)
|
||||
|
||||
08 September 2014
|
||||
|
||||
* Update Polish (pl) by [Jakub Syty](https://github.com/Nekromancer)
|
||||
|
||||
06 September 2014
|
||||
|
||||
* Add Turkmen (tk) by [Isa Ishangulyyev](https://github.com/isa424)
|
||||
|
||||
05 September 2014
|
||||
|
||||
* Update Dutch (nl) for validation.timezone by [Mark Mooibroek](https://github.com/markmooibroek)
|
||||
|
||||
03 September 2014
|
||||
|
||||
* Update Dutch (nl) for reminders.reset by [Mark Mooibroek](https://github.com/markmooibroek)
|
||||
* Update Thai (th) for reminders.reset, validation.boolean, validation.timezone by [Pachara Limkraisan](https://github.com/kthoth)
|
||||
|
||||
26 August 2014
|
||||
|
||||
* Update Korean (ko) for reminders.reset, reminders.send, validation by [dbwhddn10](https://github.com/dbwhddn10)
|
||||
* Update Traditional Chinese (Hong Kong) (zh-HK), Chinese from Taiwan (zh-TW) and Chinese (zh-CN) for validation.timezone and reminders.reset by [Carlos](https://github.com/overtrue)
|
||||
|
||||
25 August 2014
|
||||
|
||||
* Update Portuguese (pt) for validation.timezone by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
* Update Brazilian (pt-BR) for validation.timezone and reminders.reset by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
* Update Swedish (sv) for reminders.reset and validation.timezone by [Christoffer Rydberg](https://github.com/murum)
|
||||
|
||||
24 August 2014
|
||||
|
||||
* Update Russian (ru) for reminders.reset and validation.timezone by [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
|
||||
23 August 2014
|
||||
|
||||
* Add reminders.reset and validation.timezone for all languages
|
||||
* Update French (fr) for reminders.reset and validation.timezone by [Fred Delrieu](https://github.com/caouecs)
|
||||
|
||||
12 August 2014
|
||||
|
||||
* Update Traditional Chinese (Hong Kong) (zh-HK) by [Eric Li](https://github.com/ericksli)
|
||||
|
||||
10 August 2014
|
||||
|
||||
* Update Brazilian (pt-BR) and Portuguese (pt) for validation.boolean by
|
||||
* Update Hungarian (hu) by [Zsombor Franczia](https://github.com/frzsombor)
|
||||
|
||||
2 August 2014
|
||||
|
||||
* Update Swedish (sv) for validation.boolean by [coldKingdom](https://github.com/coldKingdom)
|
||||
|
||||
27 July 2014
|
||||
|
||||
* Update Indonesian (id) for validation.boolean by [Ivo Idham Perdameian](https://github.com/idhamperdameian)
|
||||
|
||||
24 July 2014
|
||||
|
||||
* Update Vietnamese (vi) for validation.boolean by [Nguyễn Văn Ánh](https://github.com/anhskohbo)
|
||||
|
||||
17 July 2014
|
||||
|
||||
* Update French (fr) for reminders.user by [Erwan](https://github.com/NaWer)
|
||||
|
||||
16 July 2014
|
||||
|
||||
* Update Spanish (es) for validation.boolean by [sauralph](https://github.com/sauralph)
|
||||
|
||||
9 July 2014
|
||||
|
||||
* Update Turkish (tr) for validation.boolean, validation.required_with_all and validation.required_without_all by [Fatih AYTAÇ](https://github.com/computeus)
|
||||
|
||||
8 July 2014
|
||||
|
||||
* Update Chinese from Taiwan for validation.boolean by [Joy](https://github.com/joychao)
|
||||
* Update Traditional Chinese (Hong Kong) (zh-HK) and Chinese (zh-CN) for validation.boolean and validation.exists by [Joy](https://github.com/joychao)
|
||||
|
||||
27 June 2014
|
||||
|
||||
* Update Thai (th) for reminders.send by [chotikarn](https://github.com/chotikarn)
|
||||
* Update Brazilian (pt-BR) for validation.unique by [Ricardo Fuhrmann](https://github.com/Fuhrmann)
|
||||
|
||||
19 June 2014
|
||||
|
||||
* Update Brazilian (pt-BR) for validation.boolean and validation.required_with_all by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
* Update Portuguese (pt) for validation.boolean and validation.required_with_all by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
* Update Spanish (es) for validation.active_url by Benjamin Worwa
|
||||
|
||||
11 June 2014
|
||||
|
||||
* Update Danish (da) for validation.boolean by [Daniel Bøndergaard](https://github.com/danielboendergaard)
|
||||
|
||||
10 June 2014
|
||||
|
||||
* Update French (fr) for validation.boolean by [Fred Delrieu](https://github.com/caouecs)
|
||||
* Update Russian (ru) for validation.boolean by [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
* Add validation.boolean for all languages
|
||||
|
||||
09 June 2014
|
||||
|
||||
* Update Macedonian (mk) by [Marko Aleksic](https://github.com/psybaron)
|
||||
|
||||
31 May 2014
|
||||
|
||||
* Update Bosnian (bs) by [Edis Golubić](https://github.com/golubic)
|
||||
|
||||
24 May 2014
|
||||
|
||||
* Update Japanese (ja) by [Yuya Takahashi](https://github.com/takahashiyuya)
|
||||
|
||||
15 May 2014
|
||||
|
||||
* Update Swedish (sv) by [Alexander Wallin](https://github.com/alexanderwallin)
|
||||
|
||||
27 April 2014
|
||||
|
||||
* Update Persian (fa) by [Siamak A.M](https://github.com/blacksrc)
|
||||
|
||||
20 April 2014
|
||||
|
||||
* Add Saridinian (sa) by Massimeddu Cireddu
|
||||
|
||||
18 April 2014
|
||||
|
||||
* Update Chinese (zh-CN) by [JohnLui](https://github.com/johnlui)
|
||||
|
||||
14 April 2014
|
||||
|
||||
* Add Persian (fa) by [Siamak A.M](https://github.com/blacksrc)
|
||||
|
||||
11 April 2014
|
||||
|
||||
* Update Russian (ru) by [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
|
||||
07 April 2014
|
||||
|
||||
* Update Chinese (zh-CN) by [Joy](https://github.com/joychao)
|
||||
* Update Chinese from Hong Kong (zh-HK) by [Joy](https://github.com/joychao)
|
||||
* Add Chinese from Taiwan (zh-TW) by [Joy](https://github.com/joychao)
|
||||
* Update Japanese (ja) for validation by [Yuya Takahashi](https://github.com/takahashiyuya)
|
||||
|
||||
04 April 2014
|
||||
|
||||
* Update German (de) for reminders and validation.required_with_all by [lanort](https://github.com/lanort)
|
||||
* Update Japanese (ja) for reminders by [Yuya Takahashi](https://github.com/takahashiyuya)
|
||||
|
||||
03 April 2014
|
||||
|
||||
* Update Swedish (sv) for validation.required_without_all, new validation.email and validation.required_with_all by [coldKingdom](https://github.com/coldKingdom)
|
||||
|
||||
31 March 2014
|
||||
|
||||
* Update Arabic (ar) for fix, validation.required_without_all and validation.required_with_all by [bo3bdo](https://github.com/bo3bdo)
|
||||
|
||||
29 March 2014
|
||||
|
||||
* Update Spanish (es) for validation.required_without_all and validation.required_with_all by [Anton Zekeriev Rodin](https://github.com/antonrodin)
|
||||
|
||||
14 March 2014
|
||||
|
||||
* Update French (fr) with fix by [Elyahou](https://github.com/Elyahou)
|
||||
|
||||
12 March 2014
|
||||
|
||||
* Update Dutch (nl) with `required_*` by [Herman](https://github.com/sintemaa)
|
||||
* Update Danish (da) with fix by [Daniel Bøndergaard](https://github.com/danielboendergaard)
|
||||
|
||||
05 March 2014
|
||||
|
||||
* Update Indonesian (id) with Translated lines description by [Ivo Idham Perdameian](https://github.com/idhamperdameian)
|
||||
|
||||
03 March 2014
|
||||
|
||||
* Add Montenegrin (me) by [Ognjen MIletić](https://github.com/ognjenm)
|
||||
* Update Bosnian (bs) for reminders.send and validation.required_without_all by [mrakodol](https://github.com/mrakodol)
|
||||
* Update Danish (da) for validation.required_without_all, new validation.email and validation.required_with_all by [Daniel Bøndergaard](https://github.com/danielboendergaard)
|
||||
* Update French (fr) for validation.between.array by [Alex-Info.net](https://github.com/AlexInfoNet)
|
||||
|
||||
02 March 2014
|
||||
|
||||
* Fix on Russian (ru) for validation.required_with_all by [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
|
||||
01 March 2014
|
||||
|
||||
* Update Indonesian (id) for validation.required_with_all by [Ivo Idham Perdameian](https://github.com/idhamperdameian)
|
||||
* Update French (fr) with validation.required_with_all by [Fred Delrieu](https://github.com/caouecs)
|
||||
* Update all languages with example for custom message by [Ivo Idham Perdameian](https://github.com/idhamperdameian)
|
||||
* All validation.required_with_all in all languages ( english version ) by [Fred Delrieu](https://github.com/caouecs)
|
||||
|
||||
28 February 2014
|
||||
|
||||
* Update Russian (ru) for validation.required_with_all and example for custom message by [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
* Update French (fr) with validation.attributes.password_confirmation by [Barbuslex](https://github.com/barbuslex)
|
||||
* Update Vietnamese (vi) for new validation.email and validation.required_without_all by [anhsaker](https://github.com/anhsaker)
|
||||
|
||||
27 February 2014
|
||||
|
||||
* Update Russian (ru) for new validation.email by [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
* Update Indonesian (id) for fix, validation.required_without_all and new validation.email by [Ivo Idham Perdameian](https://github.com/idhamperdameian)
|
||||
|
||||
26 February 2014
|
||||
|
||||
* Update German (de) for validation.required_without_all by [justb81](https://github.com/justb81)
|
||||
* Update Romanian (ro) by [Vadim](https://github.com/cojocaru)
|
||||
|
||||
25 February 2014
|
||||
|
||||
* Update Romanian (ro) by [Vadim](https://github.com/cojocaru)
|
||||
|
||||
18 February 2014
|
||||
|
||||
* Update Serbian (sr) for reminders and validation files by [Adis](https://github.com/adis-me)
|
||||
|
||||
07 February 2014
|
||||
|
||||
* Add Cambodian (km) by [Chanthoeun Kim](https://github.com/Chanthoeun)
|
||||
* Update Russian (ru) for validation.required_without_all by [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
* Update Portuguese (pt) and Brazilian (pt-BR) for validation.required_without_all [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
* Update Swedish (sv) and Finnish (fi) by [Linus Odenring](https://github.com/linusodenring)
|
||||
|
||||
06 February 2014
|
||||
|
||||
* Update French (fr) with validation.required_without_all by [Fred Delrieu](https://github.com/caouecs)
|
||||
* Add validation.required_without_all in English for all files
|
||||
* Update Swedish (sv) and Finnish (fi) by [Linus Odenring](https://github.com/linusodenring)
|
||||
|
||||
05 February 2014
|
||||
|
||||
* Update French (fr) by [Alexandre Butynski](https://github.com/alexandre-butynski)
|
||||
|
||||
28 January 2014
|
||||
|
||||
* Update Arabic (ar) by [Ihab Shoully](https://github.com/shoully)
|
||||
|
||||
26 January 2014
|
||||
|
||||
* Update Brazilian (pt-BR) for Laravel 4.1 by [Gabriel Machado](https://github.com/gmsantosxl)
|
||||
* Update Slovak (sk) by [Andrej Badin](https://github.com/Andreyco)
|
||||
|
||||
22 January 2014
|
||||
|
||||
* Update Italian (it) by [Davide Bellini](https://github.com/billmn)
|
||||
* Update Arabic (ar) for Laravel 4.1 by [Ihab Shoully](https://github.com/shoully)
|
||||
|
||||
15 January 2014
|
||||
|
||||
* Update Danish (da) for Laravel 4.1 by [Daniel Bøndergaard](https://github.com/danielboendergaard)
|
||||
|
||||
13 January 2014
|
||||
|
||||
* Update Swedish and Norwegian Bokmål for Laravel 4.1 by [thomeu](https://github.com/thomeu)
|
||||
|
||||
10 January 2014
|
||||
|
||||
* Update Indonesian (id) for Laravel 4.0 and 4.1 by [Ivo Idham Perdameian](https://github.com/idhamperdameian)
|
||||
|
||||
09 January 2014
|
||||
|
||||
* Update Turkish (tr) for Laravel 4.1 by [Arda Kılıçdağı](https://github.com/Ardakilic)
|
||||
* Update Polish (pl) for Laravel 4.0 and 4.1 by [Marcin Sągol](https://github.com/soee)
|
||||
|
||||
30 December 2013
|
||||
|
||||
* Update Czech (cs) for Laravel 4.1 by [rozklad](https://github.com/rozklad)
|
||||
|
||||
29 December 2013
|
||||
|
||||
* Update Italian (it) for Laravel 4.1 by [alextesi](https://github.com/alextesi)
|
||||
|
||||
28 December 2013
|
||||
|
||||
* Update German (de) for Laravel 4.1 by [Gerald Lindner](https://github.com/vauteer)
|
||||
|
||||
23 December 2013
|
||||
|
||||
* Update Greek (el) for Laravel 4.1 by [dimsav](https://github.com/dimsav)
|
||||
|
||||
17 December 2013
|
||||
|
||||
* Fix Spanish (es) by [Javier Cadiz](https://github.com/cadizjavier)
|
||||
|
||||
16 December 2013
|
||||
|
||||
* Fix Slovak (sk) by [Roumen Damianoff](https://github.com/RoumenDamianoff)
|
||||
* Update Bulgarian (bg) for Laravel 4.0 and Laravel 4.1 by [Roumen Damianoff](https://github.com/RoumenDamianoff)
|
||||
|
||||
15 December 2013
|
||||
|
||||
* Update Arabic (ar) for Laravel 4.1 by [Ammar Alakkad](https://github.com/AAlakkad)
|
||||
|
||||
12 December 2013
|
||||
|
||||
* Update Catalan (ca) and Spanish (es) for Laravel 4.1 by [David Moreno](https://github.com/davidmb91)
|
||||
* Update Portuguese (pt) for Laravel 4.1 by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
|
||||
01 December 2013
|
||||
|
||||
* Update Vietnamese (vi) for Laravel 4.1 by [anhsaker](https://github.com/anhsaker)
|
||||
|
||||
21 November 2013
|
||||
|
||||
* Add reminders.sent in develop branch for Laravel 4.1
|
||||
* Update French (fr) by [Fred Delrieu](https://github.com/caouecs)
|
||||
* Update Russian (ru) by [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
|
||||
18 November 2013
|
||||
|
||||
* Add Macedonian (mk) by [maced0n](https://github.com/maced0n)
|
||||
|
||||
10 November 2013
|
||||
|
||||
* Add Catalan (ca) by [David Moreno](https://github.com/davidmb91)
|
||||
|
||||
09 Novembre 2013
|
||||
|
||||
* Array elements (it) and (ro) by [Ionut Tanasa](https://github.com/ionut-tanasa)
|
||||
|
||||
02 November 2013
|
||||
|
||||
* Add Korean (ko) by [Kaden Lee](https://github.com/thisiskaden)
|
||||
|
||||
30 October 2013
|
||||
|
||||
* Add Slovak (sk) by [Martin Olšanský](https://github.com/MartinOlsansky)
|
||||
* Add Czech (cs) by [rozklad](https://github.com/rozklad)
|
||||
|
||||
27 October 2013
|
||||
|
||||
* Add Norwegian Bokmål (nb) by [Marius](https://github.com/mariuso)
|
||||
|
||||
23 October 2013
|
||||
|
||||
* Array elements (th) by [chotikarn](https://github.com/chotikarn)
|
||||
|
||||
18 October 2013
|
||||
|
||||
* Fix Russian (ru) by [Vasily Tsybenko](https://github.com/VasayXTX)
|
||||
|
||||
16 October 2013
|
||||
|
||||
* Add Bosnian (bs) by [mrakodol](https://github.com/mrakodol)
|
||||
|
||||
01 October 2013
|
||||
|
||||
* Fix German (de) by [nullEuro](https://github.com/nullEuro)
|
||||
|
||||
20 Septembre 2013
|
||||
|
||||
* Fix Portuguese (pt) by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
|
||||
19 September 2013
|
||||
|
||||
* Array elements (pt-BR) by [insign](https://github.com/insign)
|
||||
|
||||
06 September 2013
|
||||
|
||||
* Fix german (de) by [lanort](https://github.com/lanort)
|
||||
|
||||
18 August 2013
|
||||
|
||||
* Array elements (el) by [Konstantinos Pittas](https://github.com/kostaspt)
|
||||
|
||||
14 August 2013
|
||||
|
||||
* Array elements (tr) by [Sinan Eldem](https://github.com/sineld)
|
||||
* Array elements (ru) by [EvgenyKovalev](https://github.com/EvgenyKovalev)
|
||||
* Array elements (de) by [Jones](https://github.com/JN-Jones)
|
||||
|
||||
13 August 2013
|
||||
|
||||
* Array elements (es) by [Nikoskip](https://github.com/nikoskip)
|
||||
|
||||
12 August 2013
|
||||
|
||||
* Array elements (nl) by [juukie14](https://github.com/juukie14)
|
||||
|
||||
05 August 2013
|
||||
|
||||
* Fix Arabic (ar) by [Ibrahim AshShohail](https://github.com/laheab)
|
||||
* Add array elements
|
||||
|
||||
04 August 2013
|
||||
|
||||
* Fix German (de) by [iflow](https://github.com/iflow)
|
||||
|
||||
30 July 2013
|
||||
|
||||
* Add Brazilian (pt-BR) by [c0h1b4](https://github.com/c0h1b4)
|
||||
* Update Brazilian (pt-BR) by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
* Add Vietnamese (vi) by [anhsaker](https://github.com/anhsaker)
|
||||
|
||||
19 July 2013
|
||||
|
||||
* Update Swedish (sv) by [Jonas Söderberg](https://github.com/imevul)
|
||||
|
||||
12 July 2013
|
||||
|
||||
* Review (pt) by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
|
||||
06 July 2013
|
||||
|
||||
* Add validation.attributes (fr) by [Fred Delrieu](https://github.com/caouecs)
|
||||
* Indentation
|
||||
|
||||
04 July 2013
|
||||
|
||||
* Add Thai (th) by [teepluss](https://github.com/teepluss)
|
||||
* Add many languages files from Laravel3 - need review
|
||||
|
||||
02 July 2013
|
||||
|
||||
* ISO 639-1 for Danish (dk->da) by [Fred Delrieu](https://github.com/caouecs)
|
||||
|
||||
22 June 2013
|
||||
|
||||
* Review (nl) by [Thomasdezeeuw](https://github.com/Thomasdezeeuw)
|
||||
|
||||
17 June 2013
|
||||
|
||||
* Review (nl) by [jaspur](https://github.com/jaspur)
|
||||
|
||||
14 June 2013
|
||||
|
||||
* Add Hungarian (hu) by [terdelyi](https://github.com/terdelyi)
|
||||
* Add Portuguese (pt) by [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
|
||||
13 June 2013
|
||||
|
||||
* Review Danish (dk) by [hauthorn](https://github.com/hauthorn)
|
||||
|
||||
11 June 2013
|
||||
|
||||
* Review (tr) by [pellempus](https://github.com/pellempus)
|
||||
|
||||
09 June 2013
|
||||
|
||||
* Add Danish (dk) by [AndreasHeiberg](https://github.com/AndreasHeiberg)
|
||||
|
||||
07 June 2013
|
||||
|
||||
* Add Greek (el) by [igaster](https://github.com/igaster)
|
||||
* Update (es) by [Nikoskip](https://github.com/nikoskip)
|
||||
|
||||
04 June 2013
|
||||
|
||||
* Add traditional chinese (HK) by [efilm](https://github.com/efilm)
|
||||
* Add attributes (ar) by [AAlakkad](https://github.com/AAlakkad)
|
||||
* Review (nl) by [jeroengerits](https://github.com/jeroengerits)
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
# MIT License
|
||||
|
||||
Copyright (c) 2022 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.
|
||||
@@ -1,30 +1,129 @@
|
||||
# Laravel Lang
|
||||
Laravel-lang
|
||||
=============
|
||||
|
||||

|
||||
In this repository, you can find the lang files for the framework PHP, [Laravel 4&5](http://www.laravel.com).
|
||||
|
||||
In this repository, you can find the lang files for the [Laravel Framework 4-9](https://laravel.com), [Laravel Jetstream](https://jetstream.laravel.com)
|
||||
, [Laravel Fortify](https://github.com/laravel/fortify), [Laravel Cashier](https://laravel.com/docs/billing), [Laravel Breeze](https://github.com/laravel/breeze)
|
||||
, [Laravel Nova](https://nova.laravel.com), [Laravel Spark](https://spark.laravel.com) and [Laravel UI](https://github.com/laravel/ui).
|
||||
---
|
||||
|
||||
<p align="center">
|
||||
[
|
||||
<a href="https://laravel-lang.com">Documentation</a> |
|
||||
<a href="https://laravel-lang.com/status.html">Translations Status</a>
|
||||
]
|
||||
</p>
|
||||
How add languages in my app ?
|
||||
---
|
||||
|
||||
## Documentation
|
||||
### Installation by GitHub
|
||||
|
||||
See the [documentation](https://laravel-lang.com) for detailed installation and usage instructions.
|
||||
* Clone the [GitHub repository](https://github.com/caouecs/laravel-lang/) : *git clone https://github.com/caouecs/laravel-lang.git*
|
||||
* Or download the [zip file](https://github.com/caouecs/laravel-lang/archive/master.zip)
|
||||
* Choose the branch:
|
||||
* `laravel4` for Laravel4 project
|
||||
* `master` for Laravel5 project
|
||||
* Copy the folders of languages that you want, in *app/lang* folder of your application Laravel
|
||||
|
||||
## Translation managers
|
||||
|
||||
* [Lang Publisher](https://publisher.laravel-lang.com) by [*@Laravel-Lang/laravel-lang*](https://github.com/Laravel-Lang/publisher) - Easy installation and update of
|
||||
translation files for your project.
|
||||
* [LaravelLang](https://github.com/ARCANEDEV/LaravelLang) by [*@arcanedev-maroc*](https://github.com/ARCANEDEV) - Translations manager and checker for Laravel.
|
||||
* [Laravel-lang](https://github.com/overtrue/laravel-lang) by [*@overtrue*](https://github.com/overtrue) - Command to add languages in your project.
|
||||
### Installation by Composer
|
||||
|
||||
## Credits
|
||||
* For Laravel 4 : add `"caouecs/laravel4-lang": "~1.0"` in your `composer.json` in "require" or run *composer require caouecs/laravel4-lang*
|
||||
* For Laravel 5 : add `"caouecs/laravel4-lang": "~2.0"` in your `composer.json` in "require"
|
||||
* Do "composer update"
|
||||
* Files of languages are in "vendor/caouecs/laravel4-lang" directory
|
||||
* Copy the folders of languages that you want, in *app/lang* folder of your application Laravel
|
||||
|
||||
- [Referents by language](https://laravel-lang.com/referents.html)
|
||||
- [All Contributors](https://github.com/Laravel-Lang/lang/graphs/contributors)
|
||||
### Installation by Command
|
||||
|
||||
If you have a Laravel5 project, you can use `laravel-lang` project of overtrue : *composer require "overtrue/laravel-lang:dev-master"*
|
||||
|
||||
### Language by default in your app
|
||||
|
||||
In the file *app/config/app.php*, change the value of *language* by the short name of your language.
|
||||
|
||||
---
|
||||
|
||||
How can I add a language in this project ?
|
||||
---
|
||||
|
||||
* fork this repository
|
||||
* create a directory with the short name of the language (ex: fr for French) from ISO-639-1 ( see [Wikipedia](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) )
|
||||
* copy this three files of the english version with your translate
|
||||
* for [Laravel](https://github.com/laravel/laravel/tree/master/app/lang/en)
|
||||
* add a pull request with the name of the language
|
||||
|
||||
|
||||
How can I fix a file ?
|
||||
---
|
||||
|
||||
* fork this repository
|
||||
* update the file
|
||||
* add a pull request with the name of the language
|
||||
|
||||
Laravel 4.0
|
||||
---
|
||||
|
||||
We need your help to finish to translate `validation.php` file with array elements.
|
||||
|
||||
You can follow translations in the issue [#73](https://github.com/caouecs/laravel-lang/issues/73).
|
||||
|
||||
Laravel 4.1
|
||||
---
|
||||
|
||||
### Password reminder sent
|
||||
|
||||
To be ready for the new version of Laravel, we need your help. In `reminders.php` file, a new line has been added :
|
||||
|
||||
"sent" => "Password reminder sent!",
|
||||
|
||||
You can follow translations in the issue [#137](https://github.com/caouecs/laravel-lang/issues/137).
|
||||
|
||||
### Required without all
|
||||
|
||||
In `validation.php` file, a new line has been added :
|
||||
|
||||
"required_without_all" => "The :attribute field is required when none of :values are present."
|
||||
|
||||
You can follow translations in the issue [#172](https://github.com/caouecs/laravel-lang/issues/172).
|
||||
|
||||
### Validation email
|
||||
|
||||
In `validation.php` file, the text for email has been updated :
|
||||
|
||||
"email" => "The :attribute must be a valid email address."
|
||||
|
||||
You can follow translations in the issue [#187](https://github.com/caouecs/laravel-lang/issues/187).
|
||||
|
||||
### Required with all
|
||||
|
||||
In `validation.php` file, a new line has been added :
|
||||
|
||||
"required_with_all" => "The :attribute field is required when :values is present."
|
||||
|
||||
You can follow translations in the issue [#193](https://github.com/caouecs/laravel-lang/issues/193).
|
||||
|
||||
Laravel 4.2
|
||||
---
|
||||
|
||||
### Reset in reminders
|
||||
|
||||
In `reminders.php` file, a new line has been added :
|
||||
|
||||
"reset" => "Password has been reset!"
|
||||
|
||||
You can follow translations in the issue [#258](https://github.com/caouecs/laravel-lang/issues/258).
|
||||
|
||||
### Validation.timezone
|
||||
|
||||
In `validation.php` file, a new line has been added :
|
||||
|
||||
"timezone" => "The :attribute must be a valid zone."
|
||||
|
||||
You can follow translations in the issue [#259](https://github.com/caouecs/laravel-lang/issues/259).
|
||||
|
||||
Laravel 5.0
|
||||
---
|
||||
|
||||
The files of languages have been updated for Laravel 5, in `laravel5` branch.
|
||||
|
||||
* array for PHP 5.4+
|
||||
* validation.filled, with same translation than validation.required
|
||||
* *reminders* file is now *languages* file
|
||||
|
||||
In `passwords` file [#323](https://github.com/caouecs/laravel-lang/issues/323) :
|
||||
|
||||
"sent" => "We have e-mailed your password reset link!"
|
||||
"reset" => "Your password has been reset!"
|
||||
@@ -1,3 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
This project is text translations of Laravel project. So, this project doesn't need to have security policy.
|
||||
@@ -0,0 +1,250 @@
|
||||
# Sources
|
||||
|
||||
Albanian (sq)
|
||||
|
||||
* [Flakerim Ismani](https://github.com/Flakerimi)
|
||||
|
||||
Arabic (ar)
|
||||
|
||||
* [Ammar Alakkad](https://github.com/AAlakkad)
|
||||
* [bo3bdo](https://github.com/bo3bdo)
|
||||
* [Ibrahim AshShohail](https://github.com/laheab)
|
||||
* [Ihab Shoully](https://github.com/shoully)
|
||||
* [Youghourta Benali](https://github.com/djug)
|
||||
|
||||
Bosnian (bs)
|
||||
|
||||
* [Edis Golubić](https://github.com/golubic)
|
||||
* [mrakodol](https://github.com/mrakodol)
|
||||
|
||||
Brazilian (pt-BR)
|
||||
|
||||
* [c0h1b4](https://github.com/c0h1b4)
|
||||
* [Gabriel Machado](https://github.com/gmsantosxl)
|
||||
* [insign](https://github.com/insign)
|
||||
* [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
* [Ramiro Varandas Jr](https://github.com/ramirovjr)
|
||||
* [Ricardo Fuhrmann](https://github.com/Fuhrmann)
|
||||
|
||||
Bulgarian (bg)
|
||||
|
||||
* [Roumen Damianoff](https://github.com/RoumenDamianoff)
|
||||
* [starstreak](https://github.com/starstreak)
|
||||
|
||||
Cambodian (km)
|
||||
|
||||
* [Chanthoeun Kim](https://github.com/Chanthoeun)
|
||||
|
||||
Catalan (ca)
|
||||
|
||||
* [David Moreno](https://github.com/davidmb91)
|
||||
* [Gerard Nesta](https://github.com/gerardnll)
|
||||
|
||||
Chinese (zh-CN)
|
||||
|
||||
* [Carlos](https://github.com/overtrue)
|
||||
* [JohnLui](https://github.com/johnlui)
|
||||
* [phoenixg](https://github.com/phoenixg)
|
||||
|
||||
Chinese from Taiwan (zh-TW)
|
||||
|
||||
* [Carlos](https://github.com/overtrue)
|
||||
|
||||
Czech (cs)
|
||||
|
||||
* [rozklad](https://github.com/rozklad)
|
||||
|
||||
Danish (da)
|
||||
|
||||
* [Andreas Heiberg](https://github.com/AndreasHeiberg)
|
||||
* [Christoffer Hauthorn Boisen](https://github.com/hauthorn)
|
||||
* [Daniel Bøndergaard](https://github.com/danielboendergaard)
|
||||
|
||||
Dutch (nl)
|
||||
|
||||
* [byordereurope](https://github.com/byordereurope)
|
||||
* [Herman](https://github.com/sintemaa)
|
||||
* [Jaspur](https://github.com/jaspur)
|
||||
* [Jeroen Gerits](https://github.com/jeroengerits)
|
||||
* [juukie14](https://github.com/juukie14)
|
||||
* [Mark Mooibroek](https://github.com/markmooibroek)
|
||||
* [Thomas de Zeeuw](https://github.com/Thomasdezeeuw)
|
||||
|
||||
Farsi (fa)
|
||||
|
||||
* [Reza](https://github.com/PlangCoder)
|
||||
|
||||
Finnish (fi)
|
||||
|
||||
* [Linus Odenring](https://github.com/linusodenring)
|
||||
* [Patrik](https://github.com/gkunno)
|
||||
|
||||
French (fr)
|
||||
|
||||
* [Alexandre Butynski](https://github.com/alexandre-butynski)
|
||||
* [Alex-Info.net](https://github.com/AlexInfoNet)
|
||||
* [Barbuslex](https://github.com/barbuslex)
|
||||
* [Elyahou](https://github.com/Elyahou)
|
||||
* [Erwan](https://github.com/NaWer)
|
||||
* [Fred Delrieu](https://github.com/caouecs)
|
||||
* [Laravel-France](https://github.com/laravel-france)
|
||||
* [Youghourta Benali](https://github.com/djug)
|
||||
|
||||
German (de)
|
||||
|
||||
* [Gerald Lindner](https://github.com/vauteer)
|
||||
* [iflow](https://github.com/iflow)
|
||||
* [Jones](https://github.com/JN-Jones)
|
||||
* [justb81](https://github.com/justb81)
|
||||
* [lanort](https://github.com/lanort)
|
||||
* [Marius Gebhardt](https://github.com/gbhrdt)
|
||||
* [Martin Hettiger](https://github.com/hettiger)
|
||||
* [nullEuro](https://github.com/nullEuro)
|
||||
|
||||
Greek (el)
|
||||
|
||||
* [dimsav](https://github.com/dimsav)
|
||||
* [igaster](https://github.com/igaster)
|
||||
* [Konstantinos Pittas](https://github.com/kostaspt)
|
||||
* [Nikos Gr](https://github.com/grrnikos)
|
||||
|
||||
Hebrew (he)
|
||||
|
||||
* [Orel Ben-Yair](https://github.com/LighTo273)
|
||||
|
||||
Hungarian (hu)
|
||||
|
||||
* [Tamás Erdélyi](https://github.com/terdelyi)
|
||||
* [Zsombor Franczia](https://github.com/frzsombor)
|
||||
|
||||
Indonesian (id)
|
||||
|
||||
* [apit](https://github.com/apit)
|
||||
* [Budi Irawan](https://github.com/deerawan)
|
||||
* [Ivo Idham Perdameian](https://github.com/idhamperdameian)
|
||||
* [William Notowidagdo](https://github.com/williamn)
|
||||
|
||||
Italian (it)
|
||||
|
||||
* [alextesi](https://github.com/alextesi)
|
||||
* [Davide Bellini](https://github.com/billmn)
|
||||
* [Ionut Tanasa](https://github.com/ionut-tanasa)
|
||||
* [longilineo](https://github.com/longilineo)
|
||||
|
||||
Japanese (ja)
|
||||
|
||||
* [Hirohisa Kawase](https://github.com/HiroKws)
|
||||
* [Yuya Takahashi](https://github.com/takahashiyuya)
|
||||
|
||||
Korean (ko)
|
||||
|
||||
* [dbwhddn10](https://github.com/dbwhddn10)
|
||||
* [Kaden Lee](https://github.com/thisiskaden)
|
||||
|
||||
Lithunian (lt)
|
||||
|
||||
* [trigras](https://github.com/trigras)
|
||||
|
||||
Macedonian (mk)
|
||||
|
||||
* [Marko Aleksic](https://github.com/psybaron)
|
||||
* [maced0n](https://github.com/maced0n)
|
||||
|
||||
Montenegrin (me)
|
||||
|
||||
* [Ognjen MIletić](https://github.com/ognjenm)
|
||||
|
||||
Norwegian Bokmål (nb)
|
||||
|
||||
* [Marius](https://github.com/mariuso)
|
||||
* [thomeu](https://github.com/thomeu)
|
||||
|
||||
Persian (fa)
|
||||
|
||||
* [Siamak A.M](https://github.com/blacksrc)
|
||||
|
||||
Polish (pl)
|
||||
|
||||
* [anojszewski](https://github.com/anojszewski)
|
||||
* [Jakub Syty](https://github.com/Nekromancer)
|
||||
* [Marcin Sągol](https://github.com/soee)
|
||||
|
||||
Portuguese (pt)
|
||||
|
||||
* [Francisco Neves](https://github.com/fntneves)
|
||||
* [miguelbgouveia](https://github.com/miguelbgouveia)
|
||||
* [Ramiro Varandas Jr](https://github.com/ramirovjr)
|
||||
|
||||
Romanian (ro)
|
||||
|
||||
* [flavy](https://github.com/flavy)
|
||||
* [Ionut Tanasa](https://github.com/ionut-tanasa)
|
||||
* [Vadim](https://github.com/cojocaru)
|
||||
|
||||
Russian (ru)
|
||||
|
||||
* [Evgeny Kovalev](https://github.com/EvgenyKovalev)
|
||||
* [Vasily Tsybenko](https://github.com/VasayXTX)
|
||||
|
||||
Sardinian (sa)
|
||||
|
||||
* Massimeddu Cireddu
|
||||
|
||||
Serbian (sr)
|
||||
|
||||
* [Adis](https://github.com/adis-me)
|
||||
* [Dejan Geci](https://github.com/dejangeci)
|
||||
|
||||
Slovak (sk)
|
||||
|
||||
* [Andrej Badin](https://github.com/Andreyco)
|
||||
* [Martin Olšanský](https://github.com/MartinOlsansky)
|
||||
|
||||
Spanish (es)
|
||||
|
||||
* [Anton Zekeriev Rodin](https://github.com/antonrodin)
|
||||
* Benjamin Worwa
|
||||
* [Facundo Farias](https://github.com/facundofarias)
|
||||
* [Javier Cadiz](https://github.com/cadizjavier)
|
||||
* [Nikolas](https://github.com/nikoskip)
|
||||
* [sauralph](https://github.com/sauralph)
|
||||
|
||||
Swedish (sv)
|
||||
|
||||
* [Alexander Wallin](https://github.com/alexanderwallin)
|
||||
* [Christoffer Rydberg](https://github.com/murum)
|
||||
* [coldKingdom](https://github.com/coldKingdom)
|
||||
* [Jonas Söderberg](https://github.com/imevul)
|
||||
* [Linus Odenring](https://github.com/linusodenring)
|
||||
* [Robin Hallabro](https://github.com/hallabro)
|
||||
* [thomeu](https://github.com/thomeu)
|
||||
* [Vincent Klaiber](https://github.com/vincentklaiber)
|
||||
|
||||
Thai (th)
|
||||
|
||||
* [chotikarn](https://github.com/chotikarn)
|
||||
* [Pachara Limkraisan](https://github.com/kthoth)
|
||||
* [Teepluss](https://github.com/teepluss)
|
||||
|
||||
Traditional Chinese (Hong Kong) (zh-HK)
|
||||
|
||||
* [Carlos](https://github.com/overtrue)
|
||||
* [Eric Li](https://github.com/ericksli)
|
||||
* [Fatih AYTAÇ](https://github.com/computeus)
|
||||
|
||||
Turkish (tr)
|
||||
|
||||
* [Arda Kılıçdağı](https://github.com/Ardakilic)
|
||||
* [azakhi](https://github.com/azakhi)
|
||||
* [Isa Ishangulyyev](https://github.com/isa424)
|
||||
* [pellempus](https://github.com/pellempus)
|
||||
* [Sinan Eldem](https://github.com/sineld)
|
||||
|
||||
Turkmen (tk)
|
||||
|
||||
* [Isa Ishangulyyev](https://github.com/isa424)
|
||||
|
||||
Vietnamese (vi)
|
||||
|
||||
* [anhsaker](https://github.com/anhsaker)
|
||||
* [Nguyễn Văn Ánh](https://github.com/anhskohbo)
|
||||
@@ -0,0 +1,44 @@
|
||||
# Status of Languages
|
||||
|
||||
| Language | name | v4.0 | v4.1 | required_without_all | val.email | required_with_all | val.boolean | reminders.reset | val.timezone |
|
||||
|----------|:----:|:----:|:----:|:--------------------:|:---------:|:-----------------:|:-----------:|:---------------:|:------------:|
|
||||
| Albanian | sq | -- | -- | -- | -- | -- | -- | -- | -- |
|
||||
| Arabic | ar | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Bosnian | bs | OK | OK | OK | -- | -- | -- | -- | -- |
|
||||
| Brazilian | pt-BR | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Bulgarian | bg | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Cambodian | km | OK | OK | OK | -- | -- | -- | -- | -- |
|
||||
| Catalan | ca | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Chinese | zh-CN | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Chinese from Taiwan | zh-TW | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Czech | cs | OK | OK | -- | -- | -- | -- | -- | -- |
|
||||
| Danish | da | OK | OK | OK | OK | OK | OK | -- | -- |
|
||||
| Dutch | nl | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Farsi | fa | OK | OK | OK | OK | OK | -- | -- | -- |
|
||||
| Finnish | fi | -- | OK | -- | -- | -- | -- | -- | -- |
|
||||
| French | fr | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| German | de | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Greek | el | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Hebrew | he | -- | -- | -- | -- | -- | -- | -- | -- |
|
||||
| Hungarian | hu | OK | OK | OK | OK | OK | OK | -- | -- |
|
||||
| Indonesian | id | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Italian | it | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Japanese | jp | OK | OK | OK | OK | OK | -- | -- | -- |
|
||||
| Korean | ko | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Lithunian | lt | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Macedonian | mk | OK | OK | -- | -- | -- | -- | -- | -- |
|
||||
| Montenegrin | me | OK | OK | OK | OK | OK | -- | -- | -- |
|
||||
| Norwegian Bokmål | nb | OK | OK | -- | -- | -- | -- | -- | -- |
|
||||
| Polish | pl | OK | OK | -- | -- | -- | -- | -- | -- |
|
||||
| Portuguese | pt | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Romanian | ro | OK | OK | OK | -- | -- | -- | -- | -- |
|
||||
| Russian | ru | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Serbian | sr | OK | OK | -- | -- | -- | -- | -- | -- |
|
||||
| Slovak | sk | OK | OK | -- | -- | -- | -- | -- | -- |
|
||||
| Spanish | es | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Swedish | sv | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Thai | th | OK | OK | -- | -- | -- | OK |OK | OK |
|
||||
| Traditional Chinese (Hong Kong) | zh-HK | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Turkish | tr | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Turkmen | tk | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
| Vietnamese | vi | OK | OK | OK | OK | OK | OK | OK | OK |
|
||||
@@ -1,7 +0,0 @@
|
||||
YANDEX_API_KEY=
|
||||
YANDEX_API_FOLDER_ID=
|
||||
|
||||
GIT_REPOSITORY=origin
|
||||
GIT_SOURCE_BRANCH=master
|
||||
GIT_TARGET_BRANCH=patch
|
||||
GIT_MESSAGE="[%s] Some message"
|
||||
@@ -1,3 +0,0 @@
|
||||
requests/
|
||||
|
||||
.env
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Processors\AddLocale;
|
||||
|
||||
require __DIR__ . '/bootstrap/autoload.php';
|
||||
|
||||
/** @var \LaravelLang\Development\Application $app */
|
||||
$app = require_once __DIR__ . '/bootstrap/app.php';
|
||||
|
||||
if ($locale = $argv[1] ?? null) {
|
||||
$app->processor(AddLocale::make($argv[1]));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
echo 'You must provide a localization code.';
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Application;
|
||||
|
||||
return Application::make(
|
||||
realpath(__DIR__ . '/../../')
|
||||
);
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Processors\Excludes;
|
||||
|
||||
require __DIR__ . '/bootstrap/autoload.php';
|
||||
|
||||
/** @var \LaravelLang\Development\Application $app */
|
||||
$app = require_once __DIR__ . '/bootstrap/app.php';
|
||||
|
||||
$app->processor(Excludes::make());
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Processors\Keys;
|
||||
|
||||
require __DIR__ . '/bootstrap/autoload.php';
|
||||
|
||||
/** @var \LaravelLang\Development\Application $app */
|
||||
$app = require_once __DIR__ . '/bootstrap/app.php';
|
||||
|
||||
$app->processor(Keys::make());
|
||||
@@ -1,87 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development;
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
use DragonCode\Support\Concerns\Makeable;
|
||||
use LaravelLang\Development\Contracts\Application as ApplicationContract;
|
||||
use LaravelLang\Development\Contracts\Processable;
|
||||
use LaravelLang\Development\Facades\Env;
|
||||
|
||||
class Application implements ApplicationContract
|
||||
{
|
||||
use Makeable;
|
||||
|
||||
public function __construct(
|
||||
protected string $base_path
|
||||
) {
|
||||
$this->createDotenv()->safeLoad();
|
||||
}
|
||||
|
||||
public function basePath(): string
|
||||
{
|
||||
return rtrim($this->base_path, '/\\');
|
||||
}
|
||||
|
||||
public function sourcePath(string $filename = null): string
|
||||
{
|
||||
return $this->path('source/' . $this->cleanPath($filename));
|
||||
}
|
||||
|
||||
public function localePath(string $locale = null): string
|
||||
{
|
||||
return $this->path('locales/' . $this->cleanPath($locale));
|
||||
}
|
||||
|
||||
public function excludePath(string $locale): string
|
||||
{
|
||||
return $this->path('excludes/' . $this->cleanPath($locale) . '.php');
|
||||
}
|
||||
|
||||
public function resourcePath(string $filename): string
|
||||
{
|
||||
return $this->path('app/resources/' . $this->cleanPath($filename));
|
||||
}
|
||||
|
||||
public function path(string $path = null): string
|
||||
{
|
||||
if ($value = $this->cleanPath($path)) {
|
||||
return $this->basePath() . '/' . $value;
|
||||
}
|
||||
|
||||
return $this->basePath();
|
||||
}
|
||||
|
||||
public function cleanPath(string $path = null): ?string
|
||||
{
|
||||
if (! empty($path)) {
|
||||
return ltrim($path, '/\\');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function processor(Processable $processor): void
|
||||
{
|
||||
$processor->application($this)->run();
|
||||
}
|
||||
|
||||
protected function createDotenv(): Dotenv
|
||||
{
|
||||
return Dotenv::create(
|
||||
Env::getRepository(),
|
||||
$this->environmentPath(),
|
||||
$this->environmentFile()
|
||||
);
|
||||
}
|
||||
|
||||
protected function environmentPath(): string
|
||||
{
|
||||
return $this->path('app');
|
||||
}
|
||||
|
||||
protected function environmentFile(): string
|
||||
{
|
||||
return '.env';
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Concerns;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\Directory;
|
||||
use DragonCode\Support\Facades\Helpers\Str;
|
||||
use LaravelLang\Development\Constants\Locales;
|
||||
|
||||
trait Contains
|
||||
{
|
||||
protected function isMainJson(string $filename): bool
|
||||
{
|
||||
if ($this->isEnglishJson($filename)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$locale = Str::before($filename, '.');
|
||||
|
||||
$path = $this->app->localePath($locale);
|
||||
|
||||
return $this->isJson($filename) && Directory::exists($path);
|
||||
}
|
||||
|
||||
protected function isEnglishJson(string $filename): bool
|
||||
{
|
||||
return $this->isJson($filename) && str_starts_with($filename, Locales::ENGLISH);
|
||||
}
|
||||
|
||||
protected function isJson(string $filename): bool
|
||||
{
|
||||
return str_ends_with($filename, 'json');
|
||||
}
|
||||
|
||||
protected function isMarkdown(string $filename): bool
|
||||
{
|
||||
return str_ends_with($filename, 'md');
|
||||
}
|
||||
|
||||
protected function isValidation(string $filename): bool
|
||||
{
|
||||
$names = ['validation.php', 'validation-inline.php'];
|
||||
|
||||
return in_array($filename, $names, true);
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Concerns;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Digit;
|
||||
use DragonCode\Support\Facades\Helpers\Str;
|
||||
use LaravelLang\Development\Services\Counter;
|
||||
|
||||
trait Countable
|
||||
{
|
||||
protected array $count = [];
|
||||
|
||||
protected string $count_prefix = 'count_';
|
||||
|
||||
protected string $count_suffix = '_percents';
|
||||
|
||||
protected string $count_suffix_all = 'all';
|
||||
|
||||
protected function addCount(array $items, string $key = 'all'): void
|
||||
{
|
||||
$key = $this->countKeyPrefix($key);
|
||||
|
||||
if (! isset($this->count[$key])) {
|
||||
$this->count[$key] = 0;
|
||||
}
|
||||
|
||||
$this->count[$key] += $this->calcCount($items);
|
||||
}
|
||||
|
||||
protected function getCount(string $key = 'all'): int
|
||||
{
|
||||
$key = $this->countKeyPrefix($key);
|
||||
|
||||
return $this->count[$key];
|
||||
}
|
||||
|
||||
protected function setCount(int $count, string $key = 'all'): void
|
||||
{
|
||||
$key = $this->countKeyPrefix($key);
|
||||
|
||||
$this->count[$key] = $count;
|
||||
}
|
||||
|
||||
protected function getCounts(): array
|
||||
{
|
||||
$this->calcPercents();
|
||||
$this->countToString();
|
||||
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
protected function calcPercents(): void
|
||||
{
|
||||
$all = $this->getCount();
|
||||
|
||||
$all_key = $this->countKeyPrefix($this->count_suffix_all);
|
||||
|
||||
$items = $this->count;
|
||||
|
||||
foreach ($items as $key => $value) {
|
||||
if ($key !== $all_key) {
|
||||
$value = $all - $value;
|
||||
|
||||
$percent = $this->calcPercent($all, $value);
|
||||
|
||||
$new_key = $this->countKeySuffix($key);
|
||||
|
||||
$this->setCount($value, $key);
|
||||
$this->setCount($percent, $new_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function calcPercent(int $all, int $count): int
|
||||
{
|
||||
return round(($count / $all) * 100);
|
||||
}
|
||||
|
||||
protected function countToString(): void
|
||||
{
|
||||
foreach ($this->count as &$value) {
|
||||
$value = $this->countFormat($value);
|
||||
}
|
||||
}
|
||||
|
||||
protected function calcCount(int|array $value): int
|
||||
{
|
||||
return is_int($value) ? $value : Counter::make()->count($value);
|
||||
}
|
||||
|
||||
protected function countKeyPrefix(string $key): string
|
||||
{
|
||||
return Str::start($key, $this->count_prefix);
|
||||
}
|
||||
|
||||
protected function countKeySuffix(string $key): string
|
||||
{
|
||||
return Str::finish($key, $this->count_suffix);
|
||||
}
|
||||
|
||||
protected function countFormat(int $count): string
|
||||
{
|
||||
return Digit::toShort($count);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Concerns;
|
||||
|
||||
use DragonCode\PrettyArray\Services\File as PrettyFile;
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\File;
|
||||
|
||||
/** @mixin \LaravelLang\Development\Processors\Processor */
|
||||
trait Excludes
|
||||
{
|
||||
protected static array $excludes = [];
|
||||
|
||||
protected function hasExclude(string $value, string $locale): bool
|
||||
{
|
||||
return $this->hasExcludeValue($locale, $value)
|
||||
|| $this->hasExcludeValue('_all', $value);
|
||||
}
|
||||
|
||||
protected function hasExcludeValue(string $key, string $value): bool
|
||||
{
|
||||
$excludes = $this->getExcludes($key);
|
||||
|
||||
return in_array($value, $excludes, true);
|
||||
}
|
||||
|
||||
protected function getExcludes(string $key): array
|
||||
{
|
||||
$path = $this->app->excludePath($key);
|
||||
|
||||
if (static::$excludes[$key] ?? false) {
|
||||
return static::$excludes[$key];
|
||||
}
|
||||
|
||||
return static::$excludes[$key] = File::exists($path) ? PrettyFile::make()->load($path) : [];
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Concerns;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Instance;
|
||||
use DragonCode\Support\Tools\Stub;
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
|
||||
trait Storable
|
||||
{
|
||||
protected ?string $stub = null;
|
||||
|
||||
protected function prepareToStore(array|string|Stringable $content): string
|
||||
{
|
||||
if (Instance::of($content, Stringable::class)) {
|
||||
return $content->toString();
|
||||
}
|
||||
|
||||
if (is_array($content)) {
|
||||
return implode(PHP_EOL, $content);
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
protected function getStub(string $filename): string
|
||||
{
|
||||
return $this->findStub($this->stub ?: $filename);
|
||||
}
|
||||
|
||||
protected function findStub(string $filename): string
|
||||
{
|
||||
$basename = pathinfo($filename, PATHINFO_FILENAME);
|
||||
|
||||
$path = $this->app->resourcePath('arrays/' . $basename . '.stub');
|
||||
|
||||
return file_exists($path) ? $path : Stub::PHP_ARRAY;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Concerns;
|
||||
|
||||
use DragonCode\PrettyArray\Services\File;
|
||||
use DragonCode\Support\Facades\Helpers\Str;
|
||||
|
||||
trait Template
|
||||
{
|
||||
protected static array $templates = [];
|
||||
|
||||
protected function template(string $filename, array $values = [], bool $trim = false, bool $return_empty = false): string
|
||||
{
|
||||
$template = $this->getTemplate($filename, $trim);
|
||||
|
||||
$values = array_merge($this->extend ?? [], $values);
|
||||
|
||||
return $this->replace($template, $values, $return_empty);
|
||||
}
|
||||
|
||||
protected function replace(string $template, array $values, bool $return_empty = false): string
|
||||
{
|
||||
return $return_empty ? '' : Str::replace($template, $values, '{{%s}}');
|
||||
}
|
||||
|
||||
protected function getTemplate(string $filename, bool $trim = false): string
|
||||
{
|
||||
if (static::$templates[$filename] ?? false) {
|
||||
return static::$templates[$filename];
|
||||
}
|
||||
|
||||
$template = File::make()->loadRaw(
|
||||
$this->templatePath($filename)
|
||||
);
|
||||
|
||||
return static::$templates[$filename] = $trim ? trim($template) : $template;
|
||||
}
|
||||
|
||||
protected function templatePath(string $filename): string
|
||||
{
|
||||
return $this->app->resourcePath($filename);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Constants;
|
||||
|
||||
class Locales
|
||||
{
|
||||
public const ENGLISH = 'en';
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Constants;
|
||||
|
||||
class Machines
|
||||
{
|
||||
public const LOCALES = [
|
||||
'az',
|
||||
'be',
|
||||
'bs',
|
||||
'ca',
|
||||
'cs',
|
||||
'cy',
|
||||
'da',
|
||||
'et',
|
||||
'eu',
|
||||
'gl',
|
||||
'he',
|
||||
'hi',
|
||||
'hu',
|
||||
'is',
|
||||
'ka',
|
||||
'kk',
|
||||
'kn',
|
||||
'lv',
|
||||
'mn',
|
||||
'mr',
|
||||
'sk',
|
||||
'sl',
|
||||
'sq',
|
||||
'sr_Cyrl',
|
||||
'sr_Latn',
|
||||
'sr_Latn_ME',
|
||||
'sw',
|
||||
'tg',
|
||||
'th',
|
||||
'tl',
|
||||
'uk',
|
||||
'ur',
|
||||
'uz_Cyrl',
|
||||
'uz_Latn'
|
||||
];
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Constants;
|
||||
|
||||
class Referents
|
||||
{
|
||||
public const ar = ['mohamedsabil83', 'Khuthaily'];
|
||||
|
||||
public const da = ['jensstigaard'];
|
||||
|
||||
public const de = ['WhereIsLucas', 'sotten'];
|
||||
|
||||
public const de_CH = ['sotten'];
|
||||
|
||||
public const es = ['luisprmat'];
|
||||
|
||||
public const fr = ['caouecs', 'WhereIsLucas'];
|
||||
|
||||
public const it = ['masterix21'];
|
||||
|
||||
public const mk = ['keljtanoski'];
|
||||
|
||||
public const nl = ['WhereIsLucas'];
|
||||
|
||||
public const pl = ['Olsza'];
|
||||
|
||||
public const pt = ['jorgercosta'];
|
||||
|
||||
public const ru = ['andrey-helldar'];
|
||||
|
||||
public const sr_Cyrl = ['LukaLatkovic'];
|
||||
|
||||
public const sr_Latn = ['LukaLatkovic'];
|
||||
|
||||
public const sr_Latn_ME = ['LukaLatkovic'];
|
||||
|
||||
public const uk = ['MrAlKuz'];
|
||||
|
||||
public const vi = ['dinhquochan'];
|
||||
|
||||
public const zh_CN = ['overtrue'];
|
||||
|
||||
public const zh_HK = ['overtrue'];
|
||||
|
||||
public const zh_TW = ['overtrue'];
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Constants;
|
||||
|
||||
class Resource
|
||||
{
|
||||
public const STATUS = 'status.stub';
|
||||
|
||||
public const LOCALE = 'locale.stub';
|
||||
|
||||
public const REFERENTS = 'referents.stub';
|
||||
|
||||
public const COMPONENT_ALL_TRANSLATED = 'components/translated.stub';
|
||||
|
||||
public const COMPONENT_LINK = 'components/link.stub';
|
||||
|
||||
public const COMPONENT_LOCALE = 'components/locale.stub';
|
||||
|
||||
public const COMPONENT_TABLE = 'components/table/index.stub';
|
||||
|
||||
public const COMPONENT_TABLE_COLUMN = 'components/table/column.stub';
|
||||
|
||||
public const COMPONENT_TABLE_ROW = 'components/table/row.stub';
|
||||
|
||||
public const COMPONENT_TABLE_ATTRIBUTE_ALIGN = 'components/table/attributes/align.stub';
|
||||
|
||||
public const COMPONENT_TABLE_ATTRIBUTE_WIDTH = 'components/table/attributes/width.stub';
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Contracts;
|
||||
|
||||
interface Application
|
||||
{
|
||||
public function __construct(string $base_path);
|
||||
|
||||
public function basePath(): string;
|
||||
|
||||
public function sourcePath(string $filename = null): string;
|
||||
|
||||
public function localePath(string $locale = null): string;
|
||||
|
||||
public function excludePath(string $locale): string;
|
||||
|
||||
public function resourcePath(string $filename): string;
|
||||
|
||||
public function path(string $path = null): string;
|
||||
|
||||
public function cleanPath(string $path = null): ?string;
|
||||
|
||||
public function processor(Processable $processor): void;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Contracts;
|
||||
|
||||
use DragonCode\Support\Tools\Stub;
|
||||
use LaravelLang\Development\Application;
|
||||
|
||||
interface Filesystem
|
||||
{
|
||||
public function application(Application $app): self;
|
||||
|
||||
public function load(string $path): array;
|
||||
|
||||
public function store(string $path, array|string|Stringable $content, bool $is_simple = false, string $stub = Stub::PHP_ARRAY): void;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Contracts;
|
||||
|
||||
use LaravelLang\Development\Application;
|
||||
|
||||
interface Processable
|
||||
{
|
||||
public function run(): void;
|
||||
|
||||
public function application(Application $app): self;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Contracts;
|
||||
|
||||
interface Stringable
|
||||
{
|
||||
public function toString(): string;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Facades;
|
||||
|
||||
use Dotenv\Repository\AdapterRepository;
|
||||
use Dotenv\Repository\RepositoryInterface;
|
||||
use DragonCode\Support\Facades\Facade;
|
||||
use LaravelLang\Development\Support\Env as Support;
|
||||
|
||||
/**
|
||||
* @method static mixed get(string $key, mixed $default = null)
|
||||
* @method static AdapterRepository|RepositoryInterface getRepository()
|
||||
*/
|
||||
class Env extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return Support::class;
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Facades;
|
||||
|
||||
use DragonCode\Support\Facades\Facade;
|
||||
use LaravelLang\Development\Support\Finder;
|
||||
use LaravelLang\Development\Support\Package as Support;
|
||||
use LaravelLang\Development\Support\Parser;
|
||||
use Symfony\Component\Finder\Finder as SymfonyFinder;
|
||||
|
||||
/**
|
||||
* @method static Support some()
|
||||
*/
|
||||
class Package extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor(): Support
|
||||
{
|
||||
return new Support(self::resolveFinder(), self::resolveParser());
|
||||
}
|
||||
|
||||
protected static function resolveFinder(): Finder
|
||||
{
|
||||
$finder = SymfonyFinder::create();
|
||||
|
||||
return Finder::make($finder);
|
||||
}
|
||||
|
||||
protected static function resolveParser(): Parser
|
||||
{
|
||||
return Parser::make();
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Facades;
|
||||
|
||||
use DragonCode\Support\Facades\Facade;
|
||||
use LaravelLang\Development\Services\Translate as Service;
|
||||
|
||||
/**
|
||||
* @method static string translate(string $locale, string $text)
|
||||
*/
|
||||
class Translate extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return Service::class;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Models;
|
||||
|
||||
use LaravelLang\Development\Constants\Machines;
|
||||
|
||||
class Locale extends Model
|
||||
{
|
||||
public function __construct(
|
||||
protected ?string $locale = null,
|
||||
protected ?int $missing = 0
|
||||
) {
|
||||
}
|
||||
|
||||
public function getLocale(): ?string
|
||||
{
|
||||
return $this->locale;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
if (! $this->isEmpty()) {
|
||||
$status = $this->getMissing() ? '❗' : '✔';
|
||||
|
||||
$machine = $this->hasMachine() ? ' 🤖' : '';
|
||||
|
||||
return $this->locale . ' ' . $status . $machine;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getMissing(): ?int
|
||||
{
|
||||
return $this->missing;
|
||||
}
|
||||
|
||||
public function isEmpty(): bool
|
||||
{
|
||||
return empty($this->locale);
|
||||
}
|
||||
|
||||
protected function hasMachine(): bool
|
||||
{
|
||||
return in_array($this->locale, Machines::LOCALES, true);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Models;
|
||||
|
||||
use DragonCode\Support\Concerns\Makeable;
|
||||
|
||||
abstract class Model
|
||||
{
|
||||
use Makeable;
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LaravelLang\Development\Processors;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\File;
|
||||
use RuntimeException;
|
||||
|
||||
class AddLocale extends Processor
|
||||
{
|
||||
protected string $target_path = 'locales';
|
||||
|
||||
public function __construct(
|
||||
protected string $locale
|
||||
) {
|
||||
}
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
$this->throwIfExists();
|
||||
$this->createFiles();
|
||||
$this->fillKeys();
|
||||
}
|
||||
|
||||
protected function createFiles(): void
|
||||
{
|
||||
foreach ($this->files() as $file) {
|
||||
$target_path = $this->getTargetPath($this->locale . '/' . $file);
|
||||
|
||||
$filename = $this->isMainJson($file) ? $this->locale . '.json' : $file;
|
||||
|
||||
$this->process($target_path, $filename, $this->locale);
|
||||
}
|
||||
}
|
||||
|
||||
protected function process(string $target_path, string $filename, string $locale = null): void
|
||||
{
|
||||
$this->store($target_path, [], $filename);
|
||||
}
|
||||
|
||||
protected function throwIfExists(): void
|
||||
{
|
||||
$path = $this->getTargetPath($this->locale);
|
||||
|
||||
if (is_dir($path)) {
|
||||
throw new RuntimeException("The localization with code {$this->locale} has already been created.");
|
||||
}
|
||||
}
|
||||
|
||||
protected function fillKeys()
|
||||
{
|
||||
$this->app->processor(Keys::make($this->locale));
|
||||
}
|
||||
|
||||
protected function files(): array
|
||||
{
|
||||
return File::names($this->getSourcePath());
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Arr;
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\File;
|
||||
|
||||
class Excludes extends Processor
|
||||
{
|
||||
protected string $target_path = 'excludes';
|
||||
|
||||
protected array $keys = [];
|
||||
|
||||
protected ?string $stub = 'exclude.stub';
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
$this->loadKeys();
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
protected function handle(): void
|
||||
{
|
||||
foreach ($this->targetFiles() as $filename) {
|
||||
$this->process($this->getTargetPath($filename), $filename);
|
||||
}
|
||||
}
|
||||
|
||||
protected function process(string $target_path, string $filename, string $locale = null): void
|
||||
{
|
||||
$target = $this->load($target_path);
|
||||
|
||||
$content = $this->merge($this->keys, $target, $filename);
|
||||
|
||||
$this->sort($content, false);
|
||||
|
||||
$this->store($target_path, array_values($content), $this->stub, true);
|
||||
}
|
||||
|
||||
protected function merge(array $source, array $target, string $filename): array
|
||||
{
|
||||
return array_intersect($source, $target);
|
||||
}
|
||||
|
||||
protected function sort(array &$array, bool $key = true): void
|
||||
{
|
||||
$array = Arr::sort(array_unique($array));
|
||||
}
|
||||
|
||||
protected function loadKeys(): void
|
||||
{
|
||||
foreach ($this->sourceFiles() as $filename) {
|
||||
$keys = $this->getSourceKeys($filename);
|
||||
|
||||
$this->keys = array_merge($this->keys, $keys);
|
||||
}
|
||||
}
|
||||
|
||||
protected function sourceFiles(): array
|
||||
{
|
||||
return File::names($this->getSourcePath(), recursive: true);
|
||||
}
|
||||
|
||||
protected function targetFiles(): array
|
||||
{
|
||||
return File::names($this->getTargetPath());
|
||||
}
|
||||
|
||||
protected function getSourceKeys(string $filename): array
|
||||
{
|
||||
$items = $this->load($this->getSourcePath($filename));
|
||||
|
||||
if ($this->isJson($filename)) {
|
||||
return array_values($items);
|
||||
}
|
||||
|
||||
return $this->flatten($items);
|
||||
}
|
||||
|
||||
protected function flatten(array $array): array
|
||||
{
|
||||
return Arr::flatten($array);
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\Directory;
|
||||
|
||||
class Git extends Processor
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
foreach ($this->locales() as $locale) {
|
||||
dump($locale . '...');
|
||||
|
||||
$this->checkout();
|
||||
$this->createBranch($locale);
|
||||
$this->add($locale);
|
||||
$this->commit($locale);
|
||||
$this->push($locale);
|
||||
}
|
||||
}
|
||||
|
||||
protected function locales(): array
|
||||
{
|
||||
return Directory::names($this->getLocalesPath());
|
||||
}
|
||||
|
||||
protected function checkout(): void
|
||||
{
|
||||
$this->git(sprintf('checkout "%s"', $this->getSourceBranchName()));
|
||||
}
|
||||
|
||||
protected function add(string $locale): void
|
||||
{
|
||||
$this->git(sprintf('add locales/%s/*', $locale));
|
||||
}
|
||||
|
||||
protected function commit(string $locale): void
|
||||
{
|
||||
$message = $this->getMessage($locale);
|
||||
|
||||
$this->git(sprintf('commit -m "%s"', $message));
|
||||
}
|
||||
|
||||
protected function push(string $locale): void
|
||||
{
|
||||
$repository = env('GIT_REPOSITORY', 'origin');
|
||||
|
||||
$branch = $this->getTargetBranchName($locale);
|
||||
|
||||
$this->git(sprintf('push --set-upstream %s %s', $repository, $branch));
|
||||
}
|
||||
|
||||
protected function createBranch(string $locale): void
|
||||
{
|
||||
$source_branch = $this->getSourceBranchName();
|
||||
$target_branch = $this->getTargetBranchName($locale);
|
||||
|
||||
$this->git(sprintf('checkout -b "%s" "%s"', $target_branch, $source_branch));
|
||||
}
|
||||
|
||||
protected function git(string $command): void
|
||||
{
|
||||
$directory = $this->getGitDirectory();
|
||||
|
||||
exec('git -C "' . $directory . '" ' . $command);
|
||||
}
|
||||
|
||||
protected function getLocalesPath(): string
|
||||
{
|
||||
return $this->app->localePath();
|
||||
}
|
||||
|
||||
protected function getGitDirectory(): string
|
||||
{
|
||||
$directory = $this->app->basePath();
|
||||
|
||||
return realpath($directory);
|
||||
}
|
||||
|
||||
protected function getSourceBranchName(): string
|
||||
{
|
||||
return env('GIT_SOURCE_BRANCH', 'master');
|
||||
}
|
||||
|
||||
protected function getTargetBranchName(string $locale): string
|
||||
{
|
||||
$prefix = env('GIT_TARGET_BRANCH', 'patch');
|
||||
|
||||
return sprintf('%s/%s/%s', $prefix, date('Y-m-d'), $locale);
|
||||
}
|
||||
|
||||
protected function getMessage(string $locale): string
|
||||
{
|
||||
$message = env('GIT_MESSAGE');
|
||||
|
||||
return sprintf($message, $locale);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\File;
|
||||
|
||||
class Keys extends Processor
|
||||
{
|
||||
protected string $target_path = 'locales';
|
||||
|
||||
public function __construct(
|
||||
protected ?string $locale = null
|
||||
) {
|
||||
}
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
foreach ($this->locales() as $locale) {
|
||||
foreach ($this->files($locale) as $file) {
|
||||
$target_path = $this->getTargetPath($locale . '/' . $file);
|
||||
|
||||
$filename = $this->isMainJson($file) ? 'en.json' : $file;
|
||||
|
||||
$this->process($target_path, $filename, $locale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function files(string $locale): array
|
||||
{
|
||||
return File::names($this->getTargetPath($locale));
|
||||
}
|
||||
|
||||
protected function locales(): array
|
||||
{
|
||||
if ($this->locale) {
|
||||
return [$this->locale];
|
||||
}
|
||||
|
||||
return parent::locales();
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Arr;
|
||||
use LaravelLang\Development\Facades\Package;
|
||||
|
||||
class Packages extends Processor
|
||||
{
|
||||
protected array $packages = [
|
||||
'laravel/breeze' => 'packages/breeze.json',
|
||||
'laravel/fortify' => 'packages/fortify.json',
|
||||
'laravel/jetstream' => 'packages/jetstream.json',
|
||||
'laravel/ui' => 'packages/ui.json',
|
||||
];
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
foreach ($this->packages as $package => $filename) {
|
||||
$items = $this->files($package);
|
||||
|
||||
$path = $this->getSourcePath($filename);
|
||||
|
||||
$content = $this->map($items);
|
||||
|
||||
$this->sort($content, false);
|
||||
|
||||
$this->store($path, $content);
|
||||
}
|
||||
}
|
||||
|
||||
protected function map(array $items): array
|
||||
{
|
||||
return Arr::values($items);
|
||||
}
|
||||
|
||||
protected function files(string $package): array
|
||||
{
|
||||
$path = $this->vendorPath($package);
|
||||
|
||||
return Package::some()->path($path)->content();
|
||||
}
|
||||
|
||||
protected function vendorPath(string $package): string
|
||||
{
|
||||
return $this->app->path('vendor/' . $package);
|
||||
}
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors;
|
||||
|
||||
use DragonCode\Support\Concerns\Makeable;
|
||||
use DragonCode\Support\Facades\Helpers\Arr;
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\Directory;
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\File;
|
||||
use DragonCode\Support\Tools\Stub;
|
||||
use LaravelLang\Development\Application;
|
||||
use LaravelLang\Development\Concerns\Contains;
|
||||
use LaravelLang\Development\Contracts\Filesystem;
|
||||
use LaravelLang\Development\Contracts\Processable;
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
use LaravelLang\Development\Services\Filesystem\Base;
|
||||
use LaravelLang\Development\Services\Filesystem\Json as JsonFilesystem;
|
||||
use LaravelLang\Development\Services\Filesystem\Markdown as MarkdownFilesystem;
|
||||
use LaravelLang\Development\Services\Filesystem\Php as PhpFilesystem;
|
||||
|
||||
abstract class Processor implements Processable
|
||||
{
|
||||
use Contains;
|
||||
use Makeable;
|
||||
|
||||
protected Application $app;
|
||||
|
||||
protected array $source = [];
|
||||
|
||||
protected string $target_path;
|
||||
|
||||
/** @var \LaravelLang\Development\Contracts\Filesystem[]|array */
|
||||
protected array $filesystems = [];
|
||||
|
||||
public function application(Application $app): Processable
|
||||
{
|
||||
$this->app = $app;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function merge(array $source, array $target, string $filename): array
|
||||
{
|
||||
$target = $this->filter($target, $source);
|
||||
|
||||
$this->sort($source);
|
||||
$this->sort($target);
|
||||
|
||||
if ($this->isValidation($filename)) {
|
||||
$custom = $this->getFallbackValue($source, $target, 'custom');
|
||||
|
||||
$source = Arr::except($source, ['attributes', 'custom']);
|
||||
$target = Arr::except($target, ['attributes', 'custom']);
|
||||
|
||||
return array_merge($source, $target, compact('custom'));
|
||||
}
|
||||
|
||||
return array_merge($source, $target);
|
||||
}
|
||||
|
||||
protected function process(string $target_path, string $filename, string $locale = null): void
|
||||
{
|
||||
$source = $this->source($filename);
|
||||
$target = $this->load($target_path);
|
||||
|
||||
$content = $this->merge($source, $target, $filename);
|
||||
|
||||
$this->store($target_path, $content, $filename);
|
||||
}
|
||||
|
||||
protected function source(string $filename): array
|
||||
{
|
||||
if ($this->source[$filename] ?? false) {
|
||||
return $this->source[$filename];
|
||||
}
|
||||
|
||||
return $this->source[$filename] = $this->isJson($filename) ? $this->sourceJson() : $this->loadSource($filename);
|
||||
}
|
||||
|
||||
protected function loadSource(string $filename): array
|
||||
{
|
||||
return $this->load($this->getSourcePath($filename));
|
||||
}
|
||||
|
||||
protected function sourceJson(): array
|
||||
{
|
||||
$path = $this->getSourcePath();
|
||||
|
||||
$files = File::names($path, fn ($filename) => $this->isJson($filename), true);
|
||||
|
||||
$array = [];
|
||||
|
||||
foreach ($files as $file) {
|
||||
$items = $this->loadSource($file);
|
||||
|
||||
$array = Arr::addUnique($array, $items);
|
||||
}
|
||||
|
||||
return Arr::renameKeys($array, static fn ($key, $value) => $value);
|
||||
}
|
||||
|
||||
protected function getFallbackValue(array $source, array $target, string $key)
|
||||
{
|
||||
return Arr::get($target, $key) ?: Arr::get($source, $key, []);
|
||||
}
|
||||
|
||||
protected function getTargetPath(string $path = null): string
|
||||
{
|
||||
if ($path = $this->app->cleanPath($path)) {
|
||||
$path = '/' . $path;
|
||||
}
|
||||
|
||||
return $this->app->path($this->target_path . $path);
|
||||
}
|
||||
|
||||
protected function getSourcePath(string $filename = null): string
|
||||
{
|
||||
return $this->app->sourcePath($filename);
|
||||
}
|
||||
|
||||
protected function filter(array $first, array $second): array
|
||||
{
|
||||
$keys = array_keys($second);
|
||||
|
||||
return Arr::only($first, $keys);
|
||||
}
|
||||
|
||||
protected function sort(array &$array, bool $key = true): void
|
||||
{
|
||||
$array = $key
|
||||
? Arr::ksort($array)
|
||||
: Arr::sort($array);
|
||||
}
|
||||
|
||||
protected function load(string $path): array
|
||||
{
|
||||
return $this->getFilesystem($path)->load($path);
|
||||
}
|
||||
|
||||
protected function locales(): array
|
||||
{
|
||||
return Directory::names($this->getTargetPath());
|
||||
}
|
||||
|
||||
protected function resolveFilename(string $filename, string $locale): string
|
||||
{
|
||||
return $this->isMainJson($filename) ? $locale . '.json' : $filename;
|
||||
}
|
||||
|
||||
protected function getFilesystem(string $filename): Filesystem
|
||||
{
|
||||
$class = $this->getFilesystemClass($filename);
|
||||
|
||||
if ($this->filesystems[$class] ?? false) {
|
||||
return $this->filesystems[$class];
|
||||
}
|
||||
|
||||
return $this->filesystems[$class] = $this->loadFilesystem($class);
|
||||
}
|
||||
|
||||
protected function getFilesystemClass(string $path): string
|
||||
{
|
||||
return match (true) {
|
||||
$this->isJson($path) => JsonFilesystem::class,
|
||||
|
||||
$this->isMarkdown($path) => MarkdownFilesystem::class,
|
||||
|
||||
default => PhpFilesystem::class,
|
||||
};
|
||||
}
|
||||
|
||||
protected function loadFilesystem(Filesystem|Base|string $filesystem): Filesystem
|
||||
{
|
||||
return $filesystem::make()->application($this->app);
|
||||
}
|
||||
|
||||
protected function store(string $path, array|string|Stringable $content, string $source_filename = null, bool $is_simple = false): void
|
||||
{
|
||||
$stub = $this->getStubPath($source_filename);
|
||||
|
||||
$this->getFilesystem($path)->store($path, $content, $is_simple, $stub);
|
||||
}
|
||||
|
||||
protected function getStubPath(?string $filename): ?string
|
||||
{
|
||||
return empty($filename) ? Stub::PHP_ARRAY : $filename;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\Directory;
|
||||
use LaravelLang\Development\Concerns\Template;
|
||||
use LaravelLang\Development\Constants\Referents as Constants;
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
use LaravelLang\Development\Services\Compilers\Referents as Compilator;
|
||||
use ReflectionClass;
|
||||
use ReflectionClassConstant;
|
||||
|
||||
class Referents extends Processor
|
||||
{
|
||||
use Template;
|
||||
|
||||
protected string $target_path = 'locales';
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
$map = $this->map();
|
||||
|
||||
$result = $this->compileContent($map);
|
||||
|
||||
$this->store('docs/referents.md', $result);
|
||||
}
|
||||
|
||||
protected function compileContent(array $items): Stringable
|
||||
{
|
||||
return Compilator::make($this->app)->items($items);
|
||||
}
|
||||
|
||||
protected function map(): array
|
||||
{
|
||||
$locales = array_flip($this->locales());
|
||||
|
||||
return array_merge($locales, $this->assignees());
|
||||
}
|
||||
|
||||
protected function locales(): array
|
||||
{
|
||||
return Directory::names($this->getTargetPath());
|
||||
}
|
||||
|
||||
protected function assignees(): array
|
||||
{
|
||||
$class = new ReflectionClass(Constants::class);
|
||||
|
||||
return $class->getConstants(ReflectionClassConstant::IS_PUBLIC);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors\Statuses;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\Directory;
|
||||
use DragonCode\Support\Facades\Helpers\Str;
|
||||
use LaravelLang\Development\Constants\Resource;
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
use LaravelLang\Development\Services\Compilers\Collection;
|
||||
use LaravelLang\Development\Services\Compilers\Locale;
|
||||
|
||||
class Locales extends Processor
|
||||
{
|
||||
protected function saving(): void
|
||||
{
|
||||
foreach ($this->locales as $locale => $items) {
|
||||
$count = $this->countMissing($locale);
|
||||
$content = $this->compileList($locale, $items);
|
||||
|
||||
$result = $this->compileContent($content, $locale, $count);
|
||||
|
||||
$filename = Str::slug($locale);
|
||||
|
||||
$this->store($this->pathStatus($filename . '.md'), $result);
|
||||
}
|
||||
}
|
||||
|
||||
protected function compileContent(string $content, string $locale, int $count): Stringable
|
||||
{
|
||||
return Locale::make($this->app)->items(compact('locale', 'count', 'content'));
|
||||
}
|
||||
|
||||
protected function compileList(string $locale, array $items): string
|
||||
{
|
||||
$content = Collection::make($this->app)
|
||||
->extend(compact('locale'))
|
||||
->items($items)
|
||||
->toString();
|
||||
|
||||
return $content ?: $this->template(Resource::COMPONENT_ALL_TRANSLATED);
|
||||
}
|
||||
|
||||
protected function ensureDirectory(): void
|
||||
{
|
||||
Directory::ensureDirectory($this->pathStatus(), can_delete: true);
|
||||
}
|
||||
|
||||
protected function pathStatus(string $filename = null): string
|
||||
{
|
||||
return $this->app->path('docs/statuses/' . $filename);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors\Statuses;
|
||||
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
use LaravelLang\Development\Services\Compilers\Status;
|
||||
|
||||
class Main extends Processor
|
||||
{
|
||||
protected function saving(): void
|
||||
{
|
||||
$result = $this->compileContent($this->locales);
|
||||
|
||||
$this->store('docs/status.md', $result);
|
||||
}
|
||||
|
||||
protected function compileContent(array $items): Stringable
|
||||
{
|
||||
return Status::make($this->app)
|
||||
->extend($this->getCounts())
|
||||
->items($items);
|
||||
}
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors\Statuses;
|
||||
|
||||
use DragonCode\Support\Facades\Callbacks\Sorter;
|
||||
use DragonCode\Support\Facades\Helpers\Arr;
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\Directory;
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\File;
|
||||
use LaravelLang\Development\Concerns\Countable;
|
||||
use LaravelLang\Development\Concerns\Excludes;
|
||||
use LaravelLang\Development\Concerns\Template;
|
||||
use LaravelLang\Development\Processors\Processor as BaseProcessor;
|
||||
|
||||
abstract class Processor extends BaseProcessor
|
||||
{
|
||||
use Countable;
|
||||
use Excludes;
|
||||
use Template;
|
||||
|
||||
protected string $extension = '.md';
|
||||
|
||||
protected string $target_path = 'statuses';
|
||||
|
||||
protected array $source_files = [];
|
||||
|
||||
protected array $locales = [];
|
||||
|
||||
abstract protected function saving(): void;
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
$this->ensureDirectory();
|
||||
$this->handle();
|
||||
$this->saving();
|
||||
}
|
||||
|
||||
protected function handle(): void
|
||||
{
|
||||
foreach ($this->locales() as $locale) {
|
||||
$this->ensureLocale($locale);
|
||||
|
||||
foreach ($this->files() as $file) {
|
||||
$target_path = $this->getTargetPath($locale . $this->extension);
|
||||
|
||||
$this->process($target_path, $file, $locale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function process(string $target_path, string $filename, string $locale = null): void
|
||||
{
|
||||
$corrected = $this->resolveFilename($filename, $locale);
|
||||
|
||||
$source = $this->source($filename);
|
||||
$target = $this->target($locale, $corrected);
|
||||
|
||||
$is_validation = $this->isValidation($filename);
|
||||
|
||||
$this->addCount($source);
|
||||
|
||||
if ($diff = $this->compare($source, $target, $locale, $is_validation)) {
|
||||
$this->pushLocale($locale, $corrected, $diff);
|
||||
|
||||
$this->addCount($diff, 'diff');
|
||||
}
|
||||
}
|
||||
|
||||
protected function compare(array $source, array $target, string $locale, bool $is_validation): array
|
||||
{
|
||||
$source = $this->prepareComparing($source, $is_validation);
|
||||
$target = $this->prepareComparing($target, $is_validation);
|
||||
|
||||
return array_filter($target,
|
||||
fn ($value, $key) => $this->hasEquals($value, $key, $source, $locale, $is_validation),
|
||||
ARRAY_FILTER_USE_BOTH
|
||||
);
|
||||
}
|
||||
|
||||
protected function prepareComparing(array $array, bool $is_validation): array
|
||||
{
|
||||
if ($is_validation) {
|
||||
$array = Arr::except($array, ['attributes', 'custom']);
|
||||
}
|
||||
|
||||
return Arr::flattenKeys($array);
|
||||
}
|
||||
|
||||
protected function hasEquals($value, $key, array $source, string $locale, bool $is_validation): bool
|
||||
{
|
||||
if ($is_validation && in_array($key, ['attributes', 'custom'], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->hasExclude($value, $locale)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Arr::get($source, $key) === $value;
|
||||
}
|
||||
|
||||
protected function countMissing(string $locale): int
|
||||
{
|
||||
$items = array_map(static fn (array $items) => count($items), $this->locales[$locale]);
|
||||
|
||||
return array_sum($items);
|
||||
}
|
||||
|
||||
protected function getLocalePath(string $locale = null): string
|
||||
{
|
||||
return $this->app->localePath($locale);
|
||||
}
|
||||
|
||||
protected function locales(): array
|
||||
{
|
||||
return Directory::names($this->getLocalePath());
|
||||
}
|
||||
|
||||
protected function files(): array
|
||||
{
|
||||
if (! empty($this->source_files)) {
|
||||
return $this->source_files;
|
||||
}
|
||||
|
||||
$files = File::names($this->getSourcePath());
|
||||
|
||||
$items = Arr::sort($files, function (string $a, string $b) {
|
||||
$sorter = Sorter::default();
|
||||
|
||||
return $sorter($a, $b);
|
||||
});
|
||||
|
||||
$php = array_filter($items, fn ($value) => ! $this->isJson($value));
|
||||
$json = array_filter($items, fn ($value) => $this->isJson($value));
|
||||
|
||||
return $this->source_files = array_merge(array_values($php), array_values($json));
|
||||
}
|
||||
|
||||
protected function target(string $locale, string $filename): array
|
||||
{
|
||||
$corrected = $this->resolveFilename($filename, $locale);
|
||||
|
||||
$path = $this->getLocalePath($locale . '/' . $corrected);
|
||||
|
||||
return $this->load($path);
|
||||
}
|
||||
|
||||
protected function pushLocale(string $locale, string $filename, array $diff): void
|
||||
{
|
||||
$this->locales[$locale][$filename] = $diff;
|
||||
}
|
||||
|
||||
protected function ensureLocale(string $locale): void
|
||||
{
|
||||
if (! isset($this->locales[$locale])) {
|
||||
$this->locales[$locale] = [];
|
||||
}
|
||||
}
|
||||
|
||||
protected function ensureDirectory(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Processors\Statuses;
|
||||
|
||||
use LaravelLang\Development\Facades\Translate;
|
||||
use Throwable;
|
||||
|
||||
class Translator extends Processor
|
||||
{
|
||||
protected function saving(): void
|
||||
{
|
||||
foreach ($this->locales as $locale => $items) {
|
||||
foreach ($items as $filename => $values) {
|
||||
dump(sprintf('[%s] %s...', $locale, $filename));
|
||||
|
||||
$filename = $this->restoreFilename($locale, $filename);
|
||||
|
||||
$this->translateKeys($locale, $filename, $values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function translateKeys(string $locale, string $filename, array $items): void
|
||||
{
|
||||
try {
|
||||
foreach ($items as &$item) {
|
||||
$item = $this->translate($locale, $item);
|
||||
}
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
dump($e->getMessage());
|
||||
}
|
||||
finally {
|
||||
$this->storing($locale, $filename, $items);
|
||||
}
|
||||
}
|
||||
|
||||
protected function storing(string $locale, string $filename, array $items): void
|
||||
{
|
||||
$target_path = $this->getLocalePath($locale) . '/' . $filename;
|
||||
|
||||
$source = $this->source($filename);
|
||||
$target = $this->target($locale, $filename);
|
||||
|
||||
$target = array_merge($target, $items);
|
||||
|
||||
$content = $this->merge($source, $target, $filename);
|
||||
|
||||
$this->store($target_path, $content, $filename);
|
||||
}
|
||||
|
||||
protected function translate(string $locale, string $text): string
|
||||
{
|
||||
$map = [];
|
||||
|
||||
$transformed = $this->transformText($text, $map);
|
||||
|
||||
$translated = Translate::translate($locale, $transformed);
|
||||
|
||||
return $this->restoreText($translated, $map);
|
||||
}
|
||||
|
||||
protected function transformText(string $text, array &$map): string
|
||||
{
|
||||
preg_match_all('/:[a-z]+/', $text, $matches);
|
||||
|
||||
foreach ($matches as $match) {
|
||||
foreach ($match as $key) {
|
||||
$map[$key] = $this->getRandomValue($map);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->transformReplace($text, $map);
|
||||
}
|
||||
|
||||
protected function restoreText(string $text, array $map): string
|
||||
{
|
||||
return $this->transformReplace($text, array_flip($map));
|
||||
}
|
||||
|
||||
protected function transformReplace(string $text, array $items): string
|
||||
{
|
||||
return str_replace(array_keys($items), array_values($items), $text);
|
||||
}
|
||||
|
||||
protected function getRandomValue(array $items): int
|
||||
{
|
||||
$random = random_int(1000, 9999);
|
||||
|
||||
return in_array($random, $items, true) ? $this->getRandomValue($items) : $random;
|
||||
}
|
||||
|
||||
protected function restoreFilename(string $locale, string $filename): string
|
||||
{
|
||||
return match (true) {
|
||||
$this->isMainJson($filename) => $locale . '.json',
|
||||
$this->isJson($filename) => $filename . '.json',
|
||||
default => $filename . '.php',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Compilers;
|
||||
|
||||
use LaravelLang\Development\Constants\Resource;
|
||||
|
||||
class Collection extends Compiler
|
||||
{
|
||||
public function toString(): string
|
||||
{
|
||||
$result = '';
|
||||
|
||||
foreach ($this->items as $filename => $values) {
|
||||
$is_json = $this->isJson($filename);
|
||||
|
||||
$content = $this->compileItems($values, $is_json);
|
||||
|
||||
$count = count($values);
|
||||
|
||||
$result .= $this->compileLocale($content, $count, $filename);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function compileLocale(string $content, int $count, string $filename): string
|
||||
{
|
||||
$basename = $this->basename($filename);
|
||||
|
||||
return $this->template(Resource::COMPONENT_LOCALE, compact('count', 'basename', 'filename', 'content'));
|
||||
}
|
||||
|
||||
protected function compileItems(array $items, bool $is_json = false): string
|
||||
{
|
||||
$rows = $this->split($items, $is_json);
|
||||
|
||||
return Table::make($this->app)->items($rows)->toString();
|
||||
}
|
||||
|
||||
protected function split(array $items, bool $is_json = false): array
|
||||
{
|
||||
return $is_json
|
||||
? array_values(array_map(static fn ($key) => [$key], array_keys($items)))
|
||||
: array_values(array_map(static fn ($key, $value) => [$key, $value], array_keys($items), array_values($items)));
|
||||
}
|
||||
|
||||
protected function basename(string $filename): string
|
||||
{
|
||||
return pathinfo($filename, PATHINFO_FILENAME);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Compilers;
|
||||
|
||||
use DragonCode\Support\Concerns\Makeable;
|
||||
use LaravelLang\Development\Concerns\Contains;
|
||||
use LaravelLang\Development\Concerns\Template;
|
||||
use LaravelLang\Development\Contracts\Application;
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
|
||||
abstract class Compiler implements Stringable
|
||||
{
|
||||
use Contains;
|
||||
use Makeable;
|
||||
use Template;
|
||||
|
||||
protected array $items;
|
||||
|
||||
protected array $extend = [];
|
||||
|
||||
public function __construct(
|
||||
protected Application $app
|
||||
) {
|
||||
}
|
||||
|
||||
public function items(array $items): self
|
||||
{
|
||||
$this->items = $items;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function extend(array $values): self
|
||||
{
|
||||
$this->extend = $values;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Compilers;
|
||||
|
||||
use LaravelLang\Development\Constants\Resource;
|
||||
|
||||
class Locale extends Compiler
|
||||
{
|
||||
public function toString(): string
|
||||
{
|
||||
return $this->template(Resource::LOCALE, $this->items);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Compilers;
|
||||
|
||||
use LaravelLang\Development\Constants\Resource;
|
||||
|
||||
class Referents extends Compiler
|
||||
{
|
||||
public function toString(): string
|
||||
{
|
||||
$content = $this->compileContent();
|
||||
|
||||
return $this->template(Resource::REFERENTS, compact('content'));
|
||||
}
|
||||
|
||||
protected function compileContent(): string
|
||||
{
|
||||
$rows = [];
|
||||
|
||||
foreach ($this->items as $key => $value) {
|
||||
$rows[] = $this->mapRow($key, $value);
|
||||
}
|
||||
|
||||
return Table::make($this->app)->items($rows)->toString();
|
||||
}
|
||||
|
||||
protected function mapRow(string $key, int|array $values): array
|
||||
{
|
||||
$row = [$key, ''];
|
||||
|
||||
if (is_array($values)) {
|
||||
$row[1] = $this->mapAssignees($values);
|
||||
}
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
protected function mapAssignees(array $values): string
|
||||
{
|
||||
$result = [];
|
||||
|
||||
foreach ($values as $value) {
|
||||
$result[] = $this->template(Resource::COMPONENT_LINK, [
|
||||
'title' => '@' . $value,
|
||||
'link' => 'https://github.com/' . $value,
|
||||
]);
|
||||
}
|
||||
|
||||
return implode(', ', $result);
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Compilers;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Str;
|
||||
use LaravelLang\Development\Constants\Resource;
|
||||
use LaravelLang\Development\Models\Locale;
|
||||
|
||||
class Status extends Compiler
|
||||
{
|
||||
protected int $columns = 6;
|
||||
|
||||
public function toString(): string
|
||||
{
|
||||
return $this->template(Resource::STATUS, $this->getContent());
|
||||
}
|
||||
|
||||
protected function grouped(): array
|
||||
{
|
||||
$locales = [];
|
||||
|
||||
foreach ($this->items as $locale => $values) {
|
||||
$missing = count($values);
|
||||
|
||||
$locales[] = Locale::make($locale, $missing);
|
||||
}
|
||||
|
||||
return $this->group($locales);
|
||||
}
|
||||
|
||||
protected function group(array $items): array
|
||||
{
|
||||
return array_map(function (array $items) {
|
||||
if (count($items) < $this->columns) {
|
||||
$need = $this->columns - count($items);
|
||||
|
||||
$filled = array_fill(0, $need, Locale::make());
|
||||
|
||||
return array_merge($items, $filled);
|
||||
}
|
||||
|
||||
return $items;
|
||||
}, array_chunk($items, $this->columns));
|
||||
}
|
||||
|
||||
protected function compileContent(): string
|
||||
{
|
||||
$rows = [];
|
||||
|
||||
foreach ($this->grouped() as $items) {
|
||||
$rows[] = $this->mapRow($items);
|
||||
}
|
||||
|
||||
return Table::make($this->app)
|
||||
->items($rows)
|
||||
->align('center')
|
||||
->columns($this->columns)
|
||||
->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \LaravelLang\Development\Models\Locale[]|array $items
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function mapRow(array $items): array
|
||||
{
|
||||
$row = [];
|
||||
|
||||
foreach ($items as $item) {
|
||||
$row[] = $this->template(Resource::COMPONENT_LINK, [
|
||||
'title' => $item->getTitle(),
|
||||
'link' => $this->link($item->getLocale()),
|
||||
], return_empty: $item->isEmpty());
|
||||
}
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
protected function getContent(): array
|
||||
{
|
||||
$content = $this->compileContent();
|
||||
|
||||
return array_merge(compact('content'), $this->extend);
|
||||
}
|
||||
|
||||
protected function link(?string $value): string
|
||||
{
|
||||
return empty($value) ? '' : sprintf('statuses/%s.md', Str::slug($value));
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Compilers;
|
||||
|
||||
use LaravelLang\Development\Constants\Resource;
|
||||
|
||||
class Table extends Compiler
|
||||
{
|
||||
protected string $align = 'left';
|
||||
|
||||
protected int $columns = 1;
|
||||
|
||||
public function align(string $align): self
|
||||
{
|
||||
$this->align = $align;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function columns(int $columns): self
|
||||
{
|
||||
$this->columns = $columns;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function toString(): string
|
||||
{
|
||||
$width = $this->getWidth($this->getTableWidth());
|
||||
|
||||
$content = $this->compileRows();
|
||||
|
||||
return $this->template(Resource::COMPONENT_TABLE, compact('width', 'content'));
|
||||
}
|
||||
|
||||
protected function compileRows(): string
|
||||
{
|
||||
$result = '';
|
||||
|
||||
foreach ($this->items as $row) {
|
||||
$columns = '';
|
||||
|
||||
foreach ($row as $value) {
|
||||
$columns .= $this->compileColumn($value);
|
||||
}
|
||||
|
||||
$result .= $this->compileRow($columns);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function compileRow(string $row): string
|
||||
{
|
||||
return $this->template(Resource::COMPONENT_TABLE_ROW, compact('row'));
|
||||
}
|
||||
|
||||
protected function compileColumn(string $column): string
|
||||
{
|
||||
$align = $this->getAlign();
|
||||
$width = $this->getWidth($this->getColumnWidth());
|
||||
|
||||
return $this->template(Resource::COMPONENT_TABLE_COLUMN, compact('align', 'width', 'column'));
|
||||
}
|
||||
|
||||
protected function getAlign(): string
|
||||
{
|
||||
$align = $this->align;
|
||||
|
||||
return $this->template(Resource::COMPONENT_TABLE_ATTRIBUTE_ALIGN, compact('align'), true);
|
||||
}
|
||||
|
||||
protected function getWidth(?int $width): ?string
|
||||
{
|
||||
if (! $width) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->template(Resource::COMPONENT_TABLE_ATTRIBUTE_WIDTH, compact('width'), true);
|
||||
}
|
||||
|
||||
protected function getTableWidth(): ?int
|
||||
{
|
||||
return $this->hasColumns() ? 100 : null;
|
||||
}
|
||||
|
||||
protected function getColumnWidth(): ?int
|
||||
{
|
||||
return $this->hasColumns() ? round(100 / $this->getColumns()) : null;
|
||||
}
|
||||
|
||||
protected function hasColumns(): bool
|
||||
{
|
||||
return $this->getColumns() > 1;
|
||||
}
|
||||
|
||||
protected function getColumns(): int
|
||||
{
|
||||
return abs($this->columns);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services;
|
||||
|
||||
use DragonCode\Support\Concerns\Makeable;
|
||||
|
||||
class Counter
|
||||
{
|
||||
use Makeable;
|
||||
|
||||
protected int $count = 0;
|
||||
|
||||
public function count(array $items): int
|
||||
{
|
||||
$this->calculate($items);
|
||||
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
protected function calculate(array $items): void
|
||||
{
|
||||
foreach ($items as $item) {
|
||||
is_array($item) ? $this->calculate($item) : $this->count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Filesystem;
|
||||
|
||||
use DragonCode\Support\Concerns\Makeable;
|
||||
use DragonCode\Support\Facades\Helpers\Ables\Arrayable;
|
||||
use LaravelLang\Development\Application;
|
||||
use LaravelLang\Development\Concerns\Storable;
|
||||
use LaravelLang\Development\Contracts\Filesystem;
|
||||
|
||||
abstract class Base implements Filesystem
|
||||
{
|
||||
use Makeable;
|
||||
use Storable;
|
||||
|
||||
protected Application $app;
|
||||
|
||||
public function application(Application $app): Filesystem
|
||||
{
|
||||
$this->app = $app;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function load(string $path): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function correctValues(array $items): array
|
||||
{
|
||||
$callback = static fn ($value) => stripslashes($value);
|
||||
|
||||
return Arrayable::of($items)
|
||||
->map($callback, true)
|
||||
->renameKeys($callback)
|
||||
->get();
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Filesystem;
|
||||
|
||||
use DragonCode\PrettyArray\Services\File as Pretty;
|
||||
use DragonCode\Support\Facades\Helpers\Arr;
|
||||
use DragonCode\Support\Tools\Stub;
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
|
||||
class Json extends Base
|
||||
{
|
||||
public function load(string $path): array
|
||||
{
|
||||
$content = Pretty::make()->loadRaw($path);
|
||||
|
||||
$items = json_decode($content, true);
|
||||
|
||||
return $this->correctValues($items);
|
||||
}
|
||||
|
||||
public function store(string $path, array|string|Stringable $content, bool $is_simple = false, string $stub = Stub::PHP_ARRAY): void
|
||||
{
|
||||
if ($is_simple) {
|
||||
$content = array_values($content);
|
||||
}
|
||||
|
||||
Arr::storeAsJson($path, $content, false, JSON_UNESCAPED_UNICODE ^ JSON_PRETTY_PRINT);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Filesystem;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\File;
|
||||
use DragonCode\Support\Tools\Stub;
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
|
||||
class Markdown extends Base
|
||||
{
|
||||
public function store(string $path, array|string|Stringable $content, bool $is_simple = false, string $stub = Stub::PHP_ARRAY): void
|
||||
{
|
||||
$content = $this->prepareToStore($content);
|
||||
|
||||
File::store($path, $content);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services\Filesystem;
|
||||
|
||||
use DragonCode\PrettyArray\Services\File as Pretty;
|
||||
use DragonCode\PrettyArray\Services\Formatter;
|
||||
use DragonCode\Support\Tools\Stub;
|
||||
use LaravelLang\Development\Contracts\Stringable;
|
||||
|
||||
class Php extends Base
|
||||
{
|
||||
public function load(string $path): array
|
||||
{
|
||||
$items = Pretty::make()->load($path);
|
||||
|
||||
return $this->correctValues($items);
|
||||
}
|
||||
|
||||
public function store(string $path, array|string|Stringable $content, bool $is_simple = false, string $stub = Stub::PHP_ARRAY): void
|
||||
{
|
||||
$service = Formatter::make();
|
||||
|
||||
$is_simple
|
||||
? $service->setSimple()
|
||||
: $service->setEqualsAlign();
|
||||
|
||||
Pretty::make($service->raw($content))->store($path, $this->getStub($stub));
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Services;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use DragonCode\Support\Facades\Helpers\Str;
|
||||
|
||||
class Translate
|
||||
{
|
||||
protected string $url = 'https://translate.api.cloud.yandex.net/translate/v2/translate';
|
||||
|
||||
public function translate(string $locale, string $text): string
|
||||
{
|
||||
$content = $this->request($locale, $text);
|
||||
|
||||
return $content['translations'][0]['text'];
|
||||
}
|
||||
|
||||
protected function request(string $locale, string $text): array
|
||||
{
|
||||
$response = $this->client()->request('POST', $this->url, [
|
||||
RequestOptions::HEADERS => $this->headers(),
|
||||
RequestOptions::JSON => $this->body($locale, $text),
|
||||
]);
|
||||
|
||||
return json_decode($response->getBody()->getContents(), true);
|
||||
}
|
||||
|
||||
protected function headers(): array
|
||||
{
|
||||
return [
|
||||
'Authorization' => 'Bearer ' . $this->apiKey(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function body(string $locale, string $text): array
|
||||
{
|
||||
return [
|
||||
'targetLanguageCode' => $this->correctLocale($locale),
|
||||
|
||||
'texts' => [$text],
|
||||
|
||||
'folderId' => $this->folderId(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function correctLocale(string $locale): string
|
||||
{
|
||||
return Str::before($locale, '_');
|
||||
}
|
||||
|
||||
protected function client(): Client
|
||||
{
|
||||
return new Client();
|
||||
}
|
||||
|
||||
protected function apiKey(): string
|
||||
{
|
||||
return env('YANDEX_API_KEY');
|
||||
}
|
||||
|
||||
protected function folderId(): string
|
||||
{
|
||||
return env('YANDEX_API_FOLDER_ID');
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Support;
|
||||
|
||||
use Dotenv\Repository\AdapterRepository;
|
||||
use Dotenv\Repository\RepositoryBuilder;
|
||||
use Dotenv\Repository\RepositoryInterface;
|
||||
use PhpOption\Option;
|
||||
|
||||
class Env
|
||||
{
|
||||
protected static RepositoryInterface|AdapterRepository|null $repository;
|
||||
|
||||
public function get(string $key, mixed $default = null): mixed
|
||||
{
|
||||
$value = $this->getRepository()->get($key);
|
||||
|
||||
return Option::fromValue($value)->getOrElse($default);
|
||||
}
|
||||
|
||||
public function getRepository(): AdapterRepository|RepositoryInterface
|
||||
{
|
||||
if (self::$repository ?? false) {
|
||||
return self::$repository;
|
||||
}
|
||||
|
||||
$builder = RepositoryBuilder::createWithDefaultAdapters();
|
||||
|
||||
return self::$repository = $builder->immutable()->make();
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Support;
|
||||
|
||||
use DragonCode\Support\Concerns\Makeable;
|
||||
use Symfony\Component\Finder\Finder as SymfonyFinder;
|
||||
|
||||
class Finder
|
||||
{
|
||||
use Makeable;
|
||||
|
||||
protected array $names = ['*.php', '*.json', '*.js', '*.vue', '*.stub'];
|
||||
|
||||
protected array $contains = ['__(', 'trans(', '@lang(', 'Lang::get('];
|
||||
|
||||
protected array $files = [];
|
||||
|
||||
public function __construct(
|
||||
protected SymfonyFinder $finder
|
||||
) {
|
||||
}
|
||||
|
||||
public function get(string|array $path): array
|
||||
{
|
||||
$this->search($path);
|
||||
|
||||
return $this->files($path);
|
||||
}
|
||||
|
||||
protected function search(string|array $path): void
|
||||
{
|
||||
foreach ($this->find($path) as $file) {
|
||||
$this->push($path, $file->getRealPath());
|
||||
}
|
||||
}
|
||||
|
||||
protected function find(string|array $path): SymfonyFinder
|
||||
{
|
||||
return $this->finder()->in($path)->files()
|
||||
->name($this->names)
|
||||
->contains($this->contains);
|
||||
}
|
||||
|
||||
protected function push(string|array $source, string $path): void
|
||||
{
|
||||
$this->files[$source][] = $path;
|
||||
}
|
||||
|
||||
protected function files(string|array $path): array
|
||||
{
|
||||
return $this->files[$path] ?? [];
|
||||
}
|
||||
|
||||
protected function finder(): SymfonyFinder
|
||||
{
|
||||
return clone $this->finder;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Support;
|
||||
|
||||
use DragonCode\Support\Facades\Helpers\Filesystem\Directory;
|
||||
use DragonCode\Support\Facades\Helpers\Str;
|
||||
|
||||
class Package
|
||||
{
|
||||
protected ?string $path;
|
||||
|
||||
protected array $filter = ['$', 'self::', 'static::', 'auth.', 'pagination.', 'passwords.', 'validation.'];
|
||||
|
||||
public function __construct(
|
||||
protected Finder $finder,
|
||||
protected Parser $parser
|
||||
) {
|
||||
}
|
||||
|
||||
public function some(): self
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function path(string $path): self
|
||||
{
|
||||
Directory::validate($path);
|
||||
|
||||
$this->path = realpath($path);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function content(): array
|
||||
{
|
||||
$files = $this->files();
|
||||
|
||||
$items = $this->parsed($files);
|
||||
|
||||
return $this->filter($items);
|
||||
}
|
||||
|
||||
protected function files(): array
|
||||
{
|
||||
return $this->finder->get($this->path);
|
||||
}
|
||||
|
||||
protected function parsed(array $files): array
|
||||
{
|
||||
return $this->parser->files($files)->get();
|
||||
}
|
||||
|
||||
protected function filter(array $items): array
|
||||
{
|
||||
return array_filter(array_keys($items), fn ($value) => ! Str::contains($value, $this->filter));
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace LaravelLang\Development\Support;
|
||||
|
||||
use DragonCode\Support\Concerns\Makeable;
|
||||
use DragonCode\Support\Facades\Helpers\Arr;
|
||||
use DragonCode\Support\Facades\Helpers\Str;
|
||||
|
||||
class Parser
|
||||
{
|
||||
use Makeable;
|
||||
|
||||
protected const REGEX = '/\b(__|trans|lang|Lang\:\:get)\(\r*\s*(.+)\r*\s*(\)|,\s?\[)/U';
|
||||
|
||||
protected array $files = [];
|
||||
|
||||
protected array $keys = [];
|
||||
|
||||
public function files(array $files): self
|
||||
{
|
||||
$this->files = $files;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function get(): array
|
||||
{
|
||||
$this->clear();
|
||||
$this->each();
|
||||
$this->sort();
|
||||
|
||||
return $this->keys();
|
||||
}
|
||||
|
||||
protected function clear(): void
|
||||
{
|
||||
$this->keys = [];
|
||||
}
|
||||
|
||||
protected function each(): void
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
$content = file_get_contents($file);
|
||||
|
||||
$this->parse($content);
|
||||
}
|
||||
}
|
||||
|
||||
protected function sort(): void
|
||||
{
|
||||
Arr::ksort($this->keys);
|
||||
}
|
||||
|
||||
protected function parse(string $content): void
|
||||
{
|
||||
foreach ($this->match($content) as $match) {
|
||||
$value = $match;
|
||||
|
||||
if (Str::contains((string) $value, ['__', 'trans', '@lang', 'Lang::get'])) {
|
||||
$sub_key = $this->subkey($value);
|
||||
|
||||
$sub_value = $this->keys[$sub_key] ?? null;
|
||||
|
||||
$this->push($sub_value);
|
||||
}
|
||||
|
||||
$this->push($value);
|
||||
}
|
||||
}
|
||||
|
||||
protected function match(string $content, string $pattern = self::REGEX): array
|
||||
{
|
||||
preg_match_all($pattern, $content, $matches);
|
||||
|
||||
return $matches[2] ?? [];
|
||||
}
|
||||
|
||||
protected function push(mixed $value): void
|
||||
{
|
||||
$value = $this->trim($value);
|
||||
|
||||
if (! isset($this->keys[$value])) {
|
||||
$this->keys[$value] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
protected function subkey(string $value): string
|
||||
{
|
||||
$sub_key = $this->match($value)[0];
|
||||
|
||||
return $this->trim($sub_key);
|
||||
}
|
||||
|
||||
protected function keys(): array
|
||||
{
|
||||
return $this->keys;
|
||||
}
|
||||
|
||||
protected function trim($value)
|
||||
{
|
||||
if (is_string($value)) {
|
||||
$chars = " \t\n\r\0\x0B'\"";
|
||||
|
||||
return trim(stripslashes($value), $chars);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Facades\Env;
|
||||
|
||||
if (! function_exists('env')) {
|
||||
/**
|
||||
* Determine if the given value is "blank".
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed|null $default
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function env(string $key, mixed $default = null): mixed
|
||||
{
|
||||
return Env::get($key, $default);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Processors\Packages;
|
||||
|
||||
require __DIR__ . '/bootstrap/autoload.php';
|
||||
|
||||
/** @var \LaravelLang\Development\Application $app */
|
||||
$app = require_once __DIR__ . '/bootstrap/app.php';
|
||||
|
||||
$app->processor(Packages::make());
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Processors\Git;
|
||||
|
||||
require __DIR__ . '/bootstrap/autoload.php';
|
||||
|
||||
/** @var \LaravelLang\Development\Application $app */
|
||||
$app = require_once __DIR__ . '/bootstrap/app.php';
|
||||
|
||||
$app->processor(Git::make());
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Processors\Referents;
|
||||
|
||||
require __DIR__ . '/bootstrap/autoload.php';
|
||||
|
||||
/** @var \LaravelLang\Development\Application $app */
|
||||
$app = require_once __DIR__ . '/bootstrap/app.php';
|
||||
|
||||
$app->processor(Referents::make());
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used during authentication for various
|
||||
| messages that we need to display to the user. You are free to modify
|
||||
| these language lines according to your application's requirements.
|
||||
|
|
||||
*/
|
||||
|
||||
return {{slot}};
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Exclusion list
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is a list of exclusions for words or phrases where the original
|
||||
| form of the word has the same spelling in a given language.
|
||||
|
|
||||
| This list contains values.
|
||||
|
|
||||
*/
|
||||
|
||||
return {{slot}};
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pagination Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used by the paginator library to build
|
||||
| the simple pagination links. You are free to change them to anything
|
||||
| you want to customize your views to better match your application.
|
||||
|
|
||||
*/
|
||||
|
||||
return {{slot}};
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are the default lines which match reasons
|
||||
| that are given by the password broker for a password update attempt
|
||||
| has failed, such as for an invalid token or invalid new password.
|
||||
|
|
||||
*/
|
||||
|
||||
return {{slot}};
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| as the size rules. Feel free to tweak each of these messages here.
|
||||
|
|
||||
*/
|
||||
|
||||
return {{slot}};
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Nova Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| as the size rules. Feel free to tweak each of these messages here.
|
||||
|
|
||||
*/
|
||||
|
||||
return {{slot}};
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Nova Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| as the size rules. Feel free to tweak each of these messages here.
|
||||
|
|
||||
*/
|
||||
|
||||
return {{slot}};
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| as the size rules. Feel free to tweak each of these messages here.
|
||||
|
|
||||
*/
|
||||
|
||||
return {{slot}};
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
[{{title}}]({{link}})
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
### [{{basename}}](https://github.com/Laravel-Lang/lang/blob/master/locales/{{locale}}/{{filename}})
|
||||
|
||||
##### Missing: {{count}}
|
||||
|
||||
{{content}}
|
||||
@@ -1 +0,0 @@
|
||||
align="{{align}}"
|
||||
@@ -1 +0,0 @@
|
||||
width="{{width}}%"
|
||||
@@ -1,3 +0,0 @@
|
||||
<td {{align}} {{width}}>
|
||||
{{column}}
|
||||
</td>
|
||||
@@ -1,3 +0,0 @@
|
||||
<table {{width}}>
|
||||
{{content}}
|
||||
</table>
|
||||
@@ -1 +0,0 @@
|
||||
<tr>{{row}}</tr>
|
||||
@@ -1 +0,0 @@
|
||||
All lines are translated 😎
|
||||
@@ -1,5 +0,0 @@
|
||||
# {{locale}}
|
||||
|
||||
##### All missed: {{count}}
|
||||
|
||||
{{content}}
|
||||
@@ -1,3 +0,0 @@
|
||||
# Referents by language
|
||||
|
||||
{{content}}
|
||||
@@ -1,5 +0,0 @@
|
||||
# Completion status
|
||||
|
||||
> Translation of localizations is completed by **{{count_diff_percents}}%** ({{count_diff}} / {{count_all}}).
|
||||
|
||||
{{content}}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Processors\Statuses\Locales;
|
||||
use LaravelLang\Development\Processors\Statuses\Main;
|
||||
|
||||
require __DIR__ . '/bootstrap/autoload.php';
|
||||
|
||||
/** @var \LaravelLang\Development\Application $app */
|
||||
$app = require_once __DIR__ . '/bootstrap/app.php';
|
||||
|
||||
$app->processor(Main::make());
|
||||
$app->processor(Locales::make());
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
use LaravelLang\Development\Processors\Statuses\Translator;
|
||||
|
||||
require __DIR__ . '/bootstrap/autoload.php';
|
||||
|
||||
/** @var \LaravelLang\Development\Application $app */
|
||||
$app = require_once __DIR__ . '/bootstrap/app.php';
|
||||
|
||||
$app->processor(Translator::make());
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pagination Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used by the paginator library to build
|
||||
| the simple pagination links. You are free to change them to anything
|
||||
| you want to customize your views to better match your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'previous' => '« السابق',
|
||||
|
||||
'next' => 'التالي »',
|
||||
|
||||
);
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reminder Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are the default lines which match reasons
|
||||
| that are given by the password broker for a password update attempt
|
||||
| has failed, such as for an invalid token or invalid new password.
|
||||
|
|
||||
*/
|
||||
"password" => "يجب أن لا يقل طول كلمة السر عن ستة أحرف، كما يجب أن تتطابق مع حقل التأكيد",
|
||||
|
||||
"user" => "لم يتم العثور على أيّ حسابٍ بهذا العنوان الإلكتروني",
|
||||
|
||||
"token" => ".رمز استعادة كلمة السر الذي أدخلته غير صحيح",
|
||||
|
||||
"sent" => "تم إرسال تفاصيل استعادة كلمة السر الخاصة بك إلى بريدك الإلكتروني",
|
||||
|
||||
"reset" => "تمت إعادة تعيين كلمة السر",
|
||||
|
||||
);
|
||||
Executable
+134
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| such as the size rules. Feel free to tweak each of these messages.
|
||||
|
|
||||
*/
|
||||
|
||||
"accepted" => "يجب قبول الحقل :attribute",
|
||||
"active_url" => "الحقل :attribute لا يُمثّل رابطًا صحيحًا",
|
||||
"before" => "يجب على الحقل :attribute أن يكون تاريخًا سابقًا للتاريخ :date.",
|
||||
"after" => "يجب على الحقل :attribute أن يكون تاريخًا لاحقًا للتاريخ :date.",
|
||||
"alpha" => "يجب أن لا يحتوي الحقل :attribute سوى على حروف",
|
||||
"alpha_dash" => "يجب أن لا يحتوي الحقل :attribute على حروف، أرقام ومطّات.",
|
||||
"alpha_num" => "يجب أن يحتوي :attribute على حروفٍ وأرقامٍ فقط",
|
||||
"array" => "يجب أن يكون الحقل :attribute ًمصفوفة",
|
||||
"between" => array(
|
||||
"numeric" => "يجب أن تكون قيمة :attribute محصورة ما بين :min و :max.",
|
||||
"file" => "يجب أن يكون حجم الملف :attribute محصورًا ما بين :min و :max كيلوبايت.",
|
||||
"string" => "يجب أن يكون عدد حروف النّص :attribute محصورًا ما بين :min و :max",
|
||||
"array" => "يجب أن يحتوي :attribute على عدد من العناصر محصورًا ما بين :min و :max"
|
||||
),
|
||||
"boolean" => "يجب أن تكون قيمة الحقل :attribute إما true أو false ",
|
||||
"confirmed" => "حقل التأكيد غير مُطابق للحقل :attribute",
|
||||
"date" => "الحقل :attribute ليس تاريخًا صحيحًا",
|
||||
"date_format" => "لا يتوافق الحقل :attribute مع الشكل :format.",
|
||||
"different" => "يجب أن يكون الحقلان :attribute و :other مُختلفان",
|
||||
"digits" => "يجب أن يحتوي الحقل :attribute على :digits رقمًا/أرقام",
|
||||
"digits_between" => "يجب أن يحتوي الحقل :attribute ما بين :min و :max رقمًا/أرقام ",
|
||||
"email" => "يجب أن يكون :attribute عنوان بريد إلكتروني صحيح البُنية",
|
||||
"exists" => "الحقل :attribute لاغٍ",
|
||||
"image" => "يجب أن يكون الحقل :attribute صورةً",
|
||||
"in" => "الحقل :attribute لاغٍ",
|
||||
"integer" => "يجب أن يكون الحقل :attribute عددًا صحيحًا",
|
||||
"ip" => "يجب أن يكون الحقل :attribute عنوان IP ذي بُنية صحيحة",
|
||||
"max" => array(
|
||||
"numeric" => "يجب أن تكون قيمة الحقل :attribute أصغر من :max.",
|
||||
"file" => "يجب أن يكون حجم الملف :attribute أصغر من :max كيلوبايت",
|
||||
"string" => "يجب أن لا يتجاوز طول النّص :attribute :max حروفٍ/حرفًا",
|
||||
"array" => "يجب أن لا يحتوي الحقل :attribute على أكثر من :max عناصر/عنصر."
|
||||
),
|
||||
"mimes" => "يجب أن يكون الحقل ملفًا من نوع : :values.",
|
||||
"min" => array(
|
||||
"numeric" => "يجب أن تكون قيمة الحقل :attribute أكبر من :min.",
|
||||
"file" => "يجب أن يكون حجم الملف :attribute أكبر من :min كيلوبايت",
|
||||
"string" => "يجب أن يكون طول النص :attribute أكبر :min حروفٍ/حرفًا",
|
||||
"array" => "يجب أن يحتوي الحقل :attribute على الأقل على :min عُنصرًا/عناصر"
|
||||
),
|
||||
"not_in" => "الحقل :attribute لاغٍ",
|
||||
"numeric" => "يجب على الحقل :attribute أن يكون رقمًا",
|
||||
"regex" => "صيغة الحقل :attribute .غير صحيحة",
|
||||
"required" => "الحقل :attribute مطلوب.",
|
||||
"required_if" => "الحقل :attribute مطلوب في حال ما إذا كان :other يساوي :value.",
|
||||
"required_with" => "الحقل :attribute إذا توفّر :values.",
|
||||
"required_with_all" => "الحقل :attribute إذا توفّر :values.",
|
||||
"required_without" => "الحقل :attribute إذا لم يتوفّر :values.",
|
||||
"required_without_all" => "الحقل :attribute إذا لم يتوفّر :values.",
|
||||
"same" => "يجب أن يتطابق الحقل :attribute مع :other",
|
||||
"size" => array(
|
||||
"numeric" => "يجب أن تكون قيمة :attribute أكبر من :size.",
|
||||
"file" => "يجب أن يكون حجم الملف :attribute أكبر من :size كيلو بايت.",
|
||||
"string" => "يجب أن يحتوي النص :attribute عن ما لا يقل عن :size حرفٍ/أحرف.",
|
||||
"array" => "يجب أن يحتوي الحقل :attribute عن ما لا يقل عن:min عنصرٍ/عناصر"
|
||||
),
|
||||
"timezone" => "يجب أن يكون :attribute نطاقًا زمنيًا صحيحًا",
|
||||
"unique" => "قيمة الحقل :attribute مُستخدمة من قبل",
|
||||
"url" => "صيغة الرابط :attribute غير صحيحة",
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify custom validation messages for attributes using the
|
||||
| convention "attribute.rule" to name the lines. This makes it quick to
|
||||
| specify a specific custom language line for a given attribute rule.
|
||||
|
|
||||
*/
|
||||
'custom' => array(
|
||||
'attribute-name' => array(
|
||||
'rule-name' => 'custom-message',
|
||||
),
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Attributes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used to swap attribute place-holders
|
||||
| with something more reader friendly such as E-Mail Address instead
|
||||
| of "email". This simply helps us make messages a little cleaner.
|
||||
|
|
||||
*/
|
||||
|
||||
'attributes' => array(
|
||||
"name" => "الاسم",
|
||||
"username" => "اسم المُستخدم",
|
||||
"email" => "البريد الالكتروني",
|
||||
"first_name" => "الاسم",
|
||||
"last_name" => "اسم العائلة",
|
||||
"password" => "كلمة السر",
|
||||
"city" => "المدينة",
|
||||
"country" => "الدولة",
|
||||
"address" => "العنوان",
|
||||
"phone" => "الهاتف",
|
||||
"mobile" => "الجوال",
|
||||
"age" => "العمر",
|
||||
"sex" => "الجنس",
|
||||
"gender" => "النوع",
|
||||
"day" => "اليوم",
|
||||
"month" => "الشهر",
|
||||
"year" => "السنة",
|
||||
"hour" => "ساعة",
|
||||
"minute" => "دقيقة",
|
||||
"second" => "ثانية",
|
||||
"title" => "اللقب",
|
||||
"content" => "المُحتوى",
|
||||
"description" => "الوصف",
|
||||
"excerpt" => "المُلخص",
|
||||
"date" => "التاريخ",
|
||||
"time" => "الوقت",
|
||||
"available" => "مُتاح",
|
||||
"size" => "الحجم"
|
||||
),
|
||||
|
||||
);
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pagination Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used by the paginator library to build
|
||||
| the simple pagination links. You are free to change them to anything
|
||||
| you want to customize your views to better match your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'previous' => '« Назад',
|
||||
|
||||
'next' => 'Напред »',
|
||||
|
||||
);
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reminder Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are the default lines which match reasons
|
||||
| that are given by the password broker for a password update attempt
|
||||
| has failed, such as for an invalid token or invalid new password.
|
||||
|
|
||||
*/
|
||||
|
||||
"password" => "Паролата трябва да бъде поне шест знака и да съвпада.",
|
||||
|
||||
"user" => "Потребител с такъв e-mail адрес не може да бъде открит.",
|
||||
|
||||
"token" => "Този токен за ресет на парола е невалиден.",
|
||||
|
||||
"sent" => "Изпратено е напомняне за вашата парола!",
|
||||
|
||||
"reset" => "Паролата е ресетната!",
|
||||
|
||||
);
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| such as the size rules. Feel free to tweak each of these messages.
|
||||
|
|
||||
*/
|
||||
|
||||
"accepted" => "Трябва да приемете :attribute.",
|
||||
"active_url" => "Полето :attribute не е валиден URL адрес.",
|
||||
"after" => "Полето :attribute трябва да бъде дата след :date.",
|
||||
"alpha" => "Полето :attribute трябва да съдържа само букви.",
|
||||
"alpha_dash" => "Полето :attribute трябва да съдържа само букви, цифри, долна черта и тире.",
|
||||
"alpha_num" => "Полето :attribute трябва да съдържа само букви и цифри.",
|
||||
"array" => "Полето :attribute трябва да бъде масив.",
|
||||
"before" => "Полето :attribute трябва да бъде дата преди :date.",
|
||||
"between" => array(
|
||||
"numeric" => "Полето :attribute трябва да бъде между :min и :max.",
|
||||
"file" => "Полето :attribute трябва да бъде между :min и :max килобайта.",
|
||||
"string" => "Полето :attribute трябва да бъде между :min и :max знака.",
|
||||
"array" => "Полето :attribute трябва да има между :min - :max елемента."
|
||||
),
|
||||
"boolean" => "Полето :attribute трябва да съдържа Да или Не",
|
||||
"confirmed" => "Полето :attribute не е потвърдено.",
|
||||
"date" => "Полето :attribute не е валидна дата.",
|
||||
"date_format" => "Полето :attribute не е във формат :format.",
|
||||
"different" => "Полетата :attribute и :other трябва да са различни.",
|
||||
"digits" => "Полето :attribute трябва да има :digits цифри.",
|
||||
"digits_between" => "Полето :attribute трябва да има между :min и :max цифри.",
|
||||
"email" => "Полето :attribute е в невалиден формат.",
|
||||
"exists" => "Избранато поле :attribute вече съществува.",
|
||||
"image" => "Полето :attribute трябва да бъде изображение.",
|
||||
"in" => "Избраното поле :attribute е невалидно.",
|
||||
"integer" => "Полето :attribute трябва да бъде цяло число.",
|
||||
"ip" => "Полето :attribute трябва да бъде IP адрес.",
|
||||
"max" => array(
|
||||
"numeric" => "Полето :attribute трябва да бъде по-малко от :max.",
|
||||
"file" => "Полето :attribute трябва да бъде по-малко от :max килобайта.",
|
||||
"string" => "Полето :attribute трябва да бъде по-малко от :max знака.",
|
||||
"array" => "Полето :attribute трябва да има по-малко от :max елемента."
|
||||
),
|
||||
"mimes" => "Полето :attribute трябва да бъде файл от тип: :values.",
|
||||
"min" => array(
|
||||
"numeric" => "Полето :attribute трябва да бъде минимум :min.",
|
||||
"file" => "Полето :attribute трябва да бъде минимум :min килобайта.",
|
||||
"string" => "Полето :attribute трябва да бъде минимум :min знака.",
|
||||
"array" => "Полето :attribute трябва има минимум :min елемента."
|
||||
),
|
||||
"not_in" => "Избраното поле :attribute е невалидно.",
|
||||
"numeric" => "Полето :attribute трябва да бъде число.",
|
||||
"regex" => "Полето :attribute е в невалиден формат.",
|
||||
"required" => "Полето :attribute е задължително.",
|
||||
"required_if" => "Полето :attribute се изисква, когато :other е :value.",
|
||||
"required_with" => "Полето :attribute се изисква, когато :values има стойност.",
|
||||
"required_with_all" => "Полето :attribute е задължително, когато :values имат стойност.",
|
||||
"required_without" => "Полето :attribute се изисква, когато :values няма стойност.",
|
||||
"required_without_all" => "Полето :attribute се изисква, когато никое от полетата :values няма стойност.",
|
||||
"same" => "Полетата :attribute и :other трябва да съвпадат.",
|
||||
"size" => array(
|
||||
"numeric" => "Полето :attribute трябва да бъде :size.",
|
||||
"file" => "Полето :attribute трябва да бъде :size килобайта.",
|
||||
"string" => "Полето :attribute трябва да бъде :size знака.",
|
||||
"array" => "Полето :attribute трябва да има :size елемента."
|
||||
),
|
||||
"timezone" => "Полето :attribute трябва да съдържа валидна часова зона.",
|
||||
"unique" => "Полето :attribute вече съществува.",
|
||||
"url" => "Полето :attribute е в невалиден формат.",
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify custom validation messages for attributes using the
|
||||
| convention "attribute.rule" to name the lines. This makes it quick to
|
||||
| specify a specific custom language line for a given attribute rule.
|
||||
|
|
||||
*/
|
||||
|
||||
'custom' => array(
|
||||
'attribute-name' => array(
|
||||
'rule-name' => 'custom-message',
|
||||
),
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Validation Attributes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines are used to swap attribute place-holders
|
||||
| with something more reader friendly such as E-Mail Address instead
|
||||
| of "email". This simply helps us make messages a little cleaner.
|
||||
|
|
||||
*/
|
||||
|
||||
'attributes' => array(
|
||||
"name" => "Име",
|
||||
"username" => "Потребител",
|
||||
"email" => "E-mail",
|
||||
"first_name" => "Име",
|
||||
"last_name" => "Фамилия",
|
||||
"password" => "Парола",
|
||||
"city" => "Град",
|
||||
"country" => "Държава",
|
||||
"address" => "Адрес",
|
||||
"phone" => "Телефон",
|
||||
"mobile" => "GSM",
|
||||
"age" => "Възраст",
|
||||
"sex" => "Пол",
|
||||
"gender" => "Пол",
|
||||
"day" => "Ден",
|
||||
"month" => "Месец",
|
||||
"year" => "Година",
|
||||
"hour" => "Час",
|
||||
"minute" => "Минута",
|
||||
"second" => "Секунда",
|
||||
"title" => "Заглавие",
|
||||
"content" => "Съдържание",
|
||||
"description" => "Описание",
|
||||
"excerpt" => "Откъс",
|
||||
"date" => "Дата",
|
||||
"time" => "Време",
|
||||
"available" => "Достъпен",
|
||||
"size" => "Размер",
|
||||
"recaptcha_response_field" => "Рекапча",
|
||||
"subject" => "Заглавие",
|
||||
"message" => "Съобщение"
|
||||
),
|
||||
|
||||
);
|
||||
Loaded 100 of 1034 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user