Skip to content

Commit

Permalink
first ocmmit
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin van Maasakker committed May 10, 2024
0 parents commit 795c5ee
Show file tree
Hide file tree
Showing 21 changed files with 1,549 additions and 0 deletions.
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment: off
766 changes: 766 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* text=auto

.github/ export-ignore
tests/ export-ignore

.codecov.yml export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.styleci.yml export-ignore

phpunit.xml export-ignore
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.idea/

build/
node_modules/
vendor/

*.bak
*.cache
*.clover
*.orig

*.lock
67 changes: 67 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
preset: psr12

risky: true

enabled:
- align_double_arrow
- align_equals
- align_phpdoc
- alpha_ordered_imports
- binary_operator_spaces
- blank_line_before_continue
- blank_line_before_declare
- blank_line_before_return
- blank_line_before_throw
- blank_line_before_try
- cast_spaces
- combine_consecutive_issets
- const_separation
- dir_constant
- fully_qualified_strict_types
- logical_operators
- method_separation
- no_alias_functions
- no_blank_lines_after_phpdoc
- no_blank_lines_between_traits
- no_empty_comment
- no_empty_phpdoc
- no_extra_block_blank_lines
- no_extra_consecutive_blank_lines
- no_short_bool_cast
- no_trailing_comma_in_singleline_array
- no_unneeded_control_parentheses
- no_unused_imports
- ordered_class_elements
- php_unit_construct
- php_unit_fqcn_annotation
- phpdoc_indent
- phpdoc_inline_tag
- phpdoc_link_to_see
- phpdoc_no_access
- phpdoc_no_empty_return
- phpdoc_no_package
- phpdoc_no_useless_inheritdoc
- phpdoc_order
- phpdoc_property
- phpdoc_return_self_reference
- phpdoc_scalar
- phpdoc_separation
- phpdoc_summary
- phpdoc_to_comment
- phpdoc_trim
- phpdoc_type_to_var
- phpdoc_types
- phpdoc_types_order
- phpdoc_var_without_name
- property_separation
- self_accessor
- short_array_syntax
- short_list_syntax
- single_line_class_definition
- single_line_throw
- single_quote
- space_after_semicolon
- standardize_not_equals
- ternary_to_null_coalescing
- trailing_comma_in_multiline_array
- trim_array_spaces
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 godundmytro

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.
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Laravel DeepL Translator

Provides access to DeepL API for Laravel projects

[![Stable Version][badge_stable]][link_packagist]
[![Unstable Version][badge_unstable]][link_packagist]
[![Total Downloads][badge_downloads]][link_packagist]
[![License][badge_license]][link_license]

## Table of contents

* [Installation](#installation)
* [Using](#using)

## Installation

To get the latest version of `Laravel DeepL`, simply require the project using [Composer](https://getcomposer.org):

```bash
$ composer require dashed/laravel-deepl
```

Or manually update `require` block of `composer.json` and run `composer update`.

```json
{
"require": {
"dashed/laravel-deepl": "^0.1"
}
}
```

## Using

Translate single string

```php
use Dashed\Deepl\Facades\Deepl;

$translated = Deepl::api()->translate('Hallo wereld!', 'NL', 'EN');
```


Create/Update lang files for specific language. It allows to complete all missing translations for specific language.

```shell
php artisan deepl:sync nl
```

[badge_downloads]: https://img.shields.io/packagist/dt/dashed/laravel-deepl.svg?style=flat-square

[badge_license]: https://img.shields.io/packagist/l/dashed/laravel-deepl.svg?style=flat-square

[badge_stable]: https://img.shields.io/github/v/release/dashed/laravel-deepl?label=stable&style=flat-square

[badge_unstable]: https://img.shields.io/badge/unstable-dev--main-orange?style=flat-square

[link_license]: LICENSE

[link_packagist]: https://packagist.org/packages/dashed/laravel-deepl
61 changes: 61 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name" : "dashed/laravel-deepl",
"description" : "Deepl Automated translations for Laravel lang files",
"type" : "library",
"license" : "MIT",
"keywords" : [
"laravel",
"DeepL",
"DeepL api",
"translations",
"localization",
"lang"
],
"authors" : [
{
"name" : "Hodun Dmytro",
"email" : "godundmytro@gmail.com"
}
],
"support" : {
"issues" : "https://github.com/Dashed/laravel-deepl/issues",
"source" : "https://github.com/Dashed/laravel-deepl"
},
"require" : {
"php" : "^8.2",
"guzzlehttp/guzzle" : "7.8",
"chriskonnertz/deeply" : "^2.2",
"justraviga/laravel-langman" : "^0.1"
},
"require-dev" : {
"mockery/mockery" : "^1.0",
"orchestra/testbench" : "7.*",
"phpunit/phpunit" : "^9.0"
},
"autoload" : {
"psr-4" : {
"Dashed\\Deepl\\" : "src"
}
},
"autoload-dev" : {
"psr-4" : {
"Tests\\" : "tests"
}
},
"config" : {
"preferred-install" : "dist",
"sort-packages" : true
},
"minimum-stability" : "stable",
"prefer-stable" : true,
"extra" : {
"laravel" : {
"providers" : [
"Dashed\\Deepl\\DeeplServiceProvider"
],
"aliases" : {
"Deepl" : "Dashed\\Deepl\\Facades\\Deepl"
}
}
}
}
7 changes: 7 additions & 0 deletions config/deepl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'api_key' => env('DEEPL_API_KEY'),
'source_language' => 'EN',
'lang_directory' => realpath(base_path('resources/lang')),
];
32 changes: 32 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
verbose="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/logs/coverage"/>
<text outputFile="build/logs/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>
Loading

0 comments on commit 795c5ee

Please sign in to comment.