PHPackages                             hendriarga/blade-localizer - 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. hendriarga/blade-localizer

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

hendriarga/blade-localizer
==========================

Auto-scan and localize Laravel Blade UI text into language files

00PHP

Since Jun 21Pushed 1y agoCompare

[ Source](https://github.com/KangHen/blade-localizer)[ Packagist](https://packagist.org/packages/hendriarga/blade-localizer)[ RSS](/packages/hendriarga-blade-localizer/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Blade Localizer
===============

[](#blade-localizer)

**Blade Localizer** is a Laravel package that scans your Blade `.blade.php` files, extracts UI strings, and adds them to your `lang/{locale}/ui.php` or `ui.json` translation files. It also supports auto-replacing static text with the `__()` helper and translating them using the Google Translate API.

---

✨ Features
----------

[](#-features)

- 🔍 Scan HTML tags like `div`, `span`, `label`, `a`, `button`, `p`, and even custom components like ``
- 🪄 Auto-replace static text with `{{ __('...') }}`
- 🌐 Generate `lang/{locale}/ui.php` and `ui.json` files
- 🌍 Automatic translation support via Google Translate API
- 🧩 Detect translatable attributes like `placeholder`, `title`, `aria-label`, etc.
- 🚫 Optionally skip already-translated strings using `__('...')`
- ♻️ Avoids duplicate keys and appends new ones instead of overwriting
- 🧠 Caches translation results for performance

---

🚀 Installation
--------------

[](#-installation)

```
composer require hendriarga/blade-localizer
```

---

📖 Usage
-------

[](#-usage)

### 1. Publish the config file

[](#1-publish-the-config-file)

```
php artisan vendor:publish --tag=blade-localizer
```

### 4. Run the `blade:localize` Artisan command

[](#4-run-the-bladelocalize-artisan-command)

```
php artisan localize:blade
```

This command will scan your Blade files, extract UI strings, and add them to your `lang/{locale}/ui.php` or `ui.json` files. It will also automatically replace static text with the `__()` helper and translate them using the Google Translate API.

---

📝 Configuration
---------------

[](#-configuration)

You can customize the behavior of the package by editing the `config/blade-localizer.php` file.

OptionDescriptionDefault`locales`An array of locales to generate language files for.`['en']``views`An array of folders to scan for Blade files.`['resources/views']``filename`The name of the language file.`ui.php``skip_keywords`An array of keywords to skip when extracting UI strings.`[]``path`The path to the language file. Set to `false` to generate a new file.`false`---

📝 License
---------

[](#-license)

The package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). Feel free to use, modify, and distribute this package as long as you follow the license terms.

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dd23a563c75a7ce19687472a6b624f2ad2edec6b110937ec829acab8de7a0ba?d=identicon)[hendriarga28](/maintainers/hendriarga28)

---

Top Contributors

[![KangHen](https://avatars.githubusercontent.com/u/14846447?v=4)](https://github.com/KangHen "KangHen (1 commits)")

### Embed Badge

![Health badge](/badges/hendriarga-blade-localizer/health.svg)

```
[![Health](https://phpackages.com/badges/hendriarga-blade-localizer/health.svg)](https://phpackages.com/packages/hendriarga-blade-localizer)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1927.0k1](/packages/smmoosavi-php-gettext)

PHPackages © 2026

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