Jump to content

Get a variable in a specific language


Nitneuq5

Recommended Posts

Hello,

Is it possible to get a variable in a specific language no matter what language the client is using? The aim would be to make a condition on this variable and avoid having to take into account all the translations.

Example: If the client is French, have the variable {$carrier.delay} in English for our condition. For example: {$carrier.delay|EN}

Thank you

Link to comment
Share on other sites

In the documentation

https://devdocs.prestashop-project.org/8/development/internationalization/translation/translation-tips/

Quote

Failure to comply with these guidelines will result in the wording not being ... translatable

maybe you want to intentionally fail the conditions?

 

It also says on the same page (inside code example)

Quote

// this won't work, the interpreter will ignore variables

which might be a clue?

Link to comment
Share on other sites

Thank you for your feedback

The aim was to use it in the templates but in the end I went for another idea using the "grade speed" of the transporters. My goal was to subdivide my different carriers by transport method (home, pick-up point, click & collect)

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...