PHPackages                             aw-studio/laravel-json-translations - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. aw-studio/laravel-json-translations

ActiveLibrary[Localization &amp; i18n](/categories/localization)

aw-studio/laravel-json-translations
===================================

v0.2(3y ago)24.1kMITPHPPHP ^8.0

Since Aug 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/aw-studio/laravel-json-translations)[ Packagist](https://packagist.org/packages/aw-studio/laravel-json-translations)[ RSS](/packages/aw-studio-laravel-json-translations/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Laravel Json Translations
=========================

[](#laravel-json-translations)

The `Laravel Json Translations` package offers a convenient way of providing all translations from the `resources/lang` directory via a route serving a javascript file as JSON object and automatically binds them to the window-object. This is useful when working with i18n packages in frontend-frameworks like Vue.js. All translations will be provided in the following format:

```
{
"en": {
    "auth": {
        "failed": "These credentials do not match our records.",
        "password": "The provided password is incorrect.",
        "throttle": "Too many login attempts. Please try again in :seconds seconds."
    }
}
```

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

[](#installation)

The package can be installed via composer:

```
composer require aw-studio/laravel-json-translations
```

Usage
-----

[](#usage)

Register the route that will serve the translation file in `routes/web.php` via the availble helper which takes a filename and an array of all locales that should be included in the file as an parameter:

```
// routes/web.php

use AwStudio\LaravelJsonTranslations\Facades\JsonTranslations;

// this will serve https://your-app.com/my-translations.js
JsonTranslations::javascript('my-translations', ['en', 'de']);
```

You can now include a local javascript using the `` tag or simply use the blade-directive in a view where you need to provide the json translations:

```
// will render to
@translations('my-translations')
```

If you want to receive raw json e.g. in an api, this can be achieved using the `json` method via the `JsonTranslations` facade:

```
use AwStudio\LaravelJsonTranslations\Facades\JsonTranslations;

Route::get('json', function () {
    return JsonTranslations::json(['en', 'de']);
});
```

Vue i18n example
----------------

[](#vue-i18n-example)

As the json translations are bound to the `window` object

```
import Vue from 'vue';
import VueI18n from 'vue-i18n';

const messages = window.i18n;

Vue.use(VueI18n);

const i18n = new VueI18n({
    locale: 'de',
    fallbackLocale: 'en',
    messages
});

export default i18n;
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~479 days

Total

2

Last Release

1315d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b2d65d58480dd7fdbf4f4593158cbd0634550ee9210c49957cc48c8a8ccaef6?d=identicon)[jannescb](/maintainers/jannescb)

---

Top Contributors

[![jannescb](https://avatars.githubusercontent.com/u/17292622?v=4)](https://github.com/jannescb "jannescb (8 commits)")[![Chrissle28](https://avatars.githubusercontent.com/u/69738385?v=4)](https://github.com/Chrissle28 "Chrissle28 (1 commits)")

### Embed Badge

![Health badge](/badges/aw-studio-laravel-json-translations/health.svg)

```
[![Health](https://phpackages.com/badges/aw-studio-laravel-json-translations/health.svg)](https://phpackages.com/packages/aw-studio-laravel-json-translations)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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