Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Plugins & Atahualpa »

qTranslate resets to home language


  #1  
Old Jun 24, 2012, 10:28 AM
JulesG
 
47 posts · Sep 2011
Hi !

Using WordPress 3.4, Atahualpa Theme 3.7.7 and qTranslate 2.5.29

I built my own bilingual menu (French and English) and when in English language, selecting any menu item resets the language to French. When in French, it works correctly and stays in French.

You can see it in action here:
http://="http://julesgobeil.com/phot...photo/?lang=en

A qTranslate FAQ seems to imply that it would be due to improper code in the template:

Quote:
FAQ: Clicking on the Title/Home-Link resets selected language.
This is a template problem. Your template is using get_option('home') to get the link for the front page, which is BAD! get_option is not supposed to be used in templates. There is a function called bloginfo for templates. Use that instead and everything will work the way it is supposed to.
http://www.qianqin.de/qtranslate/for...1cdb0&start=10

I'm using this HTML code:

HTML Code:
<div class="menu_container"><p class="menuitems">

	<!--:fr--><a class="menuitem" href="http://julesgobeil.com/photo/?lang=fr/">Accueil</a><!--:-->
	<!--:en--><a class="menuitem" href="http://julesgobeil.com/photo/?lang=en/">Home</a><!--:-->

	<!--:fr--><a class="menuitem" href="http://julesgobeil.com/photo/photos/?lang=fr/">Photos</a><!--:-->
	<!--:en--><a class="menuitem" href="http://julesgobeil.com/photo/photos/?lang=en/">Photos</a><!--:-->

	<!--:fr--><a class="menuitem" href="http://julesgobeil.com/photo/articles/?lang=fr/">Articles</a><!--:-->
	<!--:en--><a class="menuitem" href="http://julesgobeil.com/photo/articles/?lang=en/">Articles</a><!--:-->

	<!--:fr--><a class="menuitem" href="http://julesgobeil.com/photo/bio/?lang=fr/"> propos</a><!--:-->
	<!--:en--><a class="menuitem" href="http://julesgobeil.com/photo/en/bio/?lang=en/">About</a><!--:-->

	<!--:fr--><a class="menuitem" href="http://julesgobeil.com/photo/services/?lang=fr/">Services</a><!--:-->
	<!--:en--><a class="menuitem" href="http://julesgobeil.com/photo/en/services/?lang=en/">Services</a><!--:-->

	<!--:fr--><a class="menuitem" href="http://julesgobeil.com/photo/contact/?lang=fr/">Contact</a><!--:-->
	<!--:en--><a class="menuitem" href="http://julesgobeil.com/photo/en/contact/?lang=en/">Contact</a><!--:-->

</p></div>
Can you help ?
  #2  
Old Jun 24, 2012, 12:53 PM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Please go to ato->export/import settings export your settings and attach them to a reply
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jun 24, 2012, 01:40 PM
JulesG
 
47 posts · Sep 2011
Thanks for helping me. Here is the requested file

Regards
J
Attached Files
File Type: txt ata-julesgobeilcom-20120624.txt (25.0 KB, 442 views)
  #4  
Old Jun 24, 2012, 02:16 PM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
This is another sad case of computers doing exactly what you told them to do, not what you want them to do. If you go to ato->Add HTML/CSS Inserts->HTML Inserts: Body Top I see you have MANUALLY created a menu in French, so Atahualpa is not doing anything about the menu, you have already constructed it.

p.s. I'd like to know why they think the get_option shouldn't be used. the codex states
Quote:
Function Reference/get option
A safe way of getting values for a named option from the options database table. If the desired option does not exist, or no value is associated with it, FALSE will be returned.
and if you look, the FAQ entry is from 2008!
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jun 24, 2012 at 02:53 PM.
  #5  
Old Jun 24, 2012, 02:49 PM
JulesG
 
47 posts · Sep 2011
Hi Juggledad,

Thanks for your reply.

This is exactly what I write in my first post and I even give the HTML code for the menu I created. If you look at the code, you will see that it contains qTranslate language tags to make it bilingual.

This is the menu that doesn't work properly in English. When switching to a different menu item, the language reverts to French. Try it, the URL is in the first post.

Thanks for helping me.

Regards
J
  #6  
Old Jun 24, 2012, 02:56 PM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what you have in teh css inserts is
HTML Code:
<mycode>

	<div class="logo_container">
		<h1 class="logo"><a href="http://julesgobeil.com/site_web_3/"></a></h1>
	</div>
	<nav>
		<div class="menu_container"><p class="menuitems">
<a class="menuitem" href="http://julesgobeil.com/photo/?lang=fr/">Accueil</a>
<a class="menuitem" href="http://julesgobeil.com/photo/photos/?lang=fr/">Photos
<a class="menuitem" href="http://julesgobeil.com/photo/articles/?lang=fr/">Articles</a>
<a class="menuitem" href="http://julesgobeil.com/photo/bio/?lang=fr/"> propos</a>
<a class="menuitem" href="http://julesgobeil.com/photo/services/?lang=fr/">Services</a>
<a class="menuitem" href="http://julesgobeil.com/photo/contact/?lang=fr/">Contact</a>
		</p></div>
	</nav>

