cancel
Showing results for 
Search instead for 
Did you mean: 

translate custom strings

SOLVED

translate custom strings

Hi,

using 2.2.2. I installed italian language pack and configured store views, all the standard magento string are correctly showing in italian. Then I have some custom string, this is what I did:

- ran command

php bin/magento i18n:collect-phrases app/design/frontend/Smartwave/porto_child/

which gave me the output:

"You could be also interested in","You could be also interested in"
Dictionary successfully processed.

then I created app/design/frontend/Smartwave/porto_child/i18n/it_IT.csv:

"You could be also interested in","Potrebbe interessarti anche"

and obviusly in phtml:

<h2><?php echo __('You could be also interested in'); ?></h2>

which doesn't get translated. What am I doing wrong?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: translate custom strings

For changes of locale translations if your chamges are not applied at that time you need to do a deployment to got changes in your site.
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

View solution in original post

3 REPLIES 3

Re: translate custom strings

Just try to run command,
php bin/magento setup:static-content:deploy -f

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: translate custom strings

Hi Rakesh,

thanks for your answer. I'm in developer mode, so why force the deploy?

 

Thanks a lot

Re: translate custom strings

For changes of locale translations if your chamges are not applied at that time you need to do a deployment to got changes in your site.
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial