cancel
Showing results for 
Search instead for 
Did you mean: 

Add language selection

SOLVED

Add language selection

Hello

 

We are new here and would like to create our online shop with Magento 2.1.

 

Unfortunately we have a problem with different languages.

 

We want to create our online shop in 5 different languages

We have added a Romanian language and that way

We have on vendor / magento / created a directory language-ro_ro and uploaded the files there.

 

Well, if you choose the Romanian language, it will always be displayed in English.

 

What do we have to do to choose the Romanian language?

 

greeting

Matthias

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Add language selection

Your error log says that you Var/Generation directory is not writable.

 

As per the standard Var directory and for magento 2.2 on wards generated directory both needed writable permission.

 

So you need to give permission to those directories , and below are the commands for that.

 

cd <your Magento install dir> 

find . -type f -exec chmod 644 {} \;  // 644 permission for files

find . -type d -exec chmod 775 {} \; // 775 permission for directory

find ./var -type d -exec chmod 775 {} \; // 775 permission for var folder

find ./pub/media -type d -exec chmod 775 {} \; find ./pub/static -type d -exec chmod 775 {} \; chmod 775 ./app/etc chmod 644 ./app/etc/*.xml chown -R :<web server group> . chmod u+x bin/magento

 

For more details refer this link - http://devdocs.magento.com/guides/v2.0/config-guide/prod/prod_file-sys-perms.html

 

if issue solved, Click kudos/Accept as solutions.

if issue solved,Click Kudos & Accept as Solution

View solution in original post

6 REPLIES 6

Re: Add language selection

Hi Matthias

 

Instead of adding your language pack to vendor directory - add language pack to app/i18n directory.

 

Below is the detailed instructions step to make second store in Romanian(ro_RO) language.

 

  1. Download the Romanian(ro_RO) language pack from this link - https://github.com/EaDesgin/magento2-romanian-language-pack
  2. Create app/i18n/eadesigndev/ro_ro/ directory and put all the downloaded language-pack files in this ro_ro directory.
  3. Now Upgrade installation using command - php bin/magento setup:upgrade
  4. Clear cache using command - php bin/magento cache:clean
  5. Deploy static content command - php bin/magento setup:static-content:deploy ro_RO
  6. Now to activate the language for frontend , logged in to admin panel then go to stores -> configuration -> general settings -> locale options -> select Romanian language from locale dropdown - Also Make sure you have selected your second store view from storeview dropdown on the top of the settings screen.
  7. Click on save buttton and check on frontend side content will shows in romanian language.

 

For More Details refer this link - https://github.com/EaDesgin/magento2-romanian-language-pack

 

Note : While doing this all make sure you are in developer mode - as magento 2.2.2 version you can not change locale while your in production mode.


if issue solved, Click kudos/Accept as solutions.

 

if issue solved,Click Kudos & Accept as Solution

Re: Add language selection

Hello

Whenever I execute this command, he makes the update
but after that I always get this message in the browser

and I can not get on Magento

 

"An error has happened during application run. See exception log for details."

 

what do you have to do now?

 

greeting

Matthias

Re: Add language selection

Hi @demamaschinen,

 

Check into your Magento directory: /path/to/magento/var/log

Probably you'll get an exception.log file with some messages.

Re: Add language selection

Hi @demamaschinen

 

An error has happened during application run. See exception log for details

 

To solve this issue we need to follow the below steps.

 

  1.  Check your exception log file from var/log directory of you magento root directory.
  2.  Change it to developer mode if you are in different mode.
      Php magento deploy:mode:set developer
  3. Give write permission to var/ pub/ directory
     chmod -R 777 var/ pub/
  4. Deploy static content Php magento Setup:static-content:deply
  5. run php bin/magento cache:clean and php bin/magento cache:flush

 

Now check it will works !! If issue is still not solved , then post your exception log file code over here .

 

 

if issue solved, Click kudos/Accept as solutions.

 

 

if issue solved,Click Kudos & Accept as Solution

Re: Add language selection

after these executions of these commands come these error messages

 

Fatal error: Uncaught Zend_Cache_Exception: cache_dir "/var/www/vhosts/domain.de/shop2018.domain.com/var/cache/" is not writable in /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/zendframework1/library/Zend/Cache.php:209 Stack trace: #0 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/var...') #1 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/colinmollenhour/cache-backend-file/File.php(87): Zend_Cache_Backend_File->setCacheDir('/var/www/vhosts...') #2 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/zendframework1/library/Zend/Cache.php(153): Cm_Cache_Backend_File->__construct(Array) #3 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen. in /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/zendframework1/library/Zend/Cache.php on line 209

 

in the log file that is in there

 

[2018-01-20 08:27:37] main.CRITICAL: RuntimeException: Can't create directory /var/www/vhosts/domain.de/shop2018.domain.com/var/generation/Magento/Framework/App/Response/Http/. in /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/Code/Generator.php:115
Stack trace:
#0 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...')
#1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...')
#2 [internal function]: spl_autoload_call('Magento\\Framewo...')
#3 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...')
#4 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...')
#5 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Framewo...')
#6 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#7 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#8 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'response', 'Magento\\Framewo...')
#9 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#10 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#11 /var/www/vhosts/domain.de/shop2018.domain.com/vendor/magento/framework/App/Bootstrap.php(233): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#12 /var/www/vhosts/domain.de/shop2018.domain.com/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...')
#13 {main} [] []

 

What do I have to do?

Re: Add language selection

Your error log says that you Var/Generation directory is not writable.

 

As per the standard Var directory and for magento 2.2 on wards generated directory both needed writable permission.

 

So you need to give permission to those directories , and below are the commands for that.

 

cd <your Magento install dir> 

find . -type f -exec chmod 644 {} \;  // 644 permission for files

find . -type d -exec chmod 775 {} \; // 775 permission for directory

find ./var -type d -exec chmod 775 {} \; // 775 permission for var folder

find ./pub/media -type d -exec chmod 775 {} \; find ./pub/static -type d -exec chmod 775 {} \; chmod 775 ./app/etc chmod 644 ./app/etc/*.xml chown -R :<web server group> . chmod u+x bin/magento

 

For more details refer this link - http://devdocs.magento.com/guides/v2.0/config-guide/prod/prod_file-sys-perms.html

 

if issue solved, Click kudos/Accept as solutions.

if issue solved,Click Kudos & Accept as Solution