Translating filters to your language
J2Commerce (formerly known as J2Store)
Last updated
J2Commerce (formerly known as J2Store)
Last updated
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.
Languages available on the site: English, German. Filters have been created in language: English. Filters to be translated in language: German.
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
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
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
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
Choose the language as English at the languages filter
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
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
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:
German Language: