Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11.x Compatibility #29

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e93c8a1
fixes for support Laravel 5.4
adammatysiak Apr 1, 2017
aa40945
support for all lang files import/export
adammatysiak Apr 1, 2017
2ae5cc4
export command refactor
adammatysiak Apr 10, 2017
5033b92
import command refactor
adammatysiak Apr 11, 2017
87d0e00
PSR-4 fixes
adammatysiak Apr 11, 2017
4a6246a
5.4.3 Package Auto-Discovery
adammatysiak Sep 27, 2017
1a4c931
Add compatibility with laravel 5.1
QuentinBontemps Mar 7, 2018
9f8d334
Merge pull request #1 from QuentinBontemps/master
adammatysiak Mar 7, 2018
d2eaeff
fixe helpers resource_path()
QuentinBontemps Mar 7, 2018
f118c78
Merge pull request #2 from QuentinBontemps/master
adammatysiak Mar 13, 2018
6bac44f
Update helpers.php
batenburg Mar 14, 2018
0ff0b70
Merge pull request #3 from batenburg/patch-1
adammatysiak Mar 14, 2018
ebe87c6
L5.6 support
adammatysiak Apr 18, 2018
c457ee8
Merge branch 'master' of https://github.com/highsolutions/laravel-lan…
adammatysiak Apr 18, 2018
371039a
Fixe error "Array to string conversion"
QuentinBontemps Jun 29, 2018
e5bab74
Merge pull request #4 from QuentinBontemps/patch-1
adammatysiak Jun 29, 2018
8ada981
Fixe Excel UTF8 encode
QuentinBontemps Jul 9, 2018
1727d2a
Merge pull request #5 from QuentinBontemps/patch-2
adammatysiak Jul 10, 2018
1fa9902
Create folder when isn't exists
QuentinBontemps Aug 7, 2018
62fde02
Merge pull request #6 from QuentinBontemps/patch-3
adammatysiak Aug 7, 2018
a90bf96
L5.7 support
AidasK Jan 8, 2019
a5068de
Update composer.json
adammatysiak Jan 11, 2019
4514d48
Merge pull request #8 from AidasK/patch-2
adammatysiak Jan 11, 2019
2bf6a55
Update README.md
adammatysiak Jan 11, 2019
c7d5886
Update README.md
adammatysiak Jan 11, 2019
353a221
Laravel 6.0 support
adammatysiak Sep 4, 2019
ecdcd3b
[fix] Array helpers
adammatysiak Sep 4, 2019
2aa5f6d
Support Laravel 8.x
adammatysiak Sep 9, 2020
4294090
Laravel 10.x support
adammatysiak Jan 15, 2024
a56502b
Support Laravel 9.x and 10.x
adammatysiak Jan 15, 2024
5c2234a
Bump dependencies for Laravel 11
laravel-shift Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- 7.0

matrix:
include:
- php: 5.6
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'

before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev
- composer dump-autoload

