Skip to content
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

Add language detector to stop non-English articles from publishing #1151

Open
fangyizhu opened this issue Jul 22, 2024 · 3 comments
Open

Add language detector to stop non-English articles from publishing #1151

fangyizhu opened this issue Jul 22, 2024 · 3 comments

Comments

@fangyizhu
Copy link

Description

Hi, I'm helping out Mission Local of San Francisco with their tech. First of all, really appreciate the work you put into this plugin, it helps us reach tens of thousands more readers every month.

We publish articles in English, Chinese and Spanish. We coach our reporters to hide Chinese and Spanish articles from Apple news. However, we have new reporters and interns joining frequently so very occasionally a non-English article would slip through to Apple News and some Apple News editor would have to manually pull the article down.

Is it possible to implement an automated language detector in your plugin so that it automatically hides non-English articles from Apple News? Or is it possible to at least give a warning to remind the reporters to check the "Hidden Article" option manually?

There are many open source python libraries that do this:
https://stackoverflow.com/questions/39142778/how-to-determine-the-language-of-a-piece-of-text

I'm not familiar with PHP but it seems like there are existing solutions as well:
https://stackoverflow.com/questions/1441562/detect-language-from-string-in-php

Use Case

Option 1: When a user publishes a non-English article (like Chinese or Spanish), the "Hidden Article" option is auto-selected.

Option 2: When a user publishes a non-English article (like Chinese or Spanish), there is a warning to remind the user to check "Hidden Article" option.

image

@fangyizhu fangyizhu added the enhancement New feature or request label Jul 22, 2024
@kevinfodness
Copy link
Member

The plugin supports multiple languages, so we don't want to automatically filter out certain languages from being published at the plugin level. However, if you want to set the value of the isHidden flag based on the language of a post, you can do that using the Automation feature, as long as the language of the post is being captured in a taxonomy somewhere (category, tag, or a custom taxonomy). You can set up an Automation rule to set the value of isHidden to true if the language term is set to Chinese or Spanish.

You can also accomplish this using one of our filters, like apple_news_skip_push to completely skip sending the post to Apple News based on the result of custom logic you write.

@kevinfodness kevinfodness added help wanted and removed enhancement New feature or request labels Jul 25, 2024
@fangyizhu
Copy link
Author

Thanks for the response. We can work with the Automation Feature and set isHidden based on categories.

Is skip publishing available in Automation panel, or no?

@mogmarsh
Copy link

@fangyizhu skip publishing is not available in the Automation panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants