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 2d 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 43% 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

1265d 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

[vemcogroup/laravel-translation

Translation package for Laravel to scan for localisations and up/download to poeditor

135304.0k2](/packages/vemcogroup-laravel-translation)[mage-os/module-automatic-translation

Automatic AI content translation for Mage-OS.

277.1k](/packages/mage-os-module-automatic-translation)[acclaro/translations

Easily launch and manage multilingual Craft websites without having to copy/paste content or manually track updates.

1229.5k](/packages/acclaro-translations)

PHPackages © 2026

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