Translating filters to your language

J2Commerce (formerly known as J2Store)

Let us suppose that you have already created filters in a particular language and you wish to translate the filters to another language. This is how you could do it.

INSTANCE:

Languages available on the site: English, German. Filters have been created in language: English. Filters to be translated in language: German.

Example:

Let us assume that we have got the following filter and the following values for the filter:

Filter Group: Gender

Filter value 1: Male

Filter value 2: Female

Steps to be done:

  • Please navigate to J2Commerce > Catalog > Filters/specifications

  • Edit your filter, in our instance, it is the Filter Group with the title “Gender”

  • Replace the title with the following language constant (please note that this is custom-defined, you could use any constant on this. Just make sure that you have mentioned the constant in UPPERCASE letters. And make sure that you use the exact constant in the language overrides that we are going to create ): J2STORE__FILTER__GENDER

  • Now, replace the values of the filter with custom language constants like this: J2STORE__GENDER__MALE, J2STORE__GENDER__FEMALE

filterslang
  • Now that we have defined our constants, our next step is to create the language override

  • Navigate to Extensions > Language Overrides > Choose the language German

lagchoose
  • Click the new button and create an override for the constant: J2STORE__FILTER__GENDER

  • Create an override for the other two constants as well in the same language

langeditoverride
langfilgerman
langfilgerman1
  • Choose the language as English at the languages filter

chooseenglish
  • Create language overrides for the three constants here as well and mention the text that has to be displayed on the English site for this filter and the values

overrideeng
overrideengval1
engoverrideval1
engoverrideval2
  • Assign the filter and its values to the products you desire under the Filters tab of the product article of both the English and German language

filtertabeng
filtertabgerman
  • Navigate to frontend and you would see the texts that you defined in each language for the constants in the place of the filters respectively

English Language:

engfront

German Language:

germnafront

Last updated