<p>Solved the problem, so answering for anyone else who has the same error.</p>

<p>The error was due to having a blank translation file in <code>/craft/translations/de.php</code>.</p>

<p>Once I populated that (or removed it), it was all fine.</p>

CC BY-SA 3.0
2017-09-08T12:15:04.777Z
cheers, had a similar issue, this solved it.
erwinheiser
CC BY-SA 3.0
2015-05-15T11:08:48.327Z
2015-05-15T11:08:48.327Z
Martin
<p>I am trying to set the locale in the index.php file using<br>
<code>define("CRAFT_LOCALE", "de");</code></p>

<p>But it is causing an error:<br>
array_merge(): Argument #2 is not an array</p>

<p>If i take the define out, then the site works fine, except in the default locale.</p>

<p>Any help would be awesome.</p>

<p>UPDATE:</p>

<pre><code>#0  
 unknown(0): CApplication-&gt;handleError(2, "array_merge(): Argument #2 is not an array", "/Applications/MAMP/htdocs/craft/app/etc/i18n/PhpMessageSource.ph...", 70, ...)
#1  
+  /Applications/MAMP/htdocs/craft/app/etc/i18n/PhpMessageSource.php(70): array_merge(array("A PHP extension stopped the file upload." =&gt; "Der Datei-Upload wurde von einer PHP-Erweiterung angehalten.", "CSecurityManager::generateRandomString() cannot generate random string in the current environment." =&gt; "CSecurityManager::generateRandomString() ist auf diesem System n...", "Only SHA1 and MD5 hashing algorithms are supported when using PHP 5.1.1 or below." =&gt; "PHP 5.1.1 oder kleiner unterstützt nur die Hashing-Algorithmen ...", "Script HTML options are not allowed for "CClientScript::POS_LOAD" and "CClientScript::POS_READY"." =&gt; "Für "CClientScript::POS_LOAD" and "CClientScript::POS_READY" is...", ...), 1)
#2  
+  /Applications/MAMP/htdocs/craft/app/framework/i18n/CMessageSource.php(103): Craft\PhpMessageSource-&gt;loadMessages("yii", "de")
#3  
+  /Applications/MAMP/htdocs/craft/app/framework/i18n/CMessageSource.php(85): CMessageSource-&gt;translateMessage("yii", "Property "{class}.{property}" is not defined.", "de")
#4  
+  /Applications/MAMP/htdocs/craft/app/framework/YiiBase.php(585): CMessageSource-&gt;translate("yii", "Property "{class}.{property}" is not defined.", null)
#5  
+  /Applications/MAMP/htdocs/craft/app/framework/base/CComponent.php(131): YiiBase::t("yii", "Property "{class}.{property}" is not defined.", array("{class}" =&gt; "Craft\EntryModel", "{property}" =&gt; "bannerHeading"))
#6  
+  /Applications/MAMP/htdocs/craft/app/models/BaseModel.php(87): CComponent-&gt;__get("bannerHeading")
#7  
+  /Applications/MAMP/htdocs/craft/app/models/BaseElementModel.php(136): Craft\BaseModel-&gt;__get("bannerHeading")
#8  
+  /Applications/MAMP/htdocs/craft/app/framework/base/CModel.php(596): Craft\BaseElementModel-&gt;__get("bannerHeading")
#9  
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(365): CModel-&gt;offsetGet("bannerHeading")
#10 
+  /Applications/MAMP/htdocs/craft/app/etc/templating/BaseTemplate.php(41): Twig_Template-&gt;getAttribute(Craft\EntryModel, "bannerHeading", array(), "any", ...)
#11 
+  /Applications/MAMP/htdocs/craft/storage/runtime/compiled_templates/1b/87/50f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5.php(34): Craft\BaseTemplate-&gt;getAttribute(Craft\EntryModel, "bannerHeading", array())
#12 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(144): __TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5-&gt;block_content(array("entry" =&gt; Craft\EntryModel, "craft" =&gt; Craft\CraftVariable, "blx" =&gt; Craft\CraftVariable, "now" =&gt; Craft\DateTime, ...), array("content" =&gt; array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#13 
+  /Applications/MAMP/htdocs/craft/storage/runtime/compiled_templates/e2/48/edc3e9732159262e50359543af294ec04d2fbb2fecd5c02c3c6070bad1a9.php(115): Twig_Template-&gt;displayBlock("content", array("entry" =&gt; Craft\EntryModel, "craft" =&gt; Craft\CraftVariable, "blx" =&gt; Craft\CraftVariable, "now" =&gt; Craft\DateTime, ...), array("content" =&gt; array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#14 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(279): __TwigTemplate_e248edc3e9732159262e50359543af294ec04d2fbb2fecd5c02c3c6070bad1a9-&gt;doDisplay(array("entry" =&gt; Craft\EntryModel, "craft" =&gt; Craft\CraftVariable, "blx" =&gt; Craft\CraftVariable, "now" =&gt; Craft\DateTime, ...), array("content" =&gt; array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#15 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(253): Twig_Template-&gt;displayWithErrorHandling(array("entry" =&gt; Craft\EntryModel, "craft" =&gt; Craft\CraftVariable, "blx" =&gt; Craft\CraftVariable, "now" =&gt; Craft\DateTime, ...), array("content" =&gt; array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#16 
+  /Applications/MAMP/htdocs/craft/storage/runtime/compiled_templates/1b/87/50f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5.php(26): Twig_Template-&gt;display(array("entry" =&gt; Craft\EntryModel, "craft" =&gt; Craft\CraftVariable, "blx" =&gt; Craft\CraftVariable, "now" =&gt; Craft\DateTime, ...), array("content" =&gt; array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#17 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(279): __TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5-&gt;doDisplay(array("entry" =&gt; Craft\EntryModel, "craft" =&gt; Craft\CraftVariable, "blx" =&gt; Craft\CraftVariable, "now" =&gt; Craft\DateTime, ...), array("content" =&gt; array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#18 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(253): Twig_Template-&gt;displayWithErrorHandling(array("entry" =&gt; Craft\EntryModel, "craft" =&gt; Craft\CraftVariable, "blx" =&gt; Craft\CraftVariable, "now" =&gt; Craft\DateTime, ...), array("content" =&gt; array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#19 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(264): Twig_Template-&gt;display(array("entry" =&gt; Craft\EntryModel))
#20 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Template-&gt;render(array("entry" =&gt; Craft\EntryModel))
#21 
+  /Applications/MAMP/htdocs/craft/app/services/TemplatesService.php(220): Twig_Environment-&gt;render("_pages/home", array("entry" =&gt; Craft\EntryModel))
#22 
+  /Applications/MAMP/htdocs/craft/app/controllers/BaseController.php(74): Craft\TemplatesService-&gt;render("_pages/home", array("entry" =&gt; Craft\EntryModel))
#23 
+  /Applications/MAMP/htdocs/craft/app/controllers/TemplatesController.php(55): Craft\BaseController-&gt;renderTemplate("_pages/home", array("entry" =&gt; Craft\EntryModel))
#24 
 unknown(0): Craft\TemplatesController-&gt;actionRender("_pages/home", array("entry" =&gt; Craft\EntryModel))
#25 
+  /Applications/MAMP/htdocs/craft/app/framework/web/actions/CAction.php(108): ReflectionMethod-&gt;invokeArgs(Craft\TemplatesController, array("_pages/home", array("entry" =&gt; Craft\EntryModel)))
#26 
+  /Applications/MAMP/htdocs/craft/app/framework/web/actions/CInlineAction.php(47): CAction-&gt;runWithParamsInternal(Craft\TemplatesController, ReflectionMethod, array("variables" =&gt; array("entry" =&gt; Craft\EntryModel), "template" =&gt; "_pages/home"))
#27 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CController.php(308): CInlineAction-&gt;runWithParams(array("variables" =&gt; array("entry" =&gt; Craft\EntryModel), "template" =&gt; "_pages/home"))
#28 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CController.php(286): CController-&gt;runAction(CInlineAction)
#29 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CController.php(265): CController-&gt;runActionWithFilters(CInlineAction, array())
#30 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CWebApplication.php(282): CController-&gt;run("render")
#31 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CWebApplication.php(141): CWebApplication-&gt;runController("templates/render")
#32 
+  /Applications/MAMP/htdocs/craft/app/etc/web/WebApp.php(266): CWebApplication-&gt;processRequest()
#33 
+  /Applications/MAMP/htdocs/craft/app/framework/base/CApplication.php(180): Craft\WebApp-&gt;processRequest()
#34 
+  /Applications/MAMP/htdocs/craft/app/index.php(62): CApplication-&gt;run()
#35 
+  /Applications/MAMP/htdocs/public/de/index.php(22): require_once("/Applications/MAMP/htdocs/craft/app/index.php")
</code></pre>

CC BY-SA 3.0
2015-05-14T17:05:41.830Z
If you enable devMode, does it show a stack trace leading up to the error? If so, can you share it in your original question?
Brad Bell
CC BY-SA 3.0
2015-05-14T17:09:48.780Z
added the stack trace, i may removed it or format it later.
Martin
CC BY-SA 3.0
2015-05-14T17:12:30.097Z
Try setting the define in your public html's `index.php` file instead of  `config/general.php`.
Brad Bell
CC BY-SA 3.0
2015-05-15T08:10:04.533Z
Sorry I was doing it in the index.php file (it had been a long day :p). Updated the question to reflect this
Martin
CC BY-SA 3.0
2015-05-15T08:33:54.420Z
You're not running PHP 5.3 or newer, right? http://buildwithcraft.com/docs/requirements
carlcs
CC BY-SA 3.0
2015-05-15T08:39:42.473Z
running version 5.6.2, according to phpinfo()
Martin
<localization>
define CRAFT_LOCALE causing error
# define CRAFT_LOCALE causing error

(Asked by: username_0 on 2015-05-14)

I am trying to set the locale in the index.php file using
define("CRAFT_LOCALE", "de");
But it is causing an error:
array_merge(): Argument #2 is not an array
If i take the define out, then the site works fine, except in the default locale.
Any help would be awesome.
UPDATE:
#0  
 unknown(0): CApplication->handleError(2, "array_merge(): Argument #2 is not an array", "/Applications/MAMP/htdocs/craft/app/etc/i18n/PhpMessageSource.ph...", 70, ...)
#1  
+  /Applications/MAMP/htdocs/craft/app/etc/i18n/PhpMessageSource.php(70): array_merge(array("A PHP extension stopped the file upload." => "Der Datei-Upload wurde von einer PHP-Erweiterung angehalten.", "CSecurityManager::generateRandomString() cannot generate random string in the current environment." => "CSecurityManager::generateRandomString() ist auf diesem System n...", "Only SHA1 and MD5 hashing algorithms are supported when using PHP 5.1.1 or below." => "PHP 5.1.1 oder kleiner unterstützt nur die Hashing-Algorithmen ...", "Script HTML options are not allowed for "CClientScript::POS_LOAD" and "CClientScript::POS_READY"." => "Für "CClientScript::POS_LOAD" and "CClientScript::POS_READY" is...", ...), 1)
#2  
+  /Applications/MAMP/htdocs/craft/app/framework/i18n/CMessageSource.php(103): Craft\PhpMessageSource->loadMessages("yii", "de")
#3  
+  /Applications/MAMP/htdocs/craft/app/framework/i18n/CMessageSource.php(85): CMessageSource->translateMessage("yii", "Property "{class}.{property}" is not defined.", "de")
#4  
+  /Applications/MAMP/htdocs/craft/app/framework/YiiBase.php(585): CMessageSource->translate("yii", "Property "{class}.{property}" is not defined.", null)
#5  
+  /Applications/MAMP/htdocs/craft/app/framework/base/CComponent.php(131): YiiBase::t("yii", "Property "{class}.{property}" is not defined.", array("{class}" => "Craft\EntryModel", "{property}" => "bannerHeading"))
#6  
+  /Applications/MAMP/htdocs/craft/app/models/BaseModel.php(87): CComponent->__get("bannerHeading")
#7  
+  /Applications/MAMP/htdocs/craft/app/models/BaseElementModel.php(136): Craft\BaseModel->__get("bannerHeading")
#8  
+  /Applications/MAMP/htdocs/craft/app/framework/base/CModel.php(596): Craft\BaseElementModel->__get("bannerHeading")
#9  
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(365): CModel->offsetGet("bannerHeading")
#10 
+  /Applications/MAMP/htdocs/craft/app/etc/templating/BaseTemplate.php(41): Twig_Template->getAttribute(Craft\EntryModel, "bannerHeading", array(), "any", ...)
#11 
+  /Applications/MAMP/htdocs/craft/storage/runtime/compiled_templates/1b/87/50f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5.php(34): Craft\BaseTemplate->getAttribute(Craft\EntryModel, "bannerHeading", array())
#12 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(144): __TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5->block_content(array("entry" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array("content" => array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#13 
+  /Applications/MAMP/htdocs/craft/storage/runtime/compiled_templates/e2/48/edc3e9732159262e50359543af294ec04d2fbb2fecd5c02c3c6070bad1a9.php(115): Twig_Template->displayBlock("content", array("entry" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array("content" => array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#14 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(279): __TwigTemplate_e248edc3e9732159262e50359543af294ec04d2fbb2fecd5c02c3c6070bad1a9->doDisplay(array("entry" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array("content" => array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#15 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(253): Twig_Template->displayWithErrorHandling(array("entry" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array("content" => array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#16 
+  /Applications/MAMP/htdocs/craft/storage/runtime/compiled_templates/1b/87/50f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5.php(26): Twig_Template->display(array("entry" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array("content" => array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#17 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(279): __TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5->doDisplay(array("entry" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array("content" => array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#18 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(253): Twig_Template->displayWithErrorHandling(array("entry" => Craft\EntryModel, "craft" => Craft\CraftVariable, "blx" => Craft\CraftVariable, "now" => Craft\DateTime, ...), array("content" => array(__TwigTemplate_1b8750f950fbf3fbcf1358ed32a1bf140e55bf6f0b6c9f33524bc9cffb0ce2e5, "block_content")))
#19 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Template.php(264): Twig_Template->display(array("entry" => Craft\EntryModel))
#20 
+  /Applications/MAMP/htdocs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Template->render(array("entry" => Craft\EntryModel))
#21 
+  /Applications/MAMP/htdocs/craft/app/services/TemplatesService.php(220): Twig_Environment->render("_pages/home", array("entry" => Craft\EntryModel))
#22 
+  /Applications/MAMP/htdocs/craft/app/controllers/BaseController.php(74): Craft\TemplatesService->render("_pages/home", array("entry" => Craft\EntryModel))
#23 
+  /Applications/MAMP/htdocs/craft/app/controllers/TemplatesController.php(55): Craft\BaseController->renderTemplate("_pages/home", array("entry" => Craft\EntryModel))
#24 
 unknown(0): Craft\TemplatesController->actionRender("_pages/home", array("entry" => Craft\EntryModel))
#25 
+  /Applications/MAMP/htdocs/craft/app/framework/web/actions/CAction.php(108): ReflectionMethod->invokeArgs(Craft\TemplatesController, array("_pages/home", array("entry" => Craft\EntryModel)))
#26 
+  /Applications/MAMP/htdocs/craft/app/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(Craft\TemplatesController, ReflectionMethod, array("variables" => array("entry" => Craft\EntryModel), "template" => "_pages/home"))
#27 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(array("variables" => array("entry" => Craft\EntryModel), "template" => "_pages/home"))
#28 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CController.php(286): CController->runAction(CInlineAction)
#29 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#30 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CWebApplication.php(282): CController->run("render")
#31 
+  /Applications/MAMP/htdocs/craft/app/framework/web/CWebApplication.php(141): CWebApplication->runController("templates/render")
#32 
+  /Applications/MAMP/htdocs/craft/app/etc/web/WebApp.php(266): CWebApplication->processRequest()
#33 
+  /Applications/MAMP/htdocs/craft/app/framework/base/CApplication.php(180): Craft\WebApp->processRequest()
#34 
+  /Applications/MAMP/htdocs/craft/app/index.php(62): CApplication->run()
#35 
+  /Applications/MAMP/htdocs/public/de/index.php(22): require_once("/Applications/MAMP/htdocs/craft/app/index.php")

**Tags:** localization
> **Comments:**
> **username_1**: If you enable devMode, does it show a stack trace leading up to the error? If so, can you share it in your original question?  
> **username_0**: added the stack trace, i may removed it or format it later.  
> **username_1**: Try setting the define in your public html's `index.php` file instead of  `config/general.php`.  
> **username_0**: Sorry I was doing it in the index.php file (it had been a long day :p). Updated the question to reflect this  
> **username_2**: You're not running PHP 5.3 or newer, right? http://buildwithcraft.com/docs/requirements  
> **username_0**: running version 5.6.2, according to phpinfo()  

---

## 1 answers

### Answer by username_0 on 2015-05-15. Score: 4 | Accepted answer

Solved the problem, so answering for anyone else who has the same error.

The error was due to having a blank translation file in `/craft/translations/de.php`.

Once I populated that (or removed it), it was all fine.

> **Comments:**
> **username_3**: cheers, had a similar issue, this solved it.  

---

