PHPackages                             ntriga/pimcore-vue-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ntriga/pimcore-vue-translations

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ntriga/pimcore-vue-translations
===============================

Package to streamline vue translations with Pimcore

1.1.0(2mo ago)127GPL-3.0-or-laterPHPPHP ^8.1CI failing

Since Feb 24Pushed 2mo agoCompare

[ Source](https://github.com/ntriga/pimcore-vue-translations)[ Packagist](https://packagist.org/packages/ntriga/pimcore-vue-translations)[ Docs](https://github.com/ntriga/pimcore-vue-translations)[ RSS](/packages/ntriga-pimcore-vue-translations/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

pimcore-vue-translations
========================

[](#pimcore-vue-translations)

Simple package to integrate Vue translations into Pimcore.

Dependencies
------------

[](#dependencies)

ReleaseSupported Pimcore VersionsSupported Symfony VersionsBranch**1.x**`11.0``6.2`mainInstallation
------------

[](#installation)

You can install the package via composer:

```
composer require ntriga/pimcore-vue-translations
```

Add Bundle to `bundles.php`:

```
return [
    Ntriga\PimcoreVueTranslations\PimcoreVueTranslationsBundle::class => ['all' => true],
];
```

Usage
-----

[](#usage)

### Getting the translations

[](#getting-the-translations)

Inject translations into your Twig template to preload them for your Vue app. The package provides the `pimcore_translations` twig function that fetches the translation messages for a given language. When Pimcore shared translation fallbacks are configured, the package resolves that fallback chain and merges missing values into the requested locale before returning the payload. For example, in your layout template add:

```
>

    Your App
    {# Other head elements #}

      // Preload the translations and current locale.
      window.__TRANSLATIONS__ = {{ pimcore_translations(app.locale)|json_encode()|raw }};
      window.__LOCALE__ = '{{ app.locale }}';

```

### Vue

[](#vue)

Configure your Vue i18n (or other vue translation package) instance with the preloaded translations. For example:

```
import axios from 'axios';
import { createI18n } from 'vue-i18n';

// Use the translations and locale injected by Twig.
const messages = window.__TRANSLATIONS__ || { en: {} };
const locale = window.__LOCALE__ || 'en';

const i18n = createI18n({
    locale,
    fallbackLocale: 'en',
    messages,
});

export default i18n;
```

If your Pimcore system config contains a fallback like `en_GB: en_BE`, calling `pimcore_translations('en_GB')` will return an `en_GB` catalogue that already contains `en_BE` values for keys that are empty in `en_GB`.

### Registering missing translation keys

[](#registering-missing-translation-keys)

The package provides an endpoint where you can send a single, or multiple translatation keys to to register them in the Pimcore shared translations.

To make the route available in your application, add the following in `config/routes/vue-translations.yaml`:

```
pimcore_vue_translations:
    resource: '@PimcoreVueTranslationsBundle/Controller/'
    type: attribute
    prefix: /translations-api
```

After that is done, integrate a missing key handler. Example with i18n:

```
import { createI18n } from "vue-i18n";
import axios from "axios";
import { debounce } from "lodash";

const messages = window.__TRANSLATIONS__ || { en: {} };
const currentLocale = window.__LOCALE__ || "en";

const missingKeys = new Set();
const reportedKeys = new Set();

const sendMissingKeys = debounce(() => {
    if (missingKeys.size > 0) {
        const keys = Array.from(missingKeys);
        axios
            .post("/translations-api/register-missing-translations", {
                keys,
                locale: currentLocale, // Consider using the actual current locale if it can change dynamically
            })
            .catch((error) =>
                console.error("Error registering missing keys:", error)
            );
        missingKeys.clear();
    }
}, 1000);

const handleMissingTranslation = (locale, key) => {
    if (!reportedKeys.has(key)) {
        console.warn(
            `Missing translation key: "${key}" for locale "${locale}"`
        );
        reportedKeys.add(key);
        missingKeys.add(key);
        sendMissingKeys();
    }
    // Fallback: return the key itself if no translation is found
    return key;
};

const i18n = createI18n({
    legacy: false,
    locale: currentLocale,
    fallbackLocale: "en",
    messages,
    missing: handleMissingTranslation,
});

export function setLocale(locale) {
    i18n.global.locale = locale;
}

export default i18n;
```

New translation keys are registered for all configured Pimcore valid languages, so the shared translation row is ready to be filled in from the admin UI.

Changelog
---------

[](#changelog)

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

Credits
-------

[](#credits)

- [All contributors](../../contributors)

License
-------

[](#license)

GNU General Public License version 3 (GPLv3). Please see [License File](./LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance85

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~417 days

Total

2

Last Release

78d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e4ae15c618659f43e69165769eb5cc1cf79c48dabe0f7c7afe672953a071f10?d=identicon)[JoeyNtriga](/maintainers/JoeyNtriga)

---

Top Contributors

[![JoeyDaems](https://avatars.githubusercontent.com/u/130968595?v=4)](https://github.com/JoeyDaems "JoeyDaems (7 commits)")

---

Tags

translationspimcorevuentriga

### Embed Badge

![Health badge](/badges/ntriga-pimcore-vue-translations/health.svg)

```
[![Health](https://phpackages.com/badges/ntriga-pimcore-vue-translations/health.svg)](https://phpackages.com/packages/ntriga-pimcore-vue-translations)
```

PHPackages © 2026

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