PHPackages                             xanweb/c5-js-localization - 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. xanweb/c5-js-localization

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

xanweb/c5-js-localization
=========================

Concrete5 Localization

v2.0.1(4y ago)04732MITPHPPHP &gt;=7.4

Since Mar 29Pushed 4y ago3 watchersCompare

[ Source](https://github.com/Xanweb/c5-js-localization)[ Packagist](https://packagist.org/packages/xanweb/c5-js-localization)[ RSS](/packages/xanweb-c5-js-localization/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (5)Dependencies (3)Versions (8)Used By (2)

ConcreteCMS Javascript Localization
===================================

[](#concretecms-javascript-localization)

[![Latest Version on Packagist](https://camo.githubusercontent.com/13757c418667aa119ebaefee1cc889553d1afe7adf59e017aabd5b209d0db78e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f78616e7765622f63352d6a732d6c6f63616c697a6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xanweb/c5-js-localization)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Pass translations and any other information from php to javascript

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

[](#installation)

Include library to your composer.json

```
composer require xanweb/c5-js-localization
```

Usage
-----

[](#usage)

Register `\Xanweb\C5\JsLocalization\ServiceProvider` on package start or include it in `/application/config/app.php`

### For Backend:

[](#for-backend)

1- Add listener to `BackendAssetLocalizationLoad::NAME` on your package start or under `/application/bootstrap/app.php`:

```
use Xanweb\C5\JsLocalization\Event\BackendAssetLocalizationLoad;

$this->app['director']->addListener(BackendAssetLocalizationLoad::NAME, function (BackendAssetLocalizationLoad $event) {
    $event->getAssetLocalization()->mergeWith([
        'i18n' => [
            'confirm' => t('Are you sure?'),
            'maxItemsExceeded' => t('Max items exceeded, you cannot add any more items.'),
            'pageNotFound' => t('Page not found'),
            'colorPicker' => [
                'cancelText' => t('Cancel'),
                'chooseText' => t('Choose'),
                'togglePaletteMoreText' => t('more'),
                'togglePaletteLessText' => t('less'),
                'noColorSelectedText' => t('No Color Selected'),
                'clearText' => t('Clear Color Selection'),
            ]
        ],
        'editor' => [
            'initRichTextEditor' => $this->app['editor']->getEditorInitJSFunction(),
        ],
    ]);
});
```

2- Include the required asset to your view:

```
$view->requireAsset('javascript-localized', 'xw/backend');
```

3- You can now use your data within javascript file:

```
alert(xw_backend.i18n.confirm);

// Init Editor Example:
xw_backend.editor.initRichTextEditor($('#myTextareaField'));
```

### For Frontend:

[](#for-frontend)

1- Add listener to `FrontendAssetLocalizationLoad::NAME` on your package start or under `/application/bootstrap/app.php`:

```
use Xanweb\C5\JsLocalization\Event\FrontendAssetLocalizationLoad;

$this->app['director']->addListener(FrontendAssetLocalizationLoad::NAME, function (FrontendAssetLocalizationLoad $event) {
    $event->getAssetLocalization()->mergeWith([
        'i18n' => [
            'message' => t('Are you sure?'),
        ],
        'methods' => [
            'showMessage' => 'function(){ alert("Website: ' . Core::make('site')->getSite()->getSiteName() . '"); }',
        ],
    ]);
});
```

2- Include the required asset to your view:

```
$view->requireAsset('javascript-localized', 'xw/frontend');
```

3- You can now use your data within javascript file:

```
alert(xw_frontend.i18n.message);

// Execute function:
xw_frontend.methods.showMessage();
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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 ~39 days

Recently: every ~44 days

Total

6

Last Release

1671d ago

Major Versions

v1.1.1 → v2.02021-10-07

PHP version history (2 changes)v1.0PHP ^7.2

v2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/959a0385bef775f2a7cef6afce381614338a6a633f4d66903b454323221cfcdc?d=identicon)[HamedDarragi](/maintainers/HamedDarragi)

---

Top Contributors

[![HamedDarragi](https://avatars.githubusercontent.com/u/13836863?v=4)](https://github.com/HamedDarragi "HamedDarragi (16 commits)")[![BSalaeddin](https://avatars.githubusercontent.com/u/15094821?v=4)](https://github.com/BSalaeddin "BSalaeddin (1 commits)")

---

Tags

libraryconcrete5concrete5-v8

### Embed Badge

![Health badge](/badges/xanweb-c5-js-localization/health.svg)

```
[![Health](https://phpackages.com/badges/xanweb-c5-js-localization/health.svg)](https://phpackages.com/packages/xanweb-c5-js-localization)
```

###  Alternatives

[skillshare/formatphp

Internationalize PHP apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.

8029.6k](/packages/skillshare-formatphp)

PHPackages © 2026

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