Strings translation issue
-
Hello again!
Plugin sends records to Algolia with translated strings depending on admin panel language, but not on the site’s original. So at least in the end we get different post labels on Algolia side… It doesn’t happen during WP-CLI re-indexing.
I mentioned it here before.
Any workaround or upcoming fix? – Thanks!
-
I am seeing
wpml_switch_languageandwpml_switch_back_languagemethods that are being used on line 37 and 38.I’m curious if the issue you’re presently seeing would go away if you comment out both of those lines temporarily.
I’m not seeing anything about language switching in https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/includes/class-algolia-cli.php
We don’t use WPML, but MultilingualPress. In case with WP-CLI it requests each subsite separately with
urlparam, so I guess it gets correct language in all cases…Issue can be reproduced on clear installation without any plugin for multilingualism, – just select different admin language and create/re-save post or do re-indexation from the panel.
Noted on the i18n tool.
Not really managing to recreate, at least not in a way that is obvious.
I changed the default language for an install, edited an existing indexed page, but not seeing duplicates or anything like that. It updated the existing one.
Wasn’t post label changed to selected admin language?
That part wasn’t translated ever, so it didn’t have a different variation to work with, and your instructions above didn’t say anything about changing the post label, just updating in some way.
My test was legitimately adding a period to a sentence and clicking update, which is enough for the post in question to re-index and update.
The thing is in translations… For example, if FE part is on DE language and all pages have Seiten post label after WP-CLI re-indexation, when we change admin lang to EN and push any page to the Algolia after some change – it will have Pages post label. Same happens with other translated strings.
It’s going to be difficult for us to test/try anything with this, as we don’t have access to a copy of Multilingualpress that I’m aware of.
I am curious if for some reason, the difference between UI and CLI is in what it queries for and for which language. Sounds like Multilingualpress may not be accounting for CLI queries, whether intentional or not, while UI filters and takes into account which is the current language being viewed for things.
Worth checking with them at least, for the sake of a lead.
It’s not related to MultilingualPress, the point is in different admin language which can be set in clear installation….
It still very much may be if they’re adding in filters that dictate what content gets queried, like based on current language, and only returns that specific content.
Can you confirm whether or not it happens with the bulk re-index using the UI buttons in our setings pages? or if it’s just when updating/editing single pieces of content?
Asking this because I’m looking at our WP-CLI code and it’s running the
re-indexmethod on the set up indexes, which I believe would also be doing just everything in bulk. So I’m wondering if there’s a process difference in bulk vs individual, that is at play here.I also am still not able to do any deep dive troubleshooting as mentioned yesterday since I don’t have access to MultilingualPress, and it would still be a good idea to reach out to them to see if they modify queries to return just specific language-based content.
It happens on bulk re-index from the panel and on single edit.
Gathered some thoughts with others who help maintain and develop the plugin, and I have listed them below.
* We have little to no idea about the setup. A guess is that it is a multisite because you mentioned using the url parameter in the WP CLI command.
* Secondly, we are not too sure what you mean by “Post Label”. Is it post title?If needed, would you be willing to move some debugging correspondence to private, instead of on the forums here?
We have little to no idea about the setup. A guess is that it is a multisite because you mentioned using the url parameter in the WP CLI command.
Yes, but it can be reproduced on single site setup as well.
Secondly, we are not too sure what you mean by “Post Label”. Is it post title?
Sorry, I meant post type label.
Maybe it’s better to get some screen-recording, I’ll try to do that…
If you could reproduce and record every step on a single site install with just a second language, installed, that’d be awesome because I haven’t been able to reproduce on that version thus far. However you know the detailed steps more than I do thus far.
The topic ‘Strings translation issue’ is closed to new replies.