</mycode>
I see NO 'lang=en' in that.

just where do you think you have the code you reference?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Jun 24, 2012, 03:39 PM
JulesG
 
47 posts · Sep 2011
Woops ! I'm so sorry. I'm working from the French site to build the bilingual site and I sent you the wrong CSS Insert. My bad - shame on me !

Attached is the correct one

Regards
J
Attached Files
File Type: txt ata-julesgobeilcom-20120624-1.txt (25.0 KB, 532 views)
  #8  
Old Jun 24, 2012, 03:50 PM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
that contains the same code - those are the EXACT same file byte for byte - sure you didn't send the wrong one?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jun 24, 2012 at 04:35 PM.
  #9  
Old Jun 24, 2012, 05:21 PM
JulesG
 
47 posts · Sep 2011
Something is seriously wrong here. I sent you the correct CSS Insert and, after checking it, I realize that the English code lines have been stripped. Attached is a screen shot in PDF format of the Add HTML/CSS Inserts page. As you can see, the format for each menu item is this one:
Quote:
<!--:fr--><a class="menuitem" href="http://julesgobeil.com/photo/?lang=fr/">Accueil</a><!--:-->
<!--:en--><a class="menuitem" href="http://julesgobeil.com/photo/?lang=en/">Home</a><!--:-->
However, in the CSS Insert, the second part, the English one, is stripped and only the French part remains. I guess it is why it is always reverting to French.

All that remains of the original code is this:
Quote:
<a class=\"footerlink\" href=\"http:\/\/julesgobeil.com\/photo\/?lang=fr\/\">Accueil<\/a>\r\n\r\n\r\n
I have the same lines in Style and Edit Footer because I repeat the menu in the footer. Those have also been stripped of the English content.

What is going on ?
Attached Files
File Type: pdf CSS Inserts.pdf (51.3 KB, 347 views)
  #10  
Old Jun 24, 2012, 08:21 PM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Try disabling all your plugins to see if one is causing the issue. I just put that code in and it remains.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #11  
Old Jun 24, 2012, 09:21 PM
JulesG
 
47 posts · Sep 2011
Hi again,

Thanks for your patience. I just desactivated all plugins - only qTranslate remains. Same problem.

2 thoughts:

1- Should I uninstall Atahualpa and reinstall ?

2- Did you look at the qTranslate FAQ I was referring to ? Clicking on the Title/Home-Link resets selected language. This is the 4th one on this page:
http://www.qianqin.de/qtranslate/for...1cdb0&start=10
I'm not knowledgeable enough to check this unfortunately.

Many thanks for your help. It is much appreciated.

Regards
J
  #12  
Old Jun 24, 2012, 09:28 PM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Try this, disable qtranslate and then add that code in and see if both versions remain.

I don't think re installing would help

Yes I looked at that FAQ, but it is from 2008
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #13  
Old Jun 25, 2012, 06:46 AM
JulesG
 
47 posts · Sep 2011
Good morning,

I really appreciate your help. Thanks for your patience. It took us many tries due to my inexperience but we're getting there...

The code has always remained in "Add HTML/CSS Inserts". It is only stripped from the Atahualpa settings file.

I disabled qTranslate. The code remained in BOTH CSS Inserts and in the Atahualpa Settings file as shown here:
Quote:
<a class=\"menuitem\" href=\"http:\/\/julesgobeil.com\/photo\/?lang=fr\/\">Accueil<\/a><!--:-->\r\n<!--:en--><a class=\"menuitem\" href=\"http:\/\/julesgobeil.com\/photo\/?lang=en\/\">Home<\/a>
Without qTranslate, I get bilingual pages with French followed by English and bilingual menus with 12 items.

Another thought: with qTranslate enabled, the English part is stripped but I can still switch a page from one language to another using the qTranslate widget. Also, when selecting a menu item in either language, it outputs the proper page in the selected language. This should mean that the English menu code is there somewhere in the programs even if it is stripped from the settings file.

Regards
Jules
  #14  
Old Jun 25, 2012, 06:53 AM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
send me a copy of the atahualpa settings WITH both languages in it.

