<p>The <a href="https://github.com/boboldehampsink/translate" rel="nofollow">Translate plugin</a> does what you need, it scans templates and plugins, and also provides an interface for translation.</p>

CC BY-SA 4.0
2018-12-21T14:39:04.243Z
unfortunately the translate plugin isn't maintained anymore.
Peter Piper
CC BY-SA 3.0
2015-08-04T09:56:28.163Z
2015-08-04T09:56:28.163Z
drifteaur
<p><strong>Update:</strong></p>

<p>For Craft 3, we use the Yii 2 Inspections plugin for PhpStorm to do this now. <a href="https://plugins.jetbrains.com/plugin/9400-yii2-inspections" rel="nofollow noreferrer">https://plugins.jetbrains.com/plugin/9400-yii2-inspections</a></p>

<p>There is a translation inspection that will let you know which strings are missing translations and which translations are no longer in use.</p>

<hr>

<p><strong>Old:</strong></p>

<p>We currently have our own command line tool that goes through all of Craft's files and extracts anything in <code>Craft::t()</code> (for PHP), and <code>|t</code> (for Twig) and <code>Craft.t()</code> for JavaScript.</p>

<p>What we would probably do is make that tool into a <code>yiic</code> command and update it to let plugins take advantage of it for their own files as well.</p>

<p>Will add it to the list.</p>

CC BY-SA 4.0
2018-12-21T14:27:22.227Z
is there a chance that you are going to share that cli with the rest of the world?
Peter Piper
CC BY-SA 4.0
2018-12-22T00:20:27.480Z
Updated answer @PeterPiper
Brad Bell
CC BY-SA 4.0
2014-07-11T22:33:19.377Z
2018-12-22T00:20:18.100Z
2018-12-22T00:20:18.100Z
Brad Bell
<p>I use Craft on multilingual site and I'm having some difficulty in getting the static messages on templates added or changed on every translation file I have.</p>

<p>Is there any way to extract those static messages changed or not already translated from templates into all translation files?</p>

<p>I'm looking for a functionality like of "yiic message" which searches for messages to be translated in the specified source files and compiles them into PHP arrays as message source.</p>

<templating><localization>
How to extract static messages from templates into translation files?
# How to extract static messages from templates into translation files?

(Asked by: username_0 on 2014-07-11)

I use Craft on multilingual site and I'm having some difficulty in getting the static messages on templates added or changed on every translation file I have.

Is there any way to extract those static messages changed or not already translated from templates into all translation files?

I'm looking for a functionality like of "yiic message" which searches for messages to be translated in the specified source files and compiles them into PHP arrays as message source.

**Tags:** templating, localization

---

## 2 answers

### Answer by username_3 on 2014-07-11. Score: 6 | Accepted answer

**Update:**

For Craft 3, we use the Yii 2 Inspections plugin for PhpStorm to do this now. <https://plugins.jetbrains.com/plugin/9400-yii2-inspections>

There is a translation inspection that will let you know which strings are missing translations and which translations are no longer in use.

---

**Old:**

We currently have our own command line tool that goes through all of Craft's files and extracts anything in `Craft::t()` (for PHP), and `|t` (for Twig) and `Craft.t()` for JavaScript.

What we would probably do is make that tool into a `yiic` command and update it to let plugins take advantage of it for their own files as well.

Will add it to the list.

> **Comments:**
> **username_2**: is there a chance that you are going to share that cli with the rest of the world?  
> **username_3**: Updated answer @PeterPiper  

---

### Answer by username_1 on 2015-08-04. Score: 3

The [Translate plugin](https://github.com/boboldehampsink/translate) does what you need, it scans templates and plugins, and also provides an interface for translation.

> **Comments:**
> **username_2**: unfortunately the translate plugin isn't maintained anymore.  

---

