Magento2: Translations are not working when executed from Crontab or Commandline

Today I faced an issue with a new project on Magento 2.3.2.

In a Cron class method the system should create a defined order, invoice it and send a special E-Mail with an PDF attached.

The problem was, that the translation were not working – even if the Store was set correctly for the Transactional-Emails.

After some research I finally found a solution that is working.

The secret is, to initiate the Area translation.
You can do this like in the following Code.

 * Execute the cron process
 * @throws \Exception
public function execute()
     * enable translations for emails
     * and also for pdfs creations
    $areaList = $this->getAreaList();

    /** cron process logic **/

The method $this->getAreaList() simply returns an instance of \Magento\Framework\App\AreaList.

After that, the translation is initiated with the load method.

This makes the translation used in between the cron process (or any other command-line execution) work again.

Magento warning after updating to 2.3.2

After updating from Magento to 2.3.2 you might as well get the following PHP error:

Warning: Use of undefined constant SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 – assumed ‘SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13’ (this will throw an Error in a future version of PHP) in /var/www/html/vendor/magento/framework/Encryption/Encryptor.php on line 153

After some quick searching on Google, the reason is found: Magento require libsodium due to some security enhancements.
Unfortunately this is not documented well.

Some checks showed that libsodium was already installed, but that installed version did not yet provide the constant which PHP is complaining about.
In my docker environment a newer version is not available out of the box, so I had to add it manually:

wget \
    && tar xfvz libsodium-1.0.18.tar.gz \
    && cd libsodium-1.0.18 \
    && ./configure \
    && make && make install \
    && pecl install -f libsodium

