1


I'm trying to create a new language package for Magento 2.1.3.
I've been following this guide but without success.

I tried the following steps without success:

1) Collect phrases from your module

magento i18n:collect-phrases -o "/var/www/html/magento2/sv_SE.csv" -m


2) Translate the words and phrases
I translated some words to Swedish.

3) Create the language package

magento i18n:pack /var/www/html/magento2/sv_SE.csv -d sv_SE

4) Create a directory for the language package
I created a directory named i18n, DSE and another directory named sv_se.

/var/www/html/magento2/app/i18n/DSE/sv_se

5) In the above directory, I added the following:

  • composer.json
  • registration.php
  • language.xml

My composer.json

{
    "name": "dse/language-sv_se",
    "description": "Swedish language",
    "version": "100.0.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "magento/framework": "100.0.*"
    },
    "type": "magento2-language",
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

My registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'magento_sv_se',
    __DIR__
);

My language.xml

<?xml version="1.0"?>
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Languag$
    <code>sv_SE</code>
    <vendor>dse</vendor>
    <package>sv_se</package>
</language>



What am I missing?
The phrases that I entered in sv_SE.csv before I ran magento i18n:pack are not showing up on my site.
All commands ran with success (as far as I can tell).

0

I forgot to flush the cache...
In admin CP, go to System -> Cache Management
Click Flush Magento Cache, and click Flush Static Files Cache
Now it works! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.