dougwollison / nlingual

Versatile and flexible multilingual system for WordPress.
https://wordpress.org/plugins/nlingual/
GNU General Public License v2.0
13 stars 7 forks source link

Option to link existing translation #16

Open mkkeck opened 3 years ago

mkkeck commented 3 years ago

Hi, your plugin is really great. The only thing I've not found is an option to link two already existing translation. Exampe: I've a post with an id 1 in german and the same post was translated into english with an id 3. How can I group this two posts? The same with reusable blocks, terms and taxonomies.

At the moment I make this directly in database table.

Kind regards and many thanks for this plugin. It seems to be a really good aleternative to polylang.

dougwollison commented 3 years ago

Currently assignment of existing translations is only possible through Quick Edit. There should be a set of boxes below the language picker that lets you select the translation for each (a bit buggy right now as the english box should be hidden when the language is set to english). In the past I've had a select box in the post editor for the translation but it was a bit unintuitive, and all client use cases just needed to be able to create a new translation, since they weren't switching from an alternative system.

image

This applies to all post types that have translation support, however terms currently don't use sister translations and instead the little Translate This module next to the Title and Description fields. For merging pre-existing terms, you'd have to use something like the Term Management Tools plugin to merge them, then translate the resulting merged term.

image

At some point I'll be able to implement more robust translation handling of terms, but the UI is less flexible compare to the post screen/editor. When I do eventually figure out how to effectively implement it, there'll be an automatic migration for splitting terms based on translations/assigned posts, and re-assigning posts to the corresponding translation of the term.

mkkeck commented 3 years ago

Hi Doug,

many thanks for your great explain. I've tried the bulk edit, but it does not work on my setup. I could only select the post with id 1 for the translation. I've done in the nl-translation table via PhpMyAdmin.

An other question, is it possible to link into pages or posts in navigation, without url rewrite. Example: "The Post" or "The Page" exists only in english and default language is defined as en. Now user navigates to /de/the-post and should not be redirected to /en/the-post. The same would nice with objects there are not in default language. Example: show all posts, but from all languages, except the translation for selected language is available.

Example: default lang is en Post 1 exist in en and de - show it in en Post 2 exist only in fr - show it Post 3 exist only in en - show it Post 4 exist only in de - show it

User selects de as lang Show Post 1 in de Show Post 2 in fr Show Post 3 in en Show Post 4 in de

Kind Regards Michael

dougwollison commented 3 years ago

Can you post a screenshot of what you're seeing in the Quick Edit form?

As for pulling posts/pages that only exist in one language, your only real option is to unassign the language (set it to None/No Language, which is available unless the Language is Required option is enabled).

The system was built with the intention that every item would either have translations in all languages, or none at all. In your example, how would you expect it to work if one of those french-only posts was eventually translated into german? What would show on the english feed?

mkkeck commented 3 years ago

In your example, how would you expect it to work if one of those french-only posts was eventually translated into german? What would show on the english feed?

When possible a defined fallback language. I think, a website is published in a main language, mainly the spoken language of country. This could be the default fallback language. Okay than, the post have to be in default language too, or it would only dispayed if lang match. That would be not a problem, because you can have posts to display only in certain languages like ads, banners, etc. Perhabs for my previous example it would be nice to set, as you asked, french xor german as default fallback. But I think it would be to much, because in such situation there must be an option for each post, to define it's fallback. I think that does not really make sense in an normal envorinment.

I suggest using the main language from the website as fallback. If post does not exists in main language and is not translated to user's language, than it would not be shown.

dougwollison commented 3 years ago

I'm wondering if this overcomplicates things a bit. Trying to fetch extra posts to make sure both current and default language translations are fetched, then filter out the "duplicates" might be excessive. Maybe a better way is to allow a post to be the designated translation for multple languages? But then that complicates the UI for a situation that's probably pretty rare.

I think the simplest solution for your current situation, where you have some items only in one language but need to show on all versions of the site, is to set the language to None. The system is currently designed to fetch posts that are either in the current language or have no language assigned.