PHPackages                             selninc/translation-sheet - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. selninc/translation-sheet

AbandonedArchivedLibrary

selninc/translation-sheet
=========================

Laravel Translation via Google Spreadsheet

v1.4.5(5y ago)13.8kMITPHP

Since Sep 4Pushed 3y agoCompare

[ Source](https://github.com/SelnInc/translation-sheet)[ Packagist](https://packagist.org/packages/selninc/translation-sheet)[ Docs](https://github.com/nikaia/translation-sheet)[ RSS](/packages/selninc-translation-sheet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (38)Used By (0)

Laravel Translation Sheet
=========================

[](#laravel-translation-sheet)

Translating Laravel languages files using a Google Spreadsheet.

[![Latest Version on Packagist](https://camo.githubusercontent.com/9b833065ab4d638ecd085acdb72226cbf809869caaec95cd56d9e0555954c037/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e696b6169612f7472616e736c6174696f6e2d73686565742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nikaia/translation-sheet)[![Build Status](https://github.com/nikaia/translation-sheet/workflows/run-tests/badge.svg)](https://github.com/nikaia/translation-sheet/actions?query=workflow%3Arun-tests)[![Quality Score](https://camo.githubusercontent.com/7c65141d40711cf0bf7b4a9ed5100a9930c1be6e033cf588cb7e90daaf2cc8fc/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e696b6169612f7472616e736c6174696f6e2d73686565742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nikaia/translation-sheet)

[![](./docs/banner.jpg)](./docs/banner.jpg)

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

- Install package

    ```
    $ composer require nikaia/translation-sheet --dev
    ```
- If Laravel version &lt;= 5.4, Add service provider to your 'config/app.php'. For version &gt;= 5.5, package will be auto-discoverd by Laravel.

    ```
    Nikaia\TranslationSheet\TranslationSheetServiceProvider::class,
    ```
- Configuration can be done via environments variables, but if you prefer you can override the configuration by publishing the package config file using :

    ```
    $ php artisan translation_sheet:publish
        or
    $ php artisan vendor:publish --provider="Nikaia\TranslationSheet\TranslationSheetServiceProvider"
    ```

### Requirements

[](#requirements)

Laravel &gt;= 5.1

Configuration
-------------

[](#configuration)

### Google Api credentials

[](#google-api-credentials)

- Create a new project in
- Make sure to activate `Sheet Api` for the created project
    - Navigate to "Library"
    - Search "Google Sheets API" &gt; Click on "Google Sheets API" and click enable
- Create credentials
    - Navigate to "Credentials"
    - Click "Create credentials"
    - Choose "Service Account key"
    - Choose A "New Service Account" in the "Service account" select
        - Choose a name. (ie. This is the name that will show up in the Spreadsheet history operations),
        - Choose "Editor" as the role
        - Choose "JSON" for the key type.
    - Save the credentials to 'resources/google/service-account.json' folder. (You can choose another name/folder and update the package configuration)
    - Make sure to write down the service account email, you will need to share the spreadsheet with this email (see below).

### Spreadsheet

[](#spreadsheet)

- Create a blank/new spreadsheet here  .
- Share it with the service account email with `Can edit` permission.

### Package configuration

[](#package-configuration)

In your .env file or in your published config file (`config/translation_sheet.php`), you need to add the following

```
# The service account email
TS_SERVICE_ACCOUNT_EMAIL=***@***.iam.gserviceaccount.com

# The path to the downloaded service account credentials file
TS_SERVICE_ACCOUNT_CREDENTIALS_FILE=resources/google/service-account.json

# The ID of the spreadsheet that we will be using for translation (the last portion of the spreadsheet url)
TS_SPREADSHEET_ID=xxxx

# The locales of the application (separated by comma)
TS_LOCALES=fr,en,es

```

Usage
-----

[](#usage)

1/ Setup the spreadsheet

This need to be done only once.

```
$ php artisan translation_sheet:setup
```

2/ Prepare the sheet

To avoid some conflicts, we will first run this command to rewrite the locale languages files.

```
$ php artisan translation_sheet:prepare
```

3/ Publish translation to sheet

```
$ php artisan translation_sheet:push
```

4/ Share the spreadsheet with clients or project managers for translations.

5/ Once done, You can lock the translations on the spreadsheet (to avoid conflicts)

```
$ php artisan translation_sheet:lock
```

6/ Pull the translations

This will pull the translations from the spreadsheet, and write it the language files in your applications. You can use git diff here to make sure eveything is ok (Conflicts, errors etc ...)

```
$ php artisan translation_sheet:pull
```

6/ Unlock the translations on the spreadsheet

```
$ php artisan translation_sheet:unlock
```

Open the spreadsheet in the browser

```
$ php artisan translation_sheet:open
```

Excluding translations
----------------------

[](#excluding-translations)

Sometimes you might need to instruct the package to exclude some translations. You can do so by specifying patterns in the `exclude` config option. It accepts multiple patterns that target the full translation keys and that the [Str::is](https://laravel.com/docs/5.8/helpers#method-str-is) can understand.

```
[
    // ...

    'exclude' => [
        'validation*',  // This will exclude all the `validation.php` translations.
        'foo::*',       // This will exclude all the `foo` namespace translations.
        'foo::bar.*',   // this will exclude the `bar` translations from the `foo` namespace.
    ],

    // ...
]
```

Extra sheets
------------

[](#extra-sheets)

[![Extra sheets](./docs/extra-sheets.png)](./docs/extra-sheets.png)

Sometimes you may have other files that need translations. They are not related to the laravel application per se and are not stored in the `resources\lang` folder. Maybe you are building a web app (spa), or even a mobile app alongside the laravel app, and you need to handle their translations.

In this specific case, you can configure extra sheets to handle those translations files stored inside a specific path.

- This feature handles only json files.
- The files must live outside the `resources\lang` directory. For instance `resources\web-app\lang`.

```
[
    // ...

    'extra_sheets' => [
        [
            'name' => 'Web App',                        // Spreadsheet sheet (tab) name.
            'path' => resource_path('web-app/lang'),    // Path where json files are stored. Files can be organized inside sub folders.
            'tabColor' => '#0000FF',                    // Color of the spreadsheet tab
        ],
        [
            'name' => 'Mobile App',
            'path' => resource_path('mobile-app/lang'),
            'tabColor' => '#0000FF',
        ],
    ],
]
```

> You need to run `translation_sheet:setup` command, if you add this config later on.

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

```
$ composer test
```

*N.B : You need a valid configuration service-account.json file to run tests.*

### Github action

[](#github-action)

To test your fork using github action, you need a valid `service-account.json`. The file is ignored in the repository to avoid exposing credentials. You need to encode your credentials file `tests/fixtures/service-account.json using `gpg`

```
# Save credential file to tests/fixtures/service-account.json
$ gpg -c tests/fixtures/service-account.json  tests/fixtures/service-account.json.gpg
```

Commit the `.gpg` encoded file.

PS. Github action will decrypt the file just before running the tests. See the `run-tests.yml` file.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

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

Credits
-------

[](#credits)

- [Nassif Bourguig](https://github.com/nbourguig)
- [All Contributors](../../contributors)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 90.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Total

31

Last Release

2051d ago

Major Versions

0.0.5 → 1.0.02017-01-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/786654edb3d4be610895f9a4775bed78e06d5ca0ae29d7afbef641f50cceed1e?d=identicon)[ishikw](/maintainers/ishikw)

---

Top Contributors

[![nbourguig](https://avatars.githubusercontent.com/u/276832?v=4)](https://github.com/nbourguig "nbourguig (147 commits)")[![frovere](https://avatars.githubusercontent.com/u/5685929?v=4)](https://github.com/frovere "frovere (4 commits)")[![namnhp-2137](https://avatars.githubusercontent.com/u/60587827?v=4)](https://github.com/namnhp-2137 "namnhp-2137 (2 commits)")[![tr-github](https://avatars.githubusercontent.com/u/696870?v=4)](https://github.com/tr-github "tr-github (2 commits)")[![xsusov](https://avatars.githubusercontent.com/u/5796770?v=4)](https://github.com/xsusov "xsusov (2 commits)")[![nghiavv-1400](https://avatars.githubusercontent.com/u/40588496?v=4)](https://github.com/nghiavv-1400 "nghiavv-1400 (1 commits)")[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (1 commits)")[![balping](https://avatars.githubusercontent.com/u/5840038?v=4)](https://github.com/balping "balping (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![kslr](https://avatars.githubusercontent.com/u/5516323?v=4)](https://github.com/kslr "kslr (1 commits)")[![alexandrutabolcea](https://avatars.githubusercontent.com/u/1652948?v=4)](https://github.com/alexandrutabolcea "alexandrutabolcea (1 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/selninc-translation-sheet/health.svg)

```
[![Health](https://phpackages.com/badges/selninc-translation-sheet/health.svg)](https://phpackages.com/packages/selninc-translation-sheet)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M682](/packages/barryvdh-laravel-ide-helper)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M596](/packages/laravel-ui)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[sammyjo20/lasso

Lasso - Asset wrangling for Laravel made simple.

355347.9k](/packages/sammyjo20-lasso)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
