New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dealing with translations on a site with mulitple languages #383
Comments
|
Just for reference: I did a dirty and hardcoded hack so that one of the sites I manage with PolyLang installed only sends English posts as activity. |
|
For me, the core basic functionality for multilingual support would be to set the language of the ActivityPub's content to match that of the blog's post. In this way, the post would be federated with the correct language tag. This allows followers to filter out posts in specific languages if they want to (like it's possible on Mastodon). Since each WP multilingual plugin handles language differently, one solution is creating compatibility classes like I might be completely off track here (sorry, only rudimentary php and activitypub knowledge), but what do you think? |
|
I can see use cases where it would be better not pass the language information via But that depends on whether you aim for one object to receive all replies and likes or actually prefer having multiple activities for each language. As you see there are many solutions for this problem. People should try to build a solution for their needs, and then we can see whether there are missing hooks/filters to fulfill their needs. Of course one can also make new settings pages and add a proper management of this functionality, but I would do this in a second step. At the same time for the project I do some infrastructure work I am currently fine with my hot-fix. |
|
Something I just thought. Would it be possible to set the ActivityPub object's language using a filter placed in the |
|
It totally is possible, but I did not fully understand, what you would prefer. |
|
Hey, I had another look into this and maybe the issue lies elsewhere. For clarity, I post in different languages, and it's fine for me that the objects and associated replies, likes, etc., remain separate for each language. But, I'm looking for a way to make the language of the federated post to match that of the blog post. Currently, this is not the case. The language of the federated post is always set to English (website's default) independent of the original post's language, at least on Mastodon. I thought this was because the plugin was not setting the post's language in the ActivityPub object (that's why I asked about using filters). But using the command below, I noticed that the object has a So, the post's language appears to be correctly set to However, the post federated to Mastodon is tagged with Any ideas on how the correct language can be set on the federated post? (maybe it's a Mastodon-specific issue?) Cheers, |
|
The question: does the Mastodon server you use has also received the object that way? There already is a filter where you can set the locale. https://github.com/Automattic/wordpress-activitypub/blob/master/includes/transformer/class-post.php#L684 But it would be better to have one ActivityPub-object for one post which contains all languages. |
Dealing with translations might become necessary, and it might be done via different approaches. As there are not too many widely used translation plugins there might be solutions that work for most users.
Easy first step solution: Select/choose languages that should be published via ActivityPub in the settings.
More advanced solution: Create some sort of group actors that publish certain languages.
#multilang
The text was updated successfully, but these errors were encountered: