patch to fallback on default language (or first available)

Any suggestions on how to improve qTranslate? Post here!

patch to fallback on default language (or first available)

Postby PowerKiKi » Tue Jan 25, 2011 1:34 pm

Hello,

I needed to have translated website, but not all content is translated (unfortunately). So in my case I just want to display the default language version of the content if no translation is available (no extra "Enligsh" prepended). This was not possible with current qTranslate (2.5.14), so I patched it to add a new option.

Image

The patch (for Wordpress 3.0.4) is attached to this post, and the fork is also available there: https://github.com/PowerKiKi/qTranslate

Hopefully it will be useful to someone else...


[edited with new repository URL]
Attachments
add option to fallback on default language.patch
(7.57 KiB) Downloaded 207 times
Last edited by PowerKiKi on Thu Aug 04, 2011 6:49 am, edited 1 time in total.
PowerKiKi
 
Posts: 15
Joined: Tue Jan 25, 2011 11:50 am

Re: patch to fallback on default language (or first available)

Postby nathanvda » Sat Feb 12, 2011 3:30 pm

Awesome work! I was just looking how i should implement this myself.
Nice how you integrated it with the configuration page.
Works like a charm.

Thank you very much! I also hope the original author will pull your changes in.
nathanvda
 
Posts: 2
Joined: Sat Feb 12, 2011 3:10 pm

Re: patch to fallback on default language (or first available)

Postby Qian Qin » Tue Mar 01, 2011 4:09 pm

this will not be included because of several reasons. As I have written may times before:
1. pages are marked with a language, which you violate when showing a different language then defined.
2. you will have duplicate content on different urls. bad for seo.
3. people dont want to see other language content if they chose one language.
Qian Qin
Site Admin
 
Posts: 964
Joined: Thu Jun 19, 2008 12:14 pm
Location: Germany

Re: patch to fallback on default language (or first available)

Postby PowerKiKi » Wed Mar 02, 2011 9:38 am

I agree for 1. and 2., but I am less sure about 3. With standard options, untranslated content somehow break the layout of pages (I'm thinking menus, which are usually designed for short texts) and is not very user-friendly in my opinion. The new "show default language" option is not perfect either, but at least it allows me to nicely have untranslated menus besides translated content. Obviously the real solution would be to translate everything... if only it was less time consuming ;-)

Anyway thank you for your work, except this detail, I very much appreciate qTranslate. Would you be unhappy about the (small) fork, then just let me know.

By the way the fork was updated to latest version of qTranslate (2.5.16 for wordpress 3.1) and is still available there: https://github.com/PowerKiKi/wordpress_plugins
PowerKiKi
 
Posts: 15
Joined: Tue Jan 25, 2011 11:50 am

Re: patch to fallback on default language (or first available)

Postby lalit_at_forums » Mon Mar 28, 2011 2:44 pm

How can I use this patch?
lalit_at_forums
 
Posts: 1
Joined: Mon Mar 28, 2011 2:43 pm

Re: patch to fallback on default language (or first available)

Postby PowerKiKi » Mon Mar 28, 2011 8:42 pm

If you are not sure about how to use the patch, then the easiest way is to download the complete, patched version here: https://github.com/PowerKiKi/wordpress_ ... all/master
Then just install it as usual (overwrite existing plugins).
PowerKiKi
 
Posts: 15
Joined: Tue Jan 25, 2011 11:50 am

Re: patch to fallback on default language (or first available)

Postby nathanvda » Sat Jun 11, 2011 9:37 pm

My use-case is that my site contains pages I want to be translated in two languages, but my blog I only want to write in a single language.
So my blog-page should look like an english page, while my about-me pages and stuff, I also translate that in my mother tongue.

Is there another, better solution for something like that than?
nathanvda
 
Posts: 2
Joined: Sat Feb 12, 2011 3:10 pm

Re: patch to fallback on default language (or first available)

Postby PowerKiKi » Sun Jun 12, 2011 2:27 am

Honestly I am not sure if there is a better solution than my modification of qTranslate. A few months ago I saw a few plugins with different approach: instead of translating each post they had the whole structure duplicated, so you write two different posts (and comments are obviously separated). In this case visitor only saw their own language and everything else is totally hidden. It allows you to build a different structure (pages/blogs) for different languages, which may be nice... or may be over-complicated...

What I know for sure, is that my modification allows you to do what you need. Feel free to look around for other extensions though...
PowerKiKi
 
Posts: 15
Joined: Tue Jan 25, 2011 11:50 am

Re: patch to fallback on default language (or first available)

Postby huyz » Tue Jul 05, 2011 2:47 am

I also agree with PowerKiki on this one, and I'll be using this patch.

Qian Qin wrote:this will not be included because of several reasons. As I have written may times before:
1. pages are marked with a language, which you violate when showing a different language then defined.
2. you will have duplicate content on different urls. bad for seo.
3. people dont want to see other language content if they chose one language.


Here are my thoughts:
1. I think only machines and geeks really care about that. I'm a geek too, but I recognize that most people don't care that much about misclassification when the benefits of having content -- any content -- are greater than having no content at all.
2. This is easily solved with Canonical URLs: http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html. @PowerKiki Can your plugin handle that? Another solution would be to output an iframe which contains the content in the default language. Further research would have to be done to confirm that the displaying URL doesn't get search-engine credit for the iframe content, but from what I read on the internet, it would work.
3. This is not a problem. For example, when you Google, you end up with hits in all sorts of languages. (Most people do not change their Google language settings and just get this default behavior.) Do people hate Google for it? I don't think so. In fact, if you click on a link, Chrome (and browsers with the proper extensions) will offer to auto-translate the page for you. The internet is multilingual and people are definitely not afraid of hitting a page in a foreign language, especially if that language default is English.

In general, it's nice to have a qTranslate in github because it's awesome to have a way to fork and make our own modifications that won't be accepted into the main release. That way, when the main qTranslate changes, it's easy to merge changes. I would also like to have my own modifications because I'm not sure my fix about browser detection was ever integrated.
Last edited by huyz on Tue Jul 05, 2011 2:52 am, edited 1 time in total.
huyz
 
Posts: 5
Joined: Mon May 04, 2009 9:34 am

Re: patch to fallback on default language (or first available)

Postby huyz » Tue Jul 05, 2011 2:51 am

@PowerKiki is there a way that you can give qTranslate its own repository? There really is no reason to bundle a bunch of WP plugins into single repository.
huyz
 
Posts: 5
Joined: Mon May 04, 2009 9:34 am

Next

Return to qTranslate Suggestions Forum

Who is online

Users browsing this forum: No registered users and 1 guest