Skip to content

Commit 94611ab

Browse files
authored
Merge pull request #328 from laravel-shift/l10-compatibility
Laravel 10.x Compatibility
2 parents 051c21f + 436d743 commit 94611ab

File tree

12 files changed

+32
-37
lines changed

12 files changed

+32
-37
lines changed

.github/workflows/run-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
php: [8.0, 8.1]
18-
laravel: [8.*, 9.*]
18+
laravel: [8.*, 9.*, 10.*]
1919
dependency-version: [prefer-stable]
2020
os: [ubuntu-latest]
2121
include:
22+
- laravel: 10.*
23+
testbench: 8.*
2224
- laravel: 9.*
2325
testbench: 7.*
2426
- laravel: 8.*

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ If you discover any security related issues, please check [SECURITY](https://git
8888

8989
## Credits
9090

91-
- [Tom Witkowski](https://github.com/Gummibeer) *current maintainer*
92-
- [Dimitrios Savvopoulos](https://github.com/dimsav) *original author*
93-
- [David Llop](https://github.com/Lloople) *refactoring testsuite*
94-
- [Caneco](https://github.com/caneco) *artwork*
91+
- [Tom Witkowski](https://github.com/Gummibeer) _current maintainer_
92+
- [Dimitrios Savvopoulos](https://github.com/dimsav) _original author_
93+
- [David Llop](https://github.com/Lloople) _refactoring testsuite_
94+
- [Caneco](https://github.com/caneco) _artwork_
9595
- [All Contributors](../../contributors)
9696

9797
## Versions
9898

9999
| Package | Laravel | PHP |
100-
|:--------------------|:------------------------------|:----------|
100+
| :------------------ | :---------------------------- | :-------- |
101101
| **v11.10 - v11.10** | `8.* / 9.*` | `^8.0` |
102102
| **v11.6 - v11.9** | `5.8.* / 6.* / 7.* / 8.*` | `>=7.2` |
103103
| **v11.4 - v11.5** | `5.6.* / 5.7.* / 5.8.* / 6.*` | `>=7.1.3` |

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
},
3232
"require": {
3333
"php": "^8.0",
34-
"illuminate/contracts": "^8.0 || ^9.0",
35-
"illuminate/database": "^8.0 || ^9.0",
36-
"illuminate/support": "^8.0 || ^9.0"
34+
"illuminate/contracts": "^8.0 || ^9.0|^10.0",
35+
"illuminate/database": "^8.0 || ^9.0|^10.0",
36+
"illuminate/support": "^8.0 || ^9.0|^10.0"
3737
},
3838
"require-dev": {
3939
"laravel/legacy-factories": "^1.0.4",
4040
"mockery/mockery": "^1.3.3",
41-
"orchestra/testbench": "^6.0 || ^7.0",
41+
"orchestra/testbench": "^6.0 || ^7.0|^8.0",
4242
"phpunit/phpunit": "^9.0"
4343
},
4444
"minimum-stability": "dev",

docs/package/fallback-locale.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If you do not want to define the default fallback locale but just get the first
2525
'de' => [
2626
'DE',
2727
'AT',
28-
'CH',
28+
'CH',
2929
],
3030
]
3131
// ...
@@ -93,15 +93,15 @@ protected function isEmptyTranslatableAttribute(string $key, $value): bool
9393

9494
Since version v5.3 it is possible to use country based locales. For example, you can have the following locales:
9595

96-
* English: `en`
97-
* Spanish: `es`
98-
* Mexican Spanish: `es-MX`
99-
* Colombian Spanish: `es-CO`
96+
- English: `en`
97+
- Spanish: `es`
98+
- Mexican Spanish: `es-MX`
99+
- Colombian Spanish: `es-CO`
100100

101101
To configuration for these locales looks like this:
102102

103103
```php
104-
'locales' => [
104+
'locales' => [
105105
'en',
106106
'es' => [
107107
'MX',
@@ -119,4 +119,3 @@ We can also configure the "glue" between the language and country. If for instan
119119
What applies for the fallback of the locales using the `en-MX` format?
120120

121121
Let's say our fallback locale is `en`. Now, when we try to fetch from the database the translation for the locale `es-MX`but it doesn't exist, we won't get as fallback the translation for `en`. Translatable will use as a fallback `es` \(the first part of `es-MX`\) and only if nothing is found, the translation for `en` is returned.
122-

docs/package/interface.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ interface TranslatableProtected
1111
{
1212
// detect if a given translation attribute value is empty or not
1313
protected function isEmptyTranslatableAttribute(string $key, $value): bool;
14-
14+
1515
// save all attached translations
1616
protected function saveTranslations(): bool;
1717
}
1818
```
19-
20-
21-

docs/package/locales-helper.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,3 @@ Checks if the given locale is a country specific locale.
7878
### getLanguageFromCountryBasedLocale\(string $locale\)
7979

8080
Returns the language locale from given country based locale.
81-

docs/package/methods.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## Preconditions
44

5-
* the `locale` is set to `de`
6-
* the `fallback_locale` is set to `en`
7-
* our main model instance is `$post = Post::first()`
8-
* translations are available for `en`, `de` and `fr`
5+
- the `locale` is set to `de`
6+
- the `fallback_locale` is set to `en`
7+
- our main model instance is `$post = Post::first()`
8+
- translations are available for `en`, `de` and `fr`
99

1010
## Get an instance of the translation model
1111

@@ -124,4 +124,3 @@ disables autoload and returns parent attributes
124124
### static defaultAutoloadTranslations\(\)
125125

126126
does not change the default behavior logic
127-

docs/package/scopes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,3 @@ Sorts the model by a given translation column value
8686
```php
8787
Post::orderByTranslation('title')->get()
8888
```
89-

docs/package/validation-rule-factory.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,24 @@ This will return an array which adjusted the placeholder in key and string value
3232
To adjust the default `format` , `prefix` or `suffix` used by the factory you can change them in the package configuration file.
3333

3434
{% code title="config/translatable.php" %}
35+
3536
```php
3637
'rule_factory' => [
3738
'format' => \Astrotomic\Translatable\Validation\RuleFactory::FORMAT_ARRAY,
3839
'prefix' => '%',
3940
'suffix' => '%',
4041
]
4142
```
43+
4244
{% endcode %}
4345

4446
As `format` we support the two possible variants the `fill()` method supports.
4547

46-
#### RuleFactory::FORMAT\_ARRAY
48+
#### RuleFactory::FORMAT_ARRAY
4749

4850
This will create the dot-notation to support locale sub-arrays. `en.content`.
4951

50-
#### RuleFactory::FORMAT\_KEY
52+
#### RuleFactory::FORMAT_KEY
5153

5254
This will create the colon separated style. `content:en`
5355

@@ -71,4 +73,3 @@ This will use the colon style, use `{` and `}` as delimiter and use only `de` an
7173
{% hint style="info" %}
7274
You can only use defined locales. Every locale that's not in `Locales::all()`will throw an `InvalidArgumentException`.
7375
{% endhint %}
74-

docs/usage/attributes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ echo $post->{'title:de'}; // Mein erster Beitrag
1212
$post->title = 'My first edited post';
1313
echo $post->title; // My first edited post
1414
```
15-

0 commit comments

Comments
 (0)