2
# head -n2 src/Locale/de/default.po
msgid  "route_shop"
msgstr "shop"

In my controller, I just have exit(__('route_shop')); but it is returning route_shop.

ini_get('intl.default_locale'); // returns de (as set in config/bootstrap.php)

'locales' => [APP . 'Locale' . DS] // paths setting in config/app.php

Apache/PHP have permissions to the default.po file. Can't really see anything else that would be wrong.

Does anyone have any suggestions?

Have tried different translations, locales, full locale name (de_DE for the folder name/intl.default_locale setting). No errors reported, nothing in debug.log

DIDoS
  • 812
  • 9
  • 23
Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95

1 Answers1

3

I guess the problem is in the number of spaces between msgid and the string.

I don't find any reference but it does not work if there are more than one white space

remove the extra space and remember clearing the cache

arilia
  • 9,373
  • 2
  • 20
  • 44
  • I don't think that it's part of of official [**GNU specs**](http://www.gnu.org/software/gettext/manual/gettext.html) or something, CakePHP most probably requires that strict format for performance reasons, [**`substr` is usually faster**](https://github.com/cakephp/cakephp/blob/3.1.6/src/I18n/Parser/PoFileParser.php#L91-L94) than a regex or the like. – ndm Jan 05 '16 at 16:45