Automattic / Automattic/WP-Job-Manager
Multilingual default Jobs page not translatable with WPML and WP Job Manager
- Dominant language
- PHP
- Stars
- 899
- Forks
- 369
- Avg merge
- 11h 37m
- Merged PRs (30d)
- 12
Description
**Describe the bug**
For our project, we use WPML in combination with WP Job Manager. As you know, a default jobs page can be set where all of the job widgets (such as filters) and the job listings will appear. In our case, this page is called "Stellenangebote" ("Jobs" in german), which has been translated with WPML and has the following urls: "www.websitename/stellenangebote" (in german) and "www.websitename/it/offerte-di-lavoro" (in italian). The [jobs] shortcode is added in both versions of the page. In german, which is the website's main language (set through WPML), everything is working fine. On the same page, we also have a language switcher, which can switch to the italian version of the page on click. But when a user clicks on the switcher, instead of going to the translated url ("www.websitename/offerte-di-lavoro") it goes to "www.websitename/it/stellenangebote", which is a page that does not even exits. On "www.websitename/it/stellenangebote", everything still works fine, but if we click on the "Offerte di lavoro" page from the main menu, it goes to the page "www.websitename/it/offerte-di-lavoro", which looks broken and has no job widgets (although it does have a job list with default styling).
Our objective is to have one page with different slugs in different languages. So, when a user is on "www.websitename/stellenangebote" and clicks on the language switcher, it should be directed to "www.websitename/it/offerte-di-lavoro", where the job widgets, styling, and list should appear and function exactly like in the german version.
We tried looking through your plugin's code, and, as disclosed in the following thread ( https://github.com/Automattic/WP-Job-Manager/issues/786 ), the issue should have been fixed and the plugin should be compatible with WPML as of now. So we don't understand what we've been doing wrong.
**To Reproduce**
Steps to reproduce the behavior:
1. Install WPML and WP Job Manager Plugins
2. Add a main and a secondary language to the website
3. Create some Jobs
4. Create and set a Jobs page (add [jobs] shortcode + add this page as the default Jobs page by clicking in admin menu on Jobs -> Pages -> Jobs page)
5. Create a translation of the Jobs page (click on the '+' near the page's title) for the secondary language
6. Change the url slug of the translated page (set anything, as long as it is different from the slug of the Jobs page in the main language)
7. Add a Job widget, f.e. a filter for a job category
8. Navigate to the default Jobs page in main language, everything should work fine and widget should be visible
9. Navigate to the url of the translated Jobs page, here wordpress does not show the widget and the page is styled as a default archive page
10. If you see a language switcher when on the main Jobs page, by clicking on the switcher you will be redirected to 'base url/secondary language code/same slug as the main jobs page'.
**Expected behavior**
By clicking the switcher, the user should be redirected to the url of the translated version of the jobs page. In addition, job widgets and styling should remain unchanged.
**Isolating the problem (mark completed items with an [x]):**
- [X ] I have deactivated other plugins and confirmed this bug occurs when only WP Job Manager plugin is active.
- [ ] This bug happens with a default WordPress theme active.
- [ X] I can reproduce this bug consistently using the steps above.
**WordPress Environment**
- WordPress Version: 6.1.1
- WP Job Manager Version: 1.39
- PHP Version: 7.4
Contributor guide
Research direction
Start by reproducing the issue with WordPress 6.1.1, WP Job Manager 1.39, WPML, a translated Jobs page, and the [jobs] shortcode using the listed steps. Compare the default and translated page URLs, widgets, styling, and language-switcher behavior; done means the switcher reaches the translated slug and the translated page retains the widgets, styling, and job list behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- internationalization, localization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100