Installing a Crowdin Magento 2 language pack

yes, i have selected/switched to the other store views as well, but all are the same “Locale option” is disabled!

Hi,

I’ve got it.

“This can happen when your site is production mode because if the locale is changed and there has been no static content generated for that locale there will be no assets available. The frontend would request assets from a location that would not exist and all styles and scripts would 404, which obviously isn’t ideal.”

Please try to change to deafault or developer mode.

1st. check your mode running the following command:
bin/magento deploy:mode:show

if in production mode change it to default or developer mode running one of these 2 commands:
bin/magento deploy:mode:set default | bin/magento deploy:mode:set developer

Please let me know if this helps.

Pawel

Magento dashboard goes terribly slow in “developer mode”, i can’t reach the stores options…

I know the pain.

Try default. It is faster. Run the following command:
bin/magento deploy:mode:set default

Worth to watch
Magento 2 Modes and how to change between them

I need to shoot for 30 mins brake so I won’t be able to reply.

Please let me know wow are you doing?

PP

Hi,
Any luck with the language packs?

Hi Pawel, I just enabled the new language pack for all store views while in developer mode, but it not showing in front page… is there something missing

OK, so you’re progressing.

I don’t want to retype Craig’s message becauce I could missspell something.

Please check whether you installed your language pack in app/i18n/yourshopname/ directory.
You should have in this directory a language pack i.e. en_GB, fr_FR, de_DE
The pack should contain 4 files, registration.php, composer.json, language.xml and your csv translation file.

Remember to clear caches and deploy static content.

Ref to Craig’s notes:
Clear Caches
Finally deploy your static content and clear your caches:

  1. Deploy Static Content for both languages: bin/magento setup:static-content:deploy en_GB en_US fr_FR -f
  2. Clean Cache: bin/magento cache:clean
  3. Flush Cache: bin/magento cache:flush

I hope you changed some entries in the registration.php and language.xml files.

Hi,
There should be 3 or maybe 4 steps.

1.Installing the language pack (uploading it to app/i18n/YourVendorNane directory
2. Slightly modify your language.xml and regitration.php files - add your vendor name to the files
3. Changing locale
4. Deploying static content and cleaning cache.

Hi Pawel,

Both language.xml and registration.php already have vendor name, so I modified the directory name (app/i18n/VendorName), but still no change on frontpage.

I deployed static content, cleared cache, and switched back to default magento theme (luma), but locale is not loaded.

Hi,
I was wondering how did you do with it.

It is really difficult to say what it wrong without digging into your Magento.
It took me 3 weeks to do it because of a stupid typing error.

Can you please tell me which language pack you are trying to install?
I could try on one of my test magento installation.

A…please remove js-translation.json file from /pub/static/frontend/Magento/ (your theme, or/and Luma, or/and luma child and so on)

Before you remove anything from your server on my advise please make a back-up.

Regards,
Pawel

Hi Pawel,

I have removed js-translation.json, but nothing happened. I am trying to install Arabic
ar_SA

I just added ar_SA to my Sample i18n Repo. I haven’t tested it, but perhaps @PawelP wouldn’t mind giving it a whirl as he’s used this repo before?

@PawelP would appreciate your support

Hi,
OK. Give me some time. I’m just installing a new magento to play with it.

Please note:

Magento enables you to create the following types of language packages:
1. A set of .csv files for modules and themes. These packages files are intended to be deployed in modules.
2. Language packages that contain an entire dictionary in one directory. (I’m using this method)
You can distribute this language package as a standalone component (similar to modules and themes). Interestingly, it violates Magento’s modularity principles on purpose; that is, so that a system integrator can translate variations provided by extensions. - source

The Arabic language pack you installed from crowding projec is the 1st type. I’ve never done it.

The pack from Craig is type 2nd.

Give me 10-15 mins.

Pawel

1 Like

Hi,

It took me a bit longer than I anticipated.

I’ve installed Craig’s package (Language packages that contain an entire dictionary in one directory). Works as it should :slight_smile:

I could try to play with the package from the crowding project type 1 ( A set of .csv files for modules and themes. These packages files are intended to be deployed in modules.) but I need to work out how to activate it.

@PawelP I’ll have you tagged as the i18n expert by the end of the year :wink:

1 Like

Hahahah :slight_smile:

I need to understand how to make let’s call it type 1 - ( A set of .csv files for modules and themes. These packages files are intended to be deployed in modules.) At a glance, I see that they don’t require language.xml and refistration.php files.

I need to play with it a bit longer.

Hi nccdebug,

Please let me know if you need a hand with this?
Craig’s language pack defenitely works. The other pack I’m guessing warks too but I need to do a reasearch how to make it working.

Pawel