Translating Magento 2 - Installing custom language pack(s)

I haven’t had a chance to thoroughly read through your post because I’m signing off for the day, but I’ll have a look tomorrow.

However, I just wanted to point out that you referenced the below command:

bin/magento setup:static-content:deploy en_GB -f

But you didn’t include the 2 other languages:

bin/magento setup:static-content:deploy en_GB fr_FR de_DE -f

As I said, I’ll check back in tomorrow.

Hi Craig,

You are absolutely correct. I wasn’t clear in my message. I’m only testing en_GB. If I can make one language works I’m sure the remaining 2 will work too.

It is really annoying because I already went through this once and it worked.
I have a feeling that I’m going backwards.

Please take your time. There is no rush. I’m sitting on this for last 2 weeks.
I tired on a few magento instances, including vanish but it just doesn’t work.

Thank you for your time.

Pawel

After about an hour, I’ve come to the conclusion that the Official Documentation sucks. When I have more time to get my head around it, I’ll get back to you (and probably produce a video).

I’m such an idiot. No wonder what I was doing wasn’t working! I forgot I installed the CubeWebsites GB Language Pack from the other night - And it was interfering with my own pack. I think I have it working now.

Hi Craig,
As I said take your time.
I tired for maybe 2 to 3 weeks to make this working before I asked you for help. I’m not a programmer but it shouldn’t be so difficult following M docs.

A video would be great. Of cource if you have time. You could break it into steps, creating storeviews, changing locale settngs in the admin pannel, changing or adding currencies, creating language packs and finally, I havent reserched this yet, how to conf. a site for mulpiple domains i.e mystore.co.uk, mystore.fr, mystore.ge and mystore.com/en, mystroe.com/de, mystore.com/fr.

Also, I know that it could be tricky, how to install SSL from multidoman website. I already cracked how to do it for single domain from godaddy, (I can write something here hopefuly it will be useful). I also tried installing SSL following your “let’s encript” toutorial. I think that this will be a biggy one but at first I need to lern how to creatre language packs.

Pawel

Have you installed a langauge pack via composer or have you created one?

My main goal was to work out and understand the Documentation. Specifically, I wanted to understand what the following 3 commands did:

  • bin/magento i18n:collect-phrases ...
  • bin/magento i18n:pack ...
  • bin/magento i18n:uninstall ...

collect-phrases and unistall were pretty straight forward. But it was pack that had me confused because I couldn’t work out for the life of me what it was actually doing.

What it does is separate and distribute your translation file into all of the appropriate (referenced) modules within their respective “i18n” folders. Very clever.

What didn’t help was that Test Translations I was expecting to see, didn’t display. And as I mentioned above, that was thanks to the other language pack I installed previously - Which was overriding my changes.

So, at this point I’m pretty sure I understand the purpose and functions of the i18n commands.

To answer your question, I just wanted to Generate and Create my own and then try to deploy it. It shouldn’t take too long to work out how to package the pack. But there are a few ways this can be achieved such as; Module, Theme, Pack.

I’ll come back to you on that one when I have another slot of free time to investigate.

Thank you.

In therory this should be easy.

…and run a few commands.

Ironically, I have done it for the previous M v. updated it to the newest version and the translation works for all 3 languages. :angry:

I’ve uploaded my i18n Language Pack Sample Solution to GitHub. This has been tested and works on my setup.

If this doesn’t work for you, then there is a high chance that you have another language pack interfering.

Note: Unlike a standard module, this doesn’t require any bin/magento installation commands to get going.

Edit: I’m supposed to be “off” today, so I’ll check back in on Monday.

Hi Craig,

Thank you for your reply.
I tried your language packs but it still doesn’t work for me.
(Just to confirm I changed in your en_GB.csv file some phrases - “Zip/Postal Code”, “Postcode”)
Your language packs installation procedure don’t differ from what I was doing which is good but at the same time not good because I didn’t make it work.

The language.csv file differs slightly. I included only original and translated phrases in quotation marks
Zip/Postal Code", "Postcode"
your file contain both phrases, and what they relate to i.e. module and releaser i.e. “Zip/Postal Code”,“Zip/Postal Code”,module,Ess_M2ePro
(Just to confirm I tried both only en_US and en_GB phrases & en_US, en_GB, + module and releaser)

I’m installing a new Magento locally now to check it again.
I have a question. Once the language packages are installed they should work for all themes, shouldn’t they?

Do I have to register my vendor before I register my language pack with the vendor in your example digitalstartup? (Just to confirm I changed the vendor name to mine in the language pack files and in the directory)

If you could give me some tips it would be great. I don’ t know what to look for.
Thank you in advance.

Pawel

Yes, I believe so. One thing that I don’t know is this: You’re can add i18n translations to Modules, Themes and Language Packs. But I don’t know which takes Priority.

Just swap out any references for your own, whilst not forgetting to update the actual directory names (as you said). However, I didn’t actually need to do anything after uploading the files other than this:

bin/magento setup:static-content:deploy en_GB fr_FR -f
bin/magento cache:clean
bin/magento cache:flush

Then when I switched the Locale in the backend, I just cleared the Cache again. It was surprising simple.

If you’re going to be testing on a clean install later then stick with my original first - Because we know that definitely works.

Hi,

OK, I need to try on the a fresh Magento then because it looks like I did everyhting correctly but it doesn’t work on my current M installation.

My magento has been installed with default english UK language so I didn’t change anything in the locale in the backend. Only for the french language but this also dosnt work. It absulatuly driving me mad. It should be so simple to do it.

Hi Craig,

Finally, I made it work. It was me being stupid creating the directory. Instead of i18n i named it 18.
I was doing it over and over again.

I waisted 3 weeks :rage: and I wasted your time too.
I’m sorry.

By the way in your command the is an error. No colon need after bin/magento

Pawel

I feel your pain, as I’ve been there a few times :slight_smile:

I’ve fixed those commands now, thanks.

A post was split to a new topic: Developing with PhpStorm

A post was split to a new topic: Assigning each Store View a Unique Domain

Hi Craig,

It looks like part of the post disappeared :thinking:
I remember I asked you what command I should use to gather all Magento phrases so I could use the file to start translating and I remember you replied and from what I remember it was a part of my post about language pack.

Can I kindly ask you to type the command again?
Thank you.

There is no rush I can wait.

Regards,
Pawel

Is it this you’re after? Installing a Crowdin Magento 2 language pack. I think I had to do some housekeeping due a double post.

Yes, thank you and happy Christmas :santa: :evergreen_tree: :gift:

Pawel

1 Like