Now check if pecl added the sodium.ini to your PHP`s conf.d folder to enable the PHP module.

With the following command you can verify if the correct version was installed for libsodium headers + library:

php -i | grep "sodium"

The result should look like this:

sodium support => enabled
sodium compiled version => 2.0.20
libsodium headers version => 1.0.18
libsodium library version => 1.0.18

Now your Magento installation should work again!

In a nutshell: How Notify can help you to keep track of important routines of your store

You have to keep track of many processes

If you are a Magento developer, you might love automatic processes, neat synchronisations and full stack connections to ERPs, PIMs and all that stuff that your clients are using to manage their data.

Sometimes these third party system are only providing poor CSV synchronisations by manually downloading a file over a FTP connection.

Today, APIs and connections to other systems are often used and the trend shows, that the data exchange between e-commerce systems is increasing. Even small  business shops are connected to at least two or three other systems (Marketplaces like eBay/Amazon, PIM, Vendors/Merchants/Wholesales).
This may lead to many processes for syncing the data.

How do you monitor all those individual processes?

Do you write a method for email notifications? For every important step?
Problem: You may have hard coded  points in the code that trigger those emails and that are hard to control, if you want to change a email-recepient for one of them or something like this.

Do you use Mage::log?
This is great for tracing errors, but if a process stops or fails you will only know when its too late (or worst case: the buyer will know before you).

The Solution

ONE flexible and universal usable notification system, which you can use for all your processes and in any of your custom modules.

You can download the Notify module here!

This is why we created Notify

Easily add new events that you want to send a notification from
Add four lines of code to you module at the critical point, where you might want to get a notification from. Then use them to configure and compose  notifications from your admin panel.

Pass any variable or data that you want to use later in your notification
The code can receive parameters which you can later use in the admin panel as placeholders for your notification message.

Build conditional notifications from your backend
You can use those parameters that were passed to the events for conditions. Create conditions to control, under which circumstances the notification is really sent.

Either configure immediate notifications or daily/weekly/monthly summarized reports
Some notifications might trigger too often to send a notification every time. But nevertheless it would be important to monitor those events on a regular base. In this case you can configure them to be sent as summarized reports with nice charts.

35 Predefined events will help you to monitor some basic Magento functions
Monitor admin logins, admin user creations, order status and other by 35 default event trigger.

Add automatic actions for every notification configuration
You might want to do something automatically a notification was sent. This is possible by configuring them over the admin panel.


Do you have any questions about the module? Do you need a new feature? Feel free to contact us:

Get Notify for your store to get notifications and reports for you complex processes.
Headerimage by Freepik

How to install the German Language Pack for Magento2

Our Magento Extension is made for all Merchants who are migrating from their German Magento1 Shop to Magento2 or who are creating a new Magento2 Shop for the German Market.

You can find the German Language-Pack (Du-Anrede) in our Shop or on Magento Marketplace.


If you purchased the language pack through the Magento Marketplace, you can directly install it in your Magento store through Magento. You’ll find a detailed description in the official Magento Docs.

If you downloaded the language package through our store, you have now a .zip file. Upload this file to your Webserver and unzip it.

  1. Copy the files from the Zip-Archive into your Magento2 installation. Create the folder app/i18n/Grafzahl/de_DE/ and insert the files.
  2. Execute this command from your Magento2 root directory: bin/magento setup:upgrade
  3. Delete Cache


After successful installation of Grafzahl German Language Pack (see instructions here) you can use the translations.

Please note that a language package does not use the usual extension path. You’ll install the package into the following Directory: /app/i18n/Grafzahl/de_DE/

After installation execute these commands in your terminal:

bin/magento setup:static-content:deploy
bin/magento setup:upgrade

Switch to German in the Frontend

To get the german translations in the frontend, you have to change the locale configuration in your stores configuration to German. Go to Stores > Configuration > General > General and here you select German in the Locale Options.

Switch to German in the Backend

The language for the backend has to be switched individually for every single backend user. To do this you have to go to System > All Users and select German in the Interface locale setting.


Headerimage Designed by Freepik

Why your customers are not buying your products

I know, this is a fundamental questions and you’ll think: “If it could be answered why my sales are low by one blog-post we’d all be rich and retired…”.

That is right. Any shop or product is different and this could not be answered in one blog-post. It might be that some reasons are valid generally for e-commerce sites but to answer them is not the intention of this blog post. There are many websites and blogs around that are explaining some of the common reasons and marketing or usability lacks that will your customers hold back from purchasing your product or service. Like some simple reasons that are obvious, or good advises for your marketing, like in this video.

In this blog post, I want you to show how to find those issues around your store that are not common but specifically related to your business or your shop usability or anything else that influences your customer on his decision.

Finding the reasons

So how will you find the reasons that are not covered by those common advices? Sometimes it might also be something, that is commonly known and which you are aware of but you are not able to transfer that knowledge to do more sales.

The devil is in the details

It is most effective to optimize all the small things in your store. Here are some ideas with reasons for low sales that are due to small issues with massive effect on your sales:

  • Your customer experiences an error you don’t know yet
  • Your customer doesn’t get enough information about the product
  • It is not simple enough to get to your checkout
  • Your customer is missing a payment method
  • Your customer doesn’t find the “right” product

This are just a few ideas. It could also be a bad formed title for a more complex product or something like this. The point is, that all these reasons are difficult to measure with the default tools that come with Magento (or even any other ecommerce system).  Some might be measured with A/B Versions but some don’t.

The best thing is to track those issues when they come up with notifications, or record them with reports.

Most modern system will provide the tools for developers to keep track on those issues by little code helpers which are called observers. These little commands are build in the system at certain points and  they will be called when a certain event comes up. They execute code that an third party module or extension registered.

This process would be a very time expensive process to implement for any situation you want to monitor.

My tool to monitor anything in Magento

We already developed a tool that supports you by doing the above described process. It also comes with 35 default event observer that you can use out of the box without any development skills.

With the Grafzahl Notify module you can configure those event observers from your admin panel. They are called “triggers” here.

The configurations are made in notification-items. In every item you can activate one or more trigger on which this notification is observing.

Notifications can be set up as reports (in hourly, daily, weekly or monthly periods) or instantly sent notifications.

For both types you can define the content which is shown in the report or notification. Instant notifications can be setup with text-templates. They can be filled with placeholders that are replaced with real data from that moment when the notification was created. For example: If a notification is setup that is watching for customers who are applying a wrong coupon code. Then you can insert the entered coupon code into your notification.

For report you may configure table elements or charts to visualize the collected data.

How to get notified if a customer experiences an error

In this example I will show you, how to use Notify to analyze the 404 pages the customers are requesting.

The first step is to install Grafzahl Notify. You can download the latest version from this page (A version for Magento 2 is still in process). The documentation for the installation can be found here.

Setup notification

To create a new notifications click on Notify > Configure Notifications in your main menu in the admin panel. Then click on “Create new notification” in the top right corner.

Now you can fill the fields in the “General” tab with the appropriate information and set Summary to “Daily”.


Now go to the “Trigger” tab and select “Error” in the list on the left and then “User gets 404-Page” in the middle column. Now it is displayed on the right column. Click “Save and continue edit” to reload the other tabs that relates to the trigger selection.

Now click on the report tab to setup the reports content which is daily sent to you by Notify.

Select the data variable which you want to visualize in your report in step one. Then click 2. Display as: Table to create a table with all 404-URLs that are requested by your customers.

After that you will see an element like above which has been added to your report section.

Now you are ready!

Analyze The Monitored Data

Like shown in the simple example above, you can quickly monitor a specific customer action in your Magento shop with reporting any data that is bind to the users session.

Having the data is only the first step.

Now you have to take your conclusions from the collected data to optimize the users experience and tailor your store to the target group of your customers.


If your customers are requesting many URLs that are leading to a 404 page you can redirect these URLs to content or products that will fit in the URLs name. Some of your customers might find the right product that way.


With the technique given in the example you can optimize your shop in detail. Using the real data which is created by the customer in the moment of an specific event is a great advantage in analyzing the behavior of you customers and learn from it to serve even better service.

I hope you enjoyed the post and took some ideas from it for your e-commerce. If you have more ideas, feel free to leave a comment!

Featured image designed by Freepik