cancel
Showing results for 
Search instead for 
Did you mean: 

How translations works?

SOLVED

How translations works?

Hello,

 

I do not understand how translation work in magento 2.

 

For my part, I try to have the interface (frontend and backend) in French (fr_FR).

 

I have set my admin profile with local fr_FR and also the store view but nothing resulted.

 

I noticed that natively, Magento comes with the package "language-fr-fr" (and other too) but no translation file is included in this package.
So I guess this package allows you to enable local correctly.

 

Having installed Magento with composer, I did a search in the vendor directory: 

 

find . -name "fr_FR.csv"

 

 and I have found some files, but in reality the strings are not translated.

 

So I followed the instructions in the doc: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-i18n.html#config-cli-...

 

but my translations are not snuff into account. I cleared the cache, compiled, deployed: nothing works Smiley Sad.

 

How to do ?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How translations works?

Hello,

 

@Dmitry_Fedyuk :

 

Thanks for these informations. I had indeed perform operations.
In reality, my translations were not taken into account because the system uses the information "vendor" and "package" of the "language.xml" file to recover the csv files to process (not just the statement of the way done in Registration .php as I thought):

 

// Magento\Framework\App\Language\Dictionary::readPackCsv()

private function readPackCsv($vendor, $package)
{
    $path = $this->componentRegistrar->getPath(ComponentRegistrar::LANGUAGE, strtolower($vendor . '_' . $package));
    ...
    return $result;
}


Except that in the package name I specified "magento2-fr_fr" that did not correspond to the tree of my component Smiley Mad !

 

 @akent99 :

 

OK thank you.
I take part in the translation on crowdin.com.
For cons, I don't understand why there are so many strings to translate (40669) whereas with the command "i18n: collect" on a fresh installation of Magento it appears that only 7775 strings.

View solution in original post

3 REPLIES 3

Re: How translations works?

Here is my experience how to create a language package for Magento 2: https://mage2.pro/t/270 

Re: How translations works?

We don't have all the translation files done yet - I will ask to get an update on progress. So you are correct, there is the skeleton of such files, but no serious content. Lots of outstanding translations to be done.

Re: How translations works?

Hello,

 

@Dmitry_Fedyuk :

 

Thanks for these informations. I had indeed perform operations.
In reality, my translations were not taken into account because the system uses the information "vendor" and "package" of the "language.xml" file to recover the csv files to process (not just the statement of the way done in Registration .php as I thought):

 

// Magento\Framework\App\Language\Dictionary::readPackCsv()

private function readPackCsv($vendor, $package)
{
    $path = $this->componentRegistrar->getPath(ComponentRegistrar::LANGUAGE, strtolower($vendor . '_' . $package));
    ...
    return $result;
}


Except that in the package name I specified "magento2-fr_fr" that did not correspond to the tree of my component Smiley Mad !

 

 @akent99 :

 

OK thank you.
I take part in the translation on crowdin.com.
For cons, I don't understand why there are so many strings to translate (40669) whereas with the command "i18n: collect" on a fresh installation of Magento it appears that only 7775 strings.