Jump to content

How to translate JReviews fields or How to create multilanguage listings


Ant

Recommended Posts

Multilangual listings are essential to my site. I am still investigating other methods, but I thought this one useful enough to write it up for others.

How to create multilanguage listings for JReviews

Before you get excited, this is only a partial solution and it requires the use of 2 third party extensions (I’m not affiliated with either company, but I get my subscription extended if you use my referral code for sh404sef (5H68N-6LJDN-BDB2X). The extensions are -

  • Rereplacer by RegularLabs (used to replace fields with translations).
  • sh404sef by weeblr (used to translate URLs).

This solution doesn’t really work for content where the user can write whatever they want (such as text areas). It works best for replacing labels and for replacing fields where the user has a limited choice of options.

This solution works for search pages, but you need to be careful. I might write a bit about that later.

How to setup

The assumption is that your website is already multilanguage (the language switcher is setup and working), you have a menu for each language and you have created JReviews listings but only in one language (my example uses English as the listing language).

To get started create a menu item for the English list page by going to Administrator -> Menus -> Name of English Menu -> Add New Menu Item

image.png.7cfc60761cd47018292197955b37d12d.png

 

Next click on Menu Item Type select button and chose JReviews ->List Pages

image.png.ac87428013d944aed91886cec5b7cfbf.png

The next thing I did was I set the Language to English. Configure the rest of the Details tab as you like. I’ve shown my configuration below.

re-upload.png.34e52c8d078c09bee9c2cf2f8fa930f6.png

 

Next click on the JReviews tab. Configure it as you like.

image.png.34347ceb101d0eb505f0a03351a4f600.png

Then click on the Associations tab. Here we will create menu items to the same page, but each menu will be for a different language. In the example below, the other languages I had set up were French and Japanese.

image.png.a54de1925e3226b1d3197f190a714eb6.png

To setup French click on the Create button for French. This lets you create a new menu item for the French list page and associates it with the English one. Repeat all the instructions outlined earlier for how to create a menu item. In my example, I called it French-list-page.

When you are finished repeat again for the Japanese language (and/or whatever languages you are using).

When you are finished click Save.

Now when we visit the menu item pages, the JReviews buttons should be in the same language as the menu. The JReviews listings themselves will still be in English at this stage.

The next step is to use Rereplacer to translate the actual JReviews fields. If you don’t do this step then you will have 3 menu items with almost exactly the same content. That would not be great for SEO!

Please note, I’ve quickly created the rereplacer config to show that it works. These actual configuration options may be suboptimal or bad practice or something else. Please research which options you should use. It is probably best to restrict the publishing assignments as much as possible.

In my listing, the user can select if they are available to teach Online.

To get started, I’m going to replace the field option “Online” for the French language

Go to Administrator -> Components -> Regular Labs- Rereplacer then click New

In the search box, type Online

then in the replace box, type the translation- En ligne

image.thumb.png.79916856638383889e4385fa650f89d6.png

I chose to use Case Sensitive search. This means it will only make a match if letters are capitalised exactly as they are in the search box. So in this case, Offline will match, but offline will not.

Next I chose the Search Areas tab.

In the section titled Enable in Area, I chose Everywhere. This is an important section. Please research it.

image.thumb.png.277a488ae7254c9876d155e71aedfe41.png

In the publishing Assignments tab I chose

Matching Method =ALL

Show Assignments= All

Languages =Include

Selection=French

image.thumb.png.d4e94421a800625e64ab1fb728d3a9ae.png

image.png.7b19a9dcb7ca06905c3383df2113f8b5.png

Then click Save.

Everything should now be setup.

 

How to translate the JReviews URLS

Next, translate the urls (optional). To do that go to Administrator -> Components -> sh404SEF -> SEF URLs

Then do a search for French-list-page

When you find it, click on the URL. It will create a popup. In that popup goto Edit url record and change the New SEF URL to be whatever you want the translated URL to be. When done click the “Save and Close” button.

I haven’t actually done the translation for this step, so I will just call the new url french-list-page-translated.

When I visit the url it will be http://websitename.com/fr/french-list-page-translated for the French version of my JReviews list page. On that page the field “Offline” should have been translated to “En ligne”.

The original listing

image.png.3c6c112154886aed7f09302c16ab74b7.png

The translated listing

image.png.7713f574b3012ce1bad24f295023a9d2.png

Edited by Ant
Changed another pic
  • Like 3
Link to comment
  • 2 weeks later...
×
×
  • Create New...