script: phpunit
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2014 UFirst Group
Copyright (c) 2017 HighSolutions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
109 changes: 95 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
laravel-lang-import-export
![Laravel-Lang-Import-Export by HighSolutions](https://raw.githubusercontent.com/highsolutions/laravel-lang-import-export/master/intro.jpg)

Laravel-Lang-Import-Export
==========================

This package provides artisan commands to import and export language files from and to CSV. This can be used to send translations to agencies that normally work with Excel-like files.
Expand Down Expand Up @@ -43,20 +45,19 @@ Add the following line to the `require` section of your Laravel webapp's `compos

```javascript
"require": {
"ufirst/lang-import-export": "dev-master"
"HighSolutions/laravel-lang-import-export": "^6.0"
}
```


Run `composer update` to install the package.


Finally add the following line to the `providers` array of your `app/config/app.php` file:
This package uses Laravel 5.5 Package Auto-Discovery.
For previous versions of Laravel, you need to update `config/app.php` by adding an entry for the service provider:

```php
'providers' => array(
/* ... */
'UFirst\LangImportExport\LangImportExportServiceProvider'
'HighSolutions\LangImportExport\LangImportExportServiceProvider'
)
```

Expand All @@ -68,19 +69,99 @@ The package currently provides two commands, one for exporting the files and one
### Export

```bash
php artisan lang-export:csv en_US navigation
php artisan lang-export:csv --output /some/file en_US navigation
php artisan lang-export:csv --delimiter=";" --enclosure='"' --output=/some/file en_US navigation
php artisan lang:export
php artisan lang:export en * path/to/export
php artisan lang:export en auth -A -X
```

You have to pass the __locale__ and the __group__ as arguments. The group is the name of the langauge file without its extension. You may define options for your desired CSV format.
When you call command without parameters, export file will be generated for all localization files within default locale. But you can define **locale** explicitly. You can also export only one file (second parameter - **group**) and define where to store file (you can provide name with and without .csv extension). When you use **output** argument, default path is base_path() -> catalog of your whole project.
But there is few more useful parameters:

### Import
| name of parameter | description | is required? | default value |
|-------------------|-----------------------------------------|--------------|------------------------------------|
| locale | The locale to be exported | NO | default lang of application |
| group | The name of translation file to export | NO | \* - all files |
| output | Filename of exported translation files | NO | storage/app/lang-import-export.csv |
| -A / --append | Append name of group to the name of file | NO | empty |
| -X / --excel | Set file encoding (UTF-16) for Excel | NO | UTF-8 |
| -D / --delimiter | Field delimiter | NO | , |
| -E / --enclosure | Field enclosure | NO | " |

### Import

```
php artisan lang-import:csv en_US navigation /some/file
php artisan lang-import:csv --delimiter=";" --enclosure='"' --escape='\\' en_US navigation /some/file
php artisan lang:import
php artisan lang:import en * path/to/import
php artisan lang:import en auth -X
```

You have to pass the __locale__, the __group__ and the __path to the CSV file__ as arguments. The group is the name of the langauge file without its extension. You may define options to match the CSV format of your input file.
When you call command without parameters - it will try to read default file of export command without parameters for default locale and all localization files. You can of course specify all parameters (**locale**, **group**, **input**) and there is few more options:

| name of parameter | description | is required? | default value |
|-------------------|----------------------------------------------|--------------|------------------------------------|
| locale | The locale to be imported | NO | default lang of application |
| group | The name of translation file to import | NO | * - all files |
| output | Filename of translation files to be imported | NO | storage/app/lang-import-export.csv |
| -X / --excel | Set file encoding from Excel | NO | UTF-8 |
| -D / --delimiter | Field delimiter | NO | , |
| -E / --enclosure | Field enclosure | NO | " |
| -C / --escape | Field escape | NO | \ |

Changelog
------------

6.2.0
* Support Laravel 9.x and 10.x

6.1.0
* Support Laravel 7.x and 8.x

6.0.0
* Support Laravel 6.0

5.4.10
* Laravel 5.7 support

5.4.9
* Create new directory, when not exists before

5.4.8
* Fix UTF-8 encoding

5.4.7
* Handling empty keys

5.4.6
* Laravel 5.6 support

5.4.3
- support Package Auto-Discovery

5.4.2
- resolve problems with PSR-4 autoloading

5.4.1
- improved import command
- improved Excel support
- support of [LaravelLocalization](https://github.com/mcamara/laravel-localization) routes files

5.4.0
- refactor whole repository
- add support for Excel
- add support for export and import all localization files
- any arguments are not required

Roadmap
------------

* Removing tabs from text
* Option for deleting export file after importing.
* Option for excluding certain files (and system ones).
* Unit tests!

Credits
------------

This package was originally created by [UFirst](http://github.com/ufirstgroup) and is available here: [Laravel-lang-import-export](https://github.com/ufirstgroup/laravel-lang-import-export).

Currently is developed by [HighSolutions](https://highsolutions.org), software house from Poland in love in Laravel.
49 changes: 37 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
{
"name": "ufirst/lang-import-export",
"name": "highsolutions/laravel-lang-import-export",
"description": "A Laravel package providing artisan commands to import and export language files from and to CSV.",
"keywords": ["laravel", "localization", "translation", "messages", "import", "export", "CSV"],
"keywords": [
"laravel",
"localization",
"translation",
"messages",
"import",
"export",
"CSV"
],
"authors": [
{
"name": "Michael Ruoss",
"email": "[email protected]"
"email": "[email protected]"
},
{
"name": "HighSolutions",
"email": "[email protected]"
}
],
"license": "MIT",
"require": {
"php": ">=5.3.0",
"illuminate/support": "~5.1"
"php": ">=5.6.4",
"illuminate/support": "5.*|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0"
},
"autoload": {
"classmap": [
"src/migrations"
],
"psr-0": {
"UFirst\\LangImportExport\\": "src/"
}
"psr-4": {
"HighSolutions\\LangImportExport\\": "src/"
},
"files": [
"src/Support/helpers.php"
]
},
"extra": {
"component": "package",
"frameworks": ["Laravel 5"]
"frameworks": [
"Laravel 5.7",
"Laravel 5.8",
"Laravel 6.x",
"Laravel 7.x",
"Laravel 8.x",
"Laravel 9.x",
"Laravel 10.x"
],
"laravel": {
"providers": [
"HighSolutions\\LangImportExport\\LangImportExportServiceProvider"
]
}
},
"minimum-stability": "stable"
}
Binary file added intro.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed public/.gitkeep
Empty file.
Loading