# Localization of Blade templates

**URL:** https://discourse.roots.io/t/localization-of-blade-templates/9331
**Category:** sage
**Tags:** sage9
**Created:** 2017-04-07T15:43:56Z
**Posts:** 19
**Showing post:** 6 of 19

## Post 6 by @Twansparant — 2017-08-24T11:39:38Z

> [@nicooprat](#):
>
> I followed this guide but couldn’t get it to work without the workaround above though:

I managed to get it working with those instructions!

## Poedit

By default, Poedit cannot find strings to translate from Blade templates. Here is a list of parameters to add to your Poedit software preferences so it can detect translation strings from your Blade views:

1. Open Poedit
2. Go to Preferences -\> Extractors
3. Add a new Extractor with following settings:
  - Language: `Blade`
  - Extension: `*.scout.php, *.blade.php`
  - Parser command: `xgettext --language=Python --add-comments=TRANSLATORS --force-po -o %o %C %K %F`
  - An item in keyword list: `-k%k`
  - An item in input files list: `%f`
  - Source code charset: `--from-code=%c`

4. Click Ok

In order for this to work, you must have a poedit project correctly setup pointing to the `languages` folder of either your theme or custom plugin and define the gettext methods and resources base path. From the catalog preferences, set the sources paths like so:

- Base path: `sage theme folder`
- Paths:
  - `.`

- Excluded Paths:
  - `node_modules/`
  - `vendor/`
  - `resources/assets/`

as well as adding the following gettext methods to the source keywords catalog tab:

- `__`
- `_e`
- `_x`
- `esc_html__`
- `esc_html_e`
- `_n`
- `_nx`
- `_n_noop`
- `_nx_noop`
- `_ex`

and more if needed.

---

_[View the full topic](https://discourse.roots.io/t/localization-of-blade-templates/9331)._
