qTranslate-Team / qtranslate-x

Wordpress plugin: Adds user-friendly and database-friendly multilingual content management and translation support.
http://qtranslatexteam.wordpress.com/about/
GNU General Public License v3.0
208 stars 147 forks source link

Integration for bookmarklet "Press This" #380

Open alexisju opened 8 years ago

alexisju commented 8 years ago

I frequently use the WP bookmarklet (Press this) to publish articles.

However, when i use it, article's language is "not set" and, if i modify the article, the original text will appear the same in all languages.

qtranslatex should be implemented into bookmaklet to avoid that.

Maybe someone could suggest me some trick to let me use Press this with qtranslate as simple (and efficient) as possible.

johnclause commented 8 years ago

I never used it and do not know how that works. Could you give a list of specific steps to reproduce the problem? Thanks a lot.

alexisju commented 8 years ago

Situation : Wordpress + qtranslatex plugin

In first case (popup), you will note that there is no language tabs; In the second case (the standard editor), you will note that all the language tabs are prefilled with the same content.

In both situation the result is the same : using the bookmaklet, there is no (direct) way to edit a post in several languages and (what is most annoying for me) the post a repliated in all configured languages.

johnclause commented 8 years ago

So, for publishing I do not see a problem, sine you would need to use one language only on sharing message, right? WordPress does not have ability to publish multilingual content.

I could not reproduce the second case, how do you open a standard editor?

alexisju commented 8 years ago

Not at all! When i use the bookmarklet the language is not set. What mean there is not effect on language management on front end. The same post is displayed in all languages of my website.

I cannot neither choose in wich language i create the post with the bookmaklet.

In the popup, you can choose between publish or open the the current post in the standard editor.

johnclause commented 8 years ago

I am still confused. Instructions says "Then, when you’re on a page you want to share, simply “press” it." Share where? On WordPress.com? Or will it simply create another post on the same website? I do not want to try pressing "Publish", as I do not wish to publish my testing anywhere.

alexisju commented 8 years ago

When you click on the bookmaklet, a popup windows opens. It prefil some information (title, description, source link). When you click on "publish", the post is published on your wordpress website (wordpress.com instance or self hosted wp).

You can find all information here : https://make.wordpress.org/support/user-manual/content/posts/creating-quick-blog-posts-with-press-this/

johnclause commented 8 years ago

Ok, this is apparently another quick way to create a new post on the same website. Then this is a matter of integration. I updated list of desirable features, so that we would not forget it, but I do not have time to deal with it right now.

Can anyone take initiative to implement it? I believe it is only a matter of additional JSON configuration, which for testing purposes can be tried via field "Custom Configuration" on page "/wp-admin/options-general.php?page=qtranslate-x#integration". Once it works, we can move it into file i18n-config.json permanently.

johnclause commented 8 years ago

I guess, with this code in "Custom Configuration" on page /wp-admin/options-general.php?page=qtranslate-x#integration:

{
    "admin-config": {
        "press-this": {
            "pages": {
                "press-this.php": ""
            },
            "anchors": {
                "pressthis-form": {
                    "where": "before"
                }
            },
            "forms": {
                "pressthis-form": {
                    "fields": {
                        "pressthis": []
                    }
                }
            }
        }
    }
}

it would solve most of your problems. Only title is not multilingual. WordPress came up with a new way of implementing editable field, so more work is needed on this. But I think it is already helpful?

alexisju commented 8 years ago

Thank you for your help. Indeed, this custom configuration help me even it is not perfect.

Now, i have language tabs displayed into the popup, so I can more easily remove (or translate) content into supposed language.

What still a bit strange is that prefiled content (description/source) is always prefilled in all tabs/languages.

johnclause commented 8 years ago

Where do you want the prefill to be? It is everywhere, and you are supposed to enter translations of it. Does not it help to have what you translate in front of you? It should be possible to auto-convert it to multilingual text, but this would already require modification of PHP code in order to integrate. Hopefully they put appropriate filters there.

alexisju commented 8 years ago

When i create a new post into Wordpress backend, the language tab who is opened is always the one i previously used. Ideally the prefilled content could have the same behavior and only fill one tab/language (the last used or default language?), not all.

johnclause commented 8 years ago

When you create a new post all are "pre-filled" with empty string. Further modifications go into each language separately.

alexisju commented 8 years ago

Ok i understand. Thank you for your explaination.