Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
caneco committed Apr 26, 2021
0 parents commit 10298fb
Show file tree
Hide file tree
Showing 16 changed files with 535 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.idea
.php_cs
.php_cs.cache
.phpunit.result.cache
build
composer.lock
coverage
docs
phpunit.xml
psalm.xml
testbench.yaml
vendor
node_modules
43 changes: 43 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('resources/view/mail/*')
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline_array' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

All notable changes to `laravel-portugal/locale` will be documented in this file.

## 1.0.0 - 2021-04-26

- initial release
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) laravel-portugal <[email protected]>

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.
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Resources lang em Português

[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-portugal/locale.svg?style=flat-square)](https://packagist.org/packages/laravel-portugal/locale)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/laravel-portugal/locale/run-tests?label=tests)](https://github.com/laravel-portugal/locale/actions?query=workflow%3Arun-tests+branch%3Amaster)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/laravel-portugal/locale/Check%20&%20fix%20styling?label=code%20style)](https://github.com/laravel-portugal/locale/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amaster)
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-portugal/locale.svg?style=flat-square)](https://packagist.org/packages/laravel-portugal/locale)

In this repository, you can find the Portuguese lang files for your Laravel project.

## Installation

You can install the package via composer:

```bash
composer require laravel-portugal/locale
```

You can publish and run the migrations with:

```bash
php artisan vendor:publish --provider="LaravelPortugal\Locale\LocaleServiceProvider"
```

You can publish the config file with:

```bash
php artisan vendor:publish --provider="LaravelPortugal\Locale\LocaleServiceProvider" --tag="locale-config"
```

## Usage

After the language publish you need to change the default language of your application in the `config/app.php` configuration by setting `locale` to `pt`.

Then just use it normally.

```php
trans('passwords.reset'); // A sua senha foi alterada!

__('password.throttled') // Aguarde antes de tentar novamente.
```

## Testing

```bash
composer test
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## Credits

- [Caneco](https://github.com/caneco)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
52 changes: 52 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "laravel-portugal/locale",
"description": "Resources lang em Português",
"keywords": ["laravel-portugal", "laravel", "locale", "lang", "language", "localization"],
"homepage": "https://github.com/laravel-portugal/locale",
"license": "MIT",
"authors": [
{
"name": "Caneco",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"php": "^8.0",
"illuminate/contracts": "^8.0"
},
"require-dev": {
"larapack/dd": "^1.1",
"orchestra/testbench": "^6.17",
"phpunit/phpunit": "^9.5",
"vimeo/psalm": "^4.4"
},
"autoload": {
"psr-4": {
"LaravelPortugal\\Locale\\": "src",
"LaravelPortugal\\Locale\\Database\\Factories\\": "database/factories"
}
},
"autoload-dev": {
"psr-4": {
"LaravelPortugal\\Locale\\Tests\\": "tests"
}
},
"scripts": {
"psalm": "vendor/bin/psalm",
"test": "./vendor/bin/testbench package:test --no-coverage",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"LaravelPortugal\\Locale\\LocaleServiceProvider"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
39 changes: 39 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="Locale Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
</phpunit>
16 changes: 16 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<psalm
errorLevel="4"
findUnusedVariablesAndParams="true"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
</psalm>
19 changes: 19 additions & 0 deletions resources/lang/pt/auth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Traduções de autenticação
|--------------------------------------------------------------------------
|
| As linhas seguintes são usadas durante a autenticação para informar o
| utilizador das suas ações. Você pode alterar estas traduções de
| acordo com os requisitos da sua aplicação.
|
*/

'failed' => 'As credenciais indicadas não coincidem com as registadas no sistema.',
'password' => 'A password indicada está incorreta.',
'throttle' => 'O número limite de tentativas de login foi atingido. Por favor tente novamente dentro de :seconds segundos.',
];
19 changes: 19 additions & 0 deletions resources/lang/pt/pagination.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Traduções de paginação
|--------------------------------------------------------------------------
|
| As linhas seguintes são usadas pelo Laravel para a paginação simples.
| Você pode alterar estas traduções de acordo com os requisitos da
| sua aplicação.
|
*/

'previous' => '&laquo; Anterior',
'next' => 'Próximo &raquo;',

];
22 changes: 22 additions & 0 deletions resources/lang/pt/passwords.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Traduções de alteração de password
|--------------------------------------------------------------------------
|
| As linhas seguintes são utilizadas por omissão pelo corrector de password
| para uma tentativa de alteração de password, quer a utilização de um
| token inválido ou mesmo uma password inválida.
|
*/

'reset' => 'A sua senha foi alterada!',
'sent' => 'Foi enviado um link por email para alterar a sua password!',
'throttled' => 'Aguarde antes de tentar novamente.',
'token' => 'Esse token de alteração de password é inválido.',
'user' => "Não encontramos nenhum utilizador com esse endereço de email.",

];
Loading

0 comments on commit 10298fb

Please sign in to comment.