# Extract validation messages

**URL:** <https://discourse.cakephp.org/t/extract-validation-messages/5166>\
**Category:** Need Help\
**Tags:** i18n\
**Created:** [October 26, 2018, 8:59am UTC](https://discourse.cakephp.org/t/extract-validation-messages/5166 "2018-10-26T08:59:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvaro](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/alvaro/32/70_2.png) [@alvaro](https://discourse.cakephp.org/u/alvaro)\
**Post date:** [October 26, 2018, 8:59am UTC](https://discourse.cakephp.org/t/extract-validation-messages/5166/1 "2018-10-26T08:59:36Z")

</div>

Docs for [Internationalization & Localization](https://book.cakephp.org/2.0/en/core-libraries/internationalization-and-localization.html#translating-model-validation-errors) in CakePHP/2.x clearly state that strings in `'message'` keys should get extracted by `cake i18n extract` in the default domain but it isn’t my case.

I’ve confirmed that they’re being processed through `__d()` but, since they aren’t in the catalogue, there’s no way to get actual translations.

I’m currently using CakePHP/2.7.11 (with a chance to eventually upgrade to 2.10 if necessary) and issuing this command:

```
Console\cake i18n extract --paths . --output Locale --merge no --overwrite --extract-core yes --exclude files,Test,tmp,Vendor,Plugin\Uploader,src\Lib\Some\Other\Stuff.php

```

I’ve also tried setting `public $validationDomain = 'validation';` in `AppModel` and `--validation-domain validation` in my shell but I don’t even get a `validation.pot` file.

What am I doing wrong?

* * *

**Update #1:** I’ve realised that I does work if I run the script in interactive mode and accept the default path (a full absolute path). Apparently, it only extracts validation messages for absolute paths and absolute paths only work in interactive mode :-?

**Update #2:** Just discovered that absolute paths work in interactive mode if they have duplicate trailing backslashes, as in:

```
--path "C:\Projects\Project Name\src\\"
```
