Jump to content

V1.7.8.1 - Translate new strings


Recommended Posts

Hello, I'm going crazy with new strings translations.

I've searched a lot, but all of the tips found don't solve my problems.

I use the Classic theme and I put the following string in login-form.tpl:

{l s='My custom text.' d='Shop.Theme.Global'}

I tried with domains: Shop.Theme.Global, Shop.Mydomain, Shop.Messages.

I tried to clear the cache in Performance section and reload the page.

I tried to export the language.

...But I can't find the new strings in Translations > Back End Section.

I also tried to add the key  in ps_translations: nothing to do.

Do you have some tips? I would like to avoid changing the classic theme and / or duplicating it.

Thank you very much

Cris

Link to comment
Share on other sites

  • 2 weeks later...

Yes, into classes/form/CustomerFormatter.php

I add a new customer field, look below:

        $format['email'] = (new FormField())
            ->setName('email')
            ->setType('email')
            ->setLabel(
                $this->translator->trans(
                    'Email',
                    [],
                    'Shop.Forms.Labels'
                )
            )
            ->setRequired(true);
            
        // NEW FIELD ADDED FOR VERIFICATION EMAIL
        $format['email_ver'] = (new FormField())
            ->setName('email_ver')
            ->setType('email_ver')
            ->setLabel(
                $this->translator->trans('Email Verification',[],'Shop.Forms.Labels')
            )
            ->setRequired(true);

Verification email works fine, but $this->translator->trans('Email Verification',[],'Shop.Forms.Labels') don't show up into back office. Neither translations xlf files are modified with new field.

Thanks for your help

 

Link to comment
Share on other sites

1 hour ago, Crezco said:

Hi,

did you resolve the problem? I have same problem with Presta 1.7.8.3 and PHP 7.4

I insert new wordings into class files and tpl files and don't show up in BO Translation interface.

Any help?

No, unfortunately I was no longer able to solve. The most immediate solution I found was to create a child theme (much faster than creating a copy of the theme).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...