# Radicle v2.2.0 string translations in directory "./app" not written in ./resources/lang/radicle.pot

**URL:** https://discourse.roots.io/t/radicle-v2-2-0-string-translations-in-directory-app-not-written-in-resources-lang-radicle-pot/30058
**Category:** radicle
**Tags:** localization, wp-cli
**Created:** 2025-11-26T08:57:57Z
**Posts:** 5

## Post 1 by @Stackie — 2025-11-26T08:57:57Z

Hi Roots,

I noticed any string translations used for i18n localization are not working in the `./app` directory. All other `--include="app,config,resources,public/dist/js"` inside the `./package.json` are working and are written inside the `./resources/lang/radicle.pot`.

**Directory app**

It seems the `wp i18n make-pot` can’t scan the `./app` directory since none of the string translations like `__(‘My example string‘, 'radicle');` are saved in the `radicle.pot`.

**Usages in x-components**

I also found the string translations won’t be saved to the `radicle.pot` when you pass a string translation as prop attribute to the `Component`.

```
// .resources/views/partials/content-none.blade.php

<x-no-results
    :title="__('My title is not written inside the radicle.pot file.', 'radicle')"
    :text="__('The content-none.blade.php gets scanned but these component constructor prop attributes are not inside the radicle.pot file.', 'radicle')"
/>

<p>{{ __('This a string translation I can translate.', 'radicle') }}</p>
```

I assume it’s because the `Component` runs inside the `./app` directory at `./app/View/Components/NoResult.php`.

```
<?php

namespace App\View\Components;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class NoResults extends Component
{
    /**
     * Create a new component instance.
     */
    public function __construct(
        public ?string $title = null,
        public ?string $subtitle = null,
    ) {
        //
    }

    /**
     * Get the view / contents that represent the component.
     */
    public function render(): View|Closure|string
    {
        return view('components.no-results');
    }
}
```

Even though the `x-no-results` is inside `.resources/` the string translations won’t get recognized once they are inside the x-component prop. So the localization is not working in `./app` & x-component props. Do you have any suggestions on how to resolve these issues?

Looking forward to your insights.

Best regards,  
Lex

---

## Post 2 by @Stackie — 2026-02-04T08:21:01Z

Hi Roots,

I was wondering if you know the reason why these string translations as described are not coming in the radicle.pot?

Looking forward to your insights or fix.

Best regards,  
Lex

---

## Post 3 by @ben — 2026-02-05T16:24:50Z

Sorry for the late response! Can you try this?

```
"scripts": {
    "build": "vite build",
    "dev": "vite",
    "translate": "npm run translate:pot && npm run translate:update",
    "translate:pot": "wp i18n make-pot app ./resources/lang/radicle.pot --domain=radicle --ignore-domain && wp i18n make-pot resources ./resources/lang/radicle.pot --domain=radicle --ignore-domain --merge=./resources/lang/radicle.pot && wp i18n make-pot config ./resources/lang/radicle.pot --domain=radicle --ignore-domain --merge=./resources/lang/radicle.pot",
    "translate:update": "for file in ./resources/lang/*.po; do wp i18n update-po ./resources/lang/radicle.pot $file; done",
    "translate:compile": "npm run translate:mo && npm run translate:js",
    "translate:js": "wp i18n make-json ./resources/lang --pretty-print",
    "translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
  },
```

The `--include` flag doesn’t work correctly when the source is `.` in Radicle’s project structure

This workaround runs make-pot on each directory separately and merges them

Regarding component prop attributes like `:title="__('...', 'radicle')"` , that’s a separate parser limitation

The workaround is to extract translations to variables:

```
@php
    $title = __('My title', 'radicle');
@endphp

<x-no-results :title="$title" />
```

---

## Post 4 by @Stackie — 2026-02-13T09:18:08Z

Hi Ben,

Thank you for the response. I have tested your changes on the “translate:pot” but unfortunately without success. The translatable strings that are put directly into the x-component props are not showing up in the pot file.

```
@php(__('Success: I can translate this standalone string.', 'radicle'))
<x-alert type="warning" class="my-6" :message="__('Failed: I can\'t translate this string directly in a component prop!', 'radicle')">
    {{ __('Success: I can translate this $slot.', 'radicle') }}
</x-alert>
```

I like to see we came up with the same workaround :slight_smile:. For now we stick to this workaround. Is this something you will implement as fix later or is it currently not on your patch list?

Best regards,  
Lex

---

## Post 5 by @ben — 2026-02-13T18:59:02Z

Submitted an upstream PR here:

> <https://github.com/wp-cli/i18n-command/pull/474>
>
> Fixes an issue where translation functions passed as bound props on Blade compon…ents aren't picked up by `make-pot`.
> 
> Given a template like:
> 
> ```blade
> <x-alert :message="__('Page not found.', 'my-theme')" />
> 
> <x-no-results
> :title="__('Nothing here', 'my-theme')"
> :subtitle="esc_html__('Try searching instead', 'my-theme')"
> />
> ```
> 
> None of these strings end up in the `.pot` file. The workaround is to pull them into variables first, which is clunky:
> 
> ```blade
> @php($message = __('Page not found.', 'my-theme'))
> <x-alert :message="$message" />
> ```
