cancel
Showing results for 
Search instead for 
Did you mean: 

How to install the Crowdin Package Portuguese / Brazil in Magento 2?

How to install the Crowdin Package Portuguese / Brazil in Magento 2?

Hello,

 

How to install this package in Magento 2?

 

https://crowdin.com/project/magento-2/pt-BR#

 

Where I include file source.csv?

 

Thanks!!!

4 REPLIES 4

Re: How to install the Crowdin Package Portuguese / Brazil in Magento 2?

Hello,

 

1) Rename the file:

 

source.csv 

 

to:

 

pt_BR.csv

 

 

2) Upload the file into (create missing directories):

 

app/i18n/MagentoBrazil/pt_br/pt_BR.csv

 

 

3) Create three files in the same directory :

 

app/i18n/MagentoBrazil/pt_br/composer.json

 

 

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

 

 

app/i18n/MagentoBrazil/pt_br/language.xml

 

<?xml version="1.0"?>
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
   <code>pt_BR</code>
   <vendor>MagentoBrazil</vendor>
   <package>pt_br</package>
</language>

 

 

app/i18n/MagentoBrazil/pt_br/registration.php

 

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

 

 

 

4) Enable Portuguese (Brazil) locale in Stores > Configuration > General > General > Locale Options > Locale

 

Screenshot:

 

 

 

 

5) Run SSH command  <full_path_to_magento_root_diretory>/bin/magento  setup:upgrade

 

 

 

Stanislav

Re: How to install the Crowdin Package Portuguese / Brazil in Magento 2?

Hello Pektsekye,

 

Work only if I include the file pt_BR.csv in /vendor/magento/language-pt_br

 

Is this correct?

 

Thanks!!!

Re: How to install the Crowdin Package Portuguese / Brazil in Magento 2?

Hello,

 

Your solution is the easiest.

 

But I don't think it is correct to place your custom translation directly into the vendor/magento directory.

Also the content of the vendor/magento/language-pt_br directory can be changed after magento version update.

 

 

I have corrected my solution.

 

I have made component name lover case in the registration.php file:

magentobrazil_pt_br

 

And I forgot to tell about the magento  setup:upgrade

 

 

 

 

Stanislav

Re: How to install the Crowdin Package Portuguese / Brazil in Magento 2?

A tutorial How to create a new language package in Magento 2

I hope it will save your time.