PHPackages                             wubinworks/module-translation - 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. wubinworks/module-translation

ActiveMagento2-module[Localization &amp; i18n](/categories/localization)

wubinworks/module-translation
=============================

This module \[1\] Adds translation data from \[module or theme root\]/i18n/Js/\[locale\].csv to frontend translation dictionary. \[2\] Enables Module to override Theme, Language Pack and DB translations by creating CSV file in specific location inside the Module.

1.0.2(2y ago)083OSL-3.0PHPPHP &gt;=7.3

Since Sep 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/wubinworks/magento2-module-translation)[ Packagist](https://packagist.org/packages/wubinworks/module-translation)[ RSS](/packages/wubinworks-module-translation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (6)Used By (0)

Story
=====

[](#story)

*(Everything talked here is for `Magento 2.4`. See **Requirements Section**.)*

This module, which provides 2 features, is designed as a dependency for making other modules/themes.

1. During deployment, Magento scans static `.js` and `.html` files and picks up translatable strings from them.
    Then Magento generates a `js-traslation.json` file.
    This file is a dictionary file used for frontend translation,
    For example: `\`
    Unfortunately, translatable strings in `.phtml(and .php)` files are not picked up by Magento(for some reasons).
    If `$.mage.__('Some Text')` is in `.phtml` files, it won't be translated.
    This module can force extra data from a separate file(i.e., \[module or theme root\]/i18n/**Js**/\[locale\].csv) to go to `js-traslation.json`.
2. Magento loads translation data in the order below:

```
 |  Module translation: [module root]/i18n/[locale].csv
 |  Language Pack translation
 |  Theme translation: [theme root]/i18n/[locale].csv
\|/ Database translation

```

Then these translation data are merged and the merge rule is **"LAST ONE WINS"**, which means Database translation overrides everything else.
However, In some cases, especially when doing local development to translate very general phrases in specific business field, the Module creator wants to override Language Pack and Theme translations without modifying those third party packages.
This module adds extra locations for translation files(CSV), so the loading order becomes:

> | Module translation: \[module root\]/i18n/\[locale\].csv
>
>  | Language Pack translation
>
>  | Theme translation: \[theme root\]/i18n/\[locale\].csv
>
>  | Database translation
>
>  | Extra Module translation: \[module root\]/i18n/**i18n**/\[locale\].csv
>
> \\|/ Extra Theme translation: \[theme root\]/i18n/**i18n**/\[locale\].csv(last-one-wins)

This module works under *Store Emulation*, too.

Usage and Example
=================

[](#usage-and-example)

**1. Append(merge) translation into `js-traslation.json`:**
Create `/i18n/Js/.csv` like a normal translation CSV file, then its content will go to `js-traslation.json`(even the phrase cannot be found as a translatable string in static files).

**2. Override Language Pack or Theme translations:**
Create \[module or theme root\]/i18n/**i18n**/\[locale\].csv like a normal translation CSV file, then it will work.

*Check examples of this module inside the i18n folder.*

`i18n/ja_JP.csv`

```
"###Translate Me!###","翻訳して！"

```

`i18n/i18n/ja_JP.csv`

```
"###Translate Me!###","翻訳してください！(Override)"

```

`i18n/Js/ja_JP.csv`

```
"###This phrase will go to js-translation.json anyway.###","このフレーズは必ずjs-translation.jsonに出現する。"
"###This phrase will be overridden.###","このフレーズはオーバーライドされる"

```

`i18n/i18n/Js/ja_JP.csv`

```
"###This phrase will be overridden.###","このフレーズをオーバーライドした"

```

Output:

```
###Translate Me!### -> 翻訳してください！(Override)

```

Output in `js-translation.json`:

```
###This phrase will go to js-translation.json anyway.### -> このフレーズは必ずjs-translation.jsonに出現する。
###This phrase will be overridden.### -> このフレーズをオーバーライドした

```

Requirements
============

[](#requirements)

**Magento 2.4**

Installation
============

[](#installation)

**`composer require wubinworks/module-translation`**

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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 ~30 days

Total

3

Last Release

906d ago

### Community

Maintainers

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

---

Top Contributors

[![wubinworks](https://avatars.githubusercontent.com/u/127310257?v=4)](https://github.com/wubinworks "wubinworks (5 commits)")

---

Tags

japaneselanguage-packlocalizationmagento2magento2-modulethemetranslation

### Embed Badge

![Health badge](/badges/wubinworks-module-translation/health.svg)

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

###  Alternatives

[splendidinternet/mage2-locale-de-de

German (Germany) language

861.0M2](/packages/splendidinternet-mage2-locale-de-de)[mage-os/module-automatic-translation

Automatic AI content translation for Mage-OS.

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

PHPackages © 2026

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