Problem w/QueryTranslator.php, default_language <> EN

A place for users and developers of the Xataface to discuss and receive support.

Problem w/QueryTranslator.php, default_language <> EN

Postby jonbfl » Mon Oct 03, 2011 2:55 pm

Over the weekend I had posted and then withdrew a problem I had located in QueryTranslator.php. I had originally thought it might be browser specific or Java related - not the case. When the default language is not 'en', there is a problem selecting 'en' as the destination language.

All of this assumes that multilingual content is on, input&outout encoding are set to UTF-8, and a default_language is set to a value other than 'en'

Part 'A' of issue - No matter what you select in the drop down boxes in 'translate mode', for source language, after a brief moment the 'selected value' will jump back to 'en' - HOWEVER the correct URL is generated - i.e. "...&-sourceLanguage=es"

the same behavior is exhibited for 'destination language'; No matter what is selected - the drop down box will 'snap' to English after a moment.

Part B - At this point - the behavior deviates.

IF the 'destination language' is anything OTHER than English - although the displayed value is still 'English' for Destination Langauge, the URL will be OK -
i.e "...&-sourceLanguage=es&-destinationLanguage=eu" to go from Spanish 'native' to Basque -

IF the 'destination language is English, however, you will not get a refreshed URL - you will still have only the source language in the URL. The ONLY way to get QueryTranslator to work -- where English is the destination language, is to manually change the destination language argument in the URL and refresh - you will get the 'correct form' and when it saves, the record will be written to the correct 'xxxxx_en' table.

This absolutely drove me nuts finding it... :shock:

I did not discover this bug earlier, as my test application had 'en' as the default language, and, in that case, there is never a need to select 'en' as the destination language. :oops: need better decision on how close to match all criteria.

synopsis of conf.ini

Code: Select all
title="principalB"
multilingual_content=1
default_language = es
default_oe=UTF-8
default_ie=UTF-8
[_tables]
...
[languages]
es="Castellano"
eu="Euskara"
en="English"
fr="Français"


Thanks very much
jonbfl
 
Posts: 66
Joined: Thu Jul 28, 2011 8:20 pm

Re: Problem w/QueryTranslator.php, default_language <> EN

Postby shannah » Tue Oct 04, 2011 9:31 am

Yes. I recently noticed this bug also. I fixed it in SVN but haven't merged it yet to the 1.3.x branch. Will do that today.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Problem w/QueryTranslator.php, default_language <> EN

Postby jonbfl » Wed Oct 05, 2011 10:23 am

Hi Steve -

Since I have not yet got a mirror of your repository working (its on the list, but after beta launch) -- :lol:

Was Dataface/QueryTranslator.php the only file updated for the fix???

Thanks

Jon B
8)
jonbfl
 
Posts: 66
Joined: Thu Jul 28, 2011 8:20 pm

Re: Problem w/QueryTranslator.php, default_language <> EN

Postby shannah » Wed Oct 05, 2011 10:36 am

Actually, QueryTranslator.php wasn't the problem. Changed files were Dataface/LanguageTool.php, Dataface/TranslationForm.php, and actions/translate.php

To see the exact change, go to:
http://xataface.com/svn/log.php?repname ... =0&isdir=1

And compare rev. 2837 to 2842

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Problem w/QueryTranslator.php, default_language <> EN

Postby jonbfl » Wed Oct 05, 2011 12:43 pm

I had looked in TranslationForm.php trying to trace how things worked, but I have not yet grokked how everything fits. This will be instructive

Thanks so much
8)

1st two beta testers tomorrow! (just a dip in the shallow end of the pool) :mrgreen:
jonbfl
 
Posts: 66
Joined: Thu Jul 28, 2011 8:20 pm

Re: Problem w/QueryTranslator.php, default_language <> EN

Postby jonbfl » Sat Oct 08, 2011 4:09 pm

thanks very much, It is now working like a charm!

:D
jonbfl
 
Posts: 66
Joined: Thu Jul 28, 2011 8:20 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 22 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved