This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 25 replies, has 2 voices.

Last updated by Laura 1 month, 4 weeks ago.

Assigned support staff: Laura.

Author Posts
August 1, 2019 at 8:08 am #4319535

Александр Крутов

Please tell me if I use the correct duplication of listings in other languages and solve the problem.

Consider a site with three languages and one country. In this example, users do not work in the main language of the site.

Important: Because I use automatic Google map switching to the active language, when a user creates a listing, they can enter an address in any language and the map will set the default language to the location address.

User #1 creates Listing #1 in the language interface #1 in language #1.

User #2 creates Listing #2 in the language interface #2 in language #2.

I need to make sure that in the interface of language number 1 and in the interface of language number 2 the visitor of the site could find all these 2 listings, because they belong to one city.

To do this, I duplicate listing #1 on language #2, and I duplicate listing #2 on language #1. At the same time, I manually change the location in the new listings, so that it corresponds to the language in which the listing-duplicate was created.

There is such a need in Ukraine, where people speak Ukrainian or Russian. And many people speak both Ukrainian and Russian. That’s why I need to show them the listings created in both languages.

I have 4 questions:

1) Am I designing the correct logic of the ads or do I have another logic?

2) Is it possible to make the location address automatically change to the language in which the duplicate listing is created?

3) Is it possible to automatically duplicate the listing in language No. 1 to language No. 2, to automatically duplicate the listing in language No. 2 to language No. 1, but not to apply it to other languages? Let me remind you that the language of the site is №3.

4) if question #3 can be implemented, can the language of the location address be changed automatically?

August 1, 2019 at 10:42 am #4320717

Александр Крутов

I've added functionality in a minimal set-up. See what else you need for your tests. And I haven't added any other languages yet, and haven't added any code for the card to automatically translate the addresses.

August 1, 2019 at 10:44 am #4320725

Александр Крутов

map_language

function gd_wpml_default_map_language( $language ) {
            return defined( 'ICL_LANGUAGE_CODE' ) ? ICL_LANGUAGE_CODE : 'en';   
        }

add_filter( 'geodir_default_map_language', 'gd_wpml_default_map_language' );
August 1, 2019 at 10:47 am #4320745

Александр Крутов

I've installed but not activated the geodir-multilingual-1.0.0.0-beta.zip. It seems to be necessary for GD to work with WPML.

August 1, 2019 at 11:22 am #4321051

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+02:00)

Hi,

I know about this GD multilingual but please consider it's not developed by us so we can't guarantee it will work.

I'll check the site and let you know.

August 1, 2019 at 12:05 pm #4321369

Александр Крутов

Thank you. When can you answer?

August 2, 2019 at 6:46 am #4327257

Александр Крутов

Laura, good morning! Is there anything else I need to set up for your work?

August 2, 2019 at 7:25 am #4327583

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+02:00)

Hi,

I don't see any listing on your site - as I said, we need to reproduce the issue but since I don't know the plugin you should do it or at least list the steps needed, otherwise I don't know how to proceed.

August 2, 2019 at 7:56 am #4327835

Александр Крутов

Okay. I'm gonna do two listings for an example.

August 2, 2019 at 8:36 am #4328205

Александр Крутов

I created 1 listing in the Italian interface hidden link

Our task is to show a listing in the Russian version of the site. This listing should be displayed on the site, if we will look for a location by the Russian name of the city "Рим".

* I don't understand why there's no Russian or Italian in the language switch.

** And the link to the listing doesn't work
hidden link

August 2, 2019 at 8:56 am #4328289

Александр Крутов

I think you need to activate "geodir-multilingual" and translate the home page so that you can switch to other languages. Who should do this: me or you?

August 2, 2019 at 9:17 am #4328403

Александр Крутов

Also, I plan to use the code to switch the map language:
https://wpml.org/forums/topic/how-do-i-automatically-change-the-location-links-when-duplicating-records/#post-4320725

What do you think of that?

August 2, 2019 at 10:15 am #4328861

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+02:00)

Hi,

for the moment I'd avoid adding the code for the map switching, let's try to see if it works fine without it.

If you have the GeoDirectory Multilingual already please install it, I should search for it first.

Not sure why the page doesn't open, maybe there is some other plugin needed?

August 2, 2019 at 12:14 pm #4329899

Александр Крутов

I have added a plugin linking GD and WPML and a translation manager. Created duplicate pages in Italian and Russian. Now you can switch to other languages and the listing page opens. It seems that everything works the way I need it and there is no problem. But I want to see how it will be now, if I add the code of automatic translation of the card into the active language.

I have also found that on this setting the listings are visible as duplicates in all languages. What do I need to enable in the settings that would also be on my site? On my website, I am duplicating listings with the help of a translation manager.

Can you tell me what your work schedule is when I can contact you?

* The page started to open after I reconfigured permalinks.

August 3, 2019 at 12:45 am #4332863

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

Timezone: Europe/Rome (GMT+02:00)

Hi,

I can see you duplicated pages but they did not return content, so I set "Places" in WPML > Settings > Custom Post Types Translation as "fallback on default language" and now I can switch language and I see the interface in Italian or Russian.
Also the search works, if you type Рим it gives you results.

To recap, the process done so far should have been:
- install GeoDirectory + addon and GeoDirectory Multilingual
- set Places in WPML > Settings > Custom Post Types Translation as "fallback on default language"
- add some Places
- duplicate the GeoDirectory pages

Can you confirm this is correct and it's working as it should?
If it is, you can go on adding the code for the map (please let me know where you add it specifically)

As for my schedule, you can check it here: https://wpml.org/forums/users/laura-c/ but please notice I have a queue so I can't guarantee a reply everyday.