Skip to content

Commit

Permalink
add documentation html
Browse files Browse the repository at this point in the history
  • Loading branch information
abbadon1334 committed Jul 11, 2019
1 parent 3636f5e commit 2a9d2b7
Show file tree
Hide file tree
Showing 77 changed files with 4,251 additions and 85 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ composer.phar
/vendor
.DS_Store
.php_cs.cache
/phpdocs
/build
/backup
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,37 @@ $result = $this->translator->_('namespace:definitionKey', ['param1' => 'test'],
## Support I18Next
##### http://i18next.com

- [x] load json files by folder, every folder is a language code
- [x] get a defined translation in primary language
- [x] if not found try in fallback language
- [x] if not found return original string
- [x] Namespaces
- [x] get defined translation based on prioritized fallback namespaces
- [x] Read files from folder, every folder is a language code
- [x] JSON
- [ ] YAML
- [ ] PHP Array
- [ ] Write files to a folder, every folder is a language code
- [ ] JSON
- [ ] YAML
- [ ] PHP Array
- [x] Get a defined translation in primary language
- [x] If not found try in fallback language
- [x] If not found return original string
- [ ] Collect missing requested keys
- [x] Namespaces
- [x] Get defined translation based on prioritized fallback namespaces
- [x] Context as {key}_{context}
- [x] Plurals
- [x] singular as {key}
- [x] plurals as {key}_plural
- [x] multiple plurals as {key}_{int $counter}
- [x] manage when $counter is bigger than max defined plurals
- [x] Singular as {key}
- [x] Plurals as {key}_plural
- [x] Multiple plurals as {key}_{int $counter}
- [x] Manage when $counter is bigger than max defined plurals
- [x] Nested interpolate plurals
- [x] Interpolate
- [x] Replace {{key}} with defined $paramater value
- [x] if {{key}} has a point like {{key.index}} and $parameters[index] is an array or object will retrive the value
- [x] If {{key}} has a point like {{key.index}} and $parameters[index] is an array or object will retrive the value
- [x] Nesting
- [x] Basic
- [x] Plurals
- [ ] Formatting
- [ ] Adding Helper for use method Translator::_ as global functions _
- [ ] Adding Helper for use Translator as a global singleton instance
- [ ] Adding Helper for search/collect calls to method Translator _ in code

## Support ATK4 - Agile Toolkit Model
##### https://www.agiletoolkit.org
Expand Down
64 changes: 50 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"prefer-stable": true,
"require": {
"php": ">=7.2",
"atk4/core": "dev-develop@dev"
"atk4/core": "dev-develop@dev",
"thecodingmachine/phpstan-safe-rule": "^0.1.3",
"thecodingmachine/safe": "^0.1.16"
},
"require-dev": {
"atk4/data": "dev-develop@dev",
Expand All @@ -23,8 +25,7 @@
"phpmetrics/phpmetrics": "dev-master@dev",
"phpstan/phpstan": "0.11.12",
"phpunit/phpunit": "8.2.4",
"squizlabs/php_codesniffer": "3.4.2",
"symfony/yaml": "~2.1|~3.0|~4.0"
"squizlabs/php_codesniffer": "3.4.2"
},
"config": {
"sort-packages": true
Expand Down Expand Up @@ -52,7 +53,10 @@
"metrics": [
"mkdir -p ./build/report",
"mv ./build/report ./build/report_$(date +\"%Y.%m.%d_%H%M%S\")",
"phpmetrics --config=./.phpmetrics.json .",
"phpmetrics --config=./.phpmetrics.json ."
],
"metrics-web": [
"composer run metrics",
"firefox ./build/report/phpmetrics.html/index.html"
],
"metrics-clear": [
Expand All @@ -64,24 +68,56 @@
"mv ./build/coverage ./build/coverage_$(date +\"%Y.%m.%d_%H%M%S\")",
"phpunit --configuration phpunit.xml"
],
"unit-html": [
"unit-coverage": [
"mkdir -p ./build/coverage",
"mv ./build/coverage ./build/coverage_$(date +\"%Y.%m.%d_%H%M%S\")",
"phpunit --configuration phpunit.xml --coverage-html ./build/coverage",
"phpunit --configuration phpunit.xml --coverage-html ./build/coverage"
],
"coverage-web": [
"composer run unit-coverage",
"firefox ./build/coverage/index.html"
],
"unit-clear": [
"rm -rf ./build/coverage_*",
"rm -rf ./build/coverage"
],
"gen-test-cases": [
"mkdir -p ./tests/data/locales",
"rm -rf ./tests/data/locales",
"mkdir -p ./tests/data/locales",
"php ./tests/data/utils/create_cases.php"
"doc-setup": [
"composer run doc-setdown",
"mkdir -p phpdocs",
"wget -P phpdocs https://github.com/phpDocumentor/phpDocumentor2/archive/develop.zip",
"cd phpdocs && unzip develop.zip",
"rm phpdocs/develop.zip",
"mv phpdocs/phpDocumentor2-develop/* -t phpdocs",
"rm -rf phpdocs/phpDocumentor2-develop",
"cd phpdocs && composer install --no-interaction --prefer-source",
"cd phpdocs && composer require abbadon1334/phpdoc-to-rst --prefer-dist",
"cd phpdocs && echo \"APP_ENV=dev\nAPP_SECRET=3f48b02b6f8e6ad6e8c07d0b03762d31\" > .env"
],
"doc-build": [
"composer run doc-clear",
"mkdir -p ./docs",
"chmod +x phpdocs/bin/phpdoc",
"php phpdocs/bin/phpdoc --config=phpdoc.dist.xml --template=./phpdocs/data/templates/abstract --visibility=\"public\" --force -n",
"php phpdocs/bin/phpdoc-to-rst generate --repo-base \"$PWD\" --repo-github https://github.com/abbadon1334/phpdoc-to-rst -t docs/rst/ src/"
],
"doc-clear": [
"mkdir -p ./docs",
"rm -rf ./docs"
],
"show-test-cases": [
"php ./tests/data/utils/show_cases.php"
]
"doc-setdown": [
"mkdir -p ./phpdocs",
"rm -rf ./phpdocs"
],
"build-all": [
"composer run doc-setup",
"composer run doc-build",
"composer run unit-coverage",
"cp -r build/coverage docs/coverage",
"composer run metrics",
"cp -r build/report/phpmetrics.html docs/metrics"
],
"config": {
"process-timeout":6000
}
}
}
Loading

0 comments on commit 2a9d2b7

Please sign in to comment.