If the the setting file only ends up with one language when doing the export while qtraslate is active, then it is causing the problem for teh export (and how knows what else).
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #15  
Old Jun 25, 2012, 07:17 AM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Ok, I just did a test and looked at some of thier code. It seems the issue is that the plugin has a hook in the get_option code (which is why they are saying the theme shoulldn't use it) and are changing things based on what language you have set for the defaule. IMHO this is wrong and there is nothing the theme can do to correct it.

You are going to have to take this up with the plugin author.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #16  
Old Jun 25, 2012, 08:08 AM
JulesG
 
47 posts · Sep 2011
Hi Juggledad,

In case you still want it, here is the Atahualpa setting file with both languages when qTranslate is inactive.

I understand your answer even if it is not the one I was looking for. However, I have to find a solution because I have too much invested in Atahualpa. I love the theme, it works beautifully and support is outstanding (thanks!). Also, it works beautifully with the WP Photo Album Plus plugin - I will have about 2000 photos in it when finished so I guess you can understand I don't want to make a separate site for each language...

I have posted the problem in the WP qTranslate support forum last Saturday and I still have no response but it is the weekend. Honestly, I'm a bit afraid of the reply I will get if I get one... They will most likely tell me that this is a template problem because it uses the get_option function instead of bloginfo.

Since you have looked at the code, do you think it would be possible, without too much work, to change the code in either qTranslate or Atahualpa to make it work ?

Regards
Jules
Attached Files
File Type: txt ata-julesgobeilcom-20120625(1).txt (26.7 KB, 485 views)
  #17  
Old Jun 25, 2012, 08:41 AM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Can you tell me why you are putting the menu code in the CSS Inserts BODY and not just editing the pages and putting the french and english page titles in? If you do that, you can use eithor the Atahualpa menu's or create a wordpress custom menu and they seem to work fine
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #18  
Old Jun 25, 2012, 08:58 AM
JulesG
 
47 posts · Sep 2011
Interesting question ! I have decided to do this when I started working with WordPress and Atahualpa to gain complete control over the looks and format of the header. I wanted some features that I was unable to put in the page menus: thin line above and below the menus, repeat the menus in the footer, change a menu item to underlined bold when hovering.

I was unable to code these to work within Atahualpa so I switched to HTML in HTML Inserts: Body Top. If you look below that code in CSS Inserts, you will see a section called /*-- Menu -- */ that countains all the style and format tags. This code origins from "The Turning Gate", that makes web engines for Adobe Photoshop Lightroom - I have modified it to serve my purpose.

With time I have gained some expertise in Atahualpa and programming, maybe I should try it again as you suggest. Do you really think it could work ?

Regards
Jules
  #19  
Old Jun 25, 2012, 09:10 AM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Quote:
I wanted some features that I was unable to put in the page menus: thin line above and below the menus,
use the %bar1 and stle it the way you want
Quote:
repeat the menus in the footer
use a wordpress custom menu - add a widget area to the footer, add the custom menu widget there

My quick test seems to indicate that it will work, you will have to try it in depth.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #20  
Old Jun 25, 2012, 09:11 AM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Quote:
I wanted some features that I was unable to put in the page menus: thin line above and below the menus,
use the %bar1 and stle it the way you want
Quote:
repeat the menus in the footer
use a wordpress custom menu - add a widget area to the footer, add the custom menu widget there

My quick test seems to indicate that it will work, you will have to try it in depth.

for a quick test, just add '%bar1 %pages %bar1' to the 'Configure Header area' option - you will need to stle the %bar1 but worry about that later
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #21  
Old Jun 25, 2012, 09:36 AM
JulesG
 
47 posts · Sep 2011
OK, I'll try it. It may take some time and I will report to you when it is done.

Many thanks again for your SUPER help. It is much appreciated.

Best regards
Jules
  #22  
Old Jun 25, 2012, 04:33 PM
JulesG
 
47 posts · Sep 2011
Well, it worked !!

Here is the page:
http://julesgobeil.com/photo/accueil/?lang=en

The logo image switches languages
The top custom menu works fine

However, I have been unable to insert a custom menu in the footer. When I create a widget area in the footer, the logo in the header stops switching according to language.

I tried it twice with the same result. Here is what happens to the contents of "Style and edit Header Area / Show Logo Image ?"

Contents before inserting a widget in the footer:
Quote:
[:fr]logo_fr.png [:en]logo_en.png
Content after inserting the widget
Quote:
logo_en.png
This is not major. Yes I would like to have a logo in the footer but I guess I can live without it.

Here is the code I am inserting in Style & Edit Footer / Footer Content to create the widget:
Quote:
<?php bfa_widget_area('name=footer-widget'); ?>
I guess I tried hard enough on that one to leave it like that, unless you have another bright idea.

Regards
Jules
  #23  
Old Jun 25, 2012, 05:56 PM
juggledad's Avatar
juggledad
 
23,574 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
this is qtranslate messing things up again. do this, add the widget area THEN add the
HTML Code:
[:fr]logo_fr.png [:en]logo_en.png
to the 'Show Logo Image?'
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #24  
Old Jun 26, 2012, 10:43 AM
JulesG
 
47 posts · Sep 2011
Well, I tried your suggestion and it does not seem to work at my end. This qTranslate seems to be quite tricky. I already spent too much time on that footer menu - I think I'll forget it for now.

I still have to implement all my plugins and see if they work with qTranslate.

Thanks for your help. Much appreciated.

Jules

Last edited by JulesG; Jun 27, 2012 at 09:08 AM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change header image depending on language (using qTranslate) ? marsyg Header configuration & styling 5 Dec 27, 2010 09:58 AM
Titles appear in one language only with qTranslate anneks Plugins & Atahualpa 3 Oct 21, 2009 09:25 AM
qtranslate incompatibility Kolya Languages & Translations 0 Jul 21, 2009 04:56 PM
Put the qTranslate language selector into the header or page menu DarrenNI Header configuration & styling 1 Jun 19, 2009 05:01 AM


All times are GMT -6. The time now is 10:06 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.