Jump to content



Latest News: (loading..)

* * * * * 1 votes

AJAX Language Verification (contribution 5831)


  • Please log in to reply
24 replies to this topic

#1   mparrishxx

mparrishxx
  • Members
  • 3 posts
  • Real Name:Marc

Posted 25 March 2008 - 01:43 PM

http://addons.oscommerce.com/info/5831

This module is designed to help all of those with stores in multiple languages.

During the development process, it is very tedious in debugging all of the new variables which are added in one language and then translate them into another language. At times the individual variables are not found, and at other times the act of translating is quite laborious.

This module gives the ability to crawl all of the language folders, index the individual files found, and display all of the variables within the individual files in a grid.

If a file or variable is missing in a language folder, it gives you the ability to add it with one click.

It also uses Google Translate to offer a translation from one language (usually English) in 28 others.

This should help in reducing the time it takes for translating a QA tremendously.

This Module uses AJAX. The installation should take no more than 10-15 minutes, even for a novice. However, some knowledge of Ajax and Javascript may be useful should you want to change any of the functionality.

Please help us to further refine the module.

#2   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 25 March 2008 - 02:03 PM

for a first version release it s already a hell good work
i would post request, ideas and feedback   ;)
MS2

#3   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 25 March 2008 - 02:17 PM

ideas :

1.being able to select and show only file that are missing for one or several languages
2.remove from the listing the files that are not inside the langauge subfolder ; for instance : french.php , english.php, add_ccgvdc_english.php
3. when a file is missing from a language, to have the right ALT when you want to copy the file to te languaage subfolder, for the moment it is "file not exist"
4. for the copy operation, wich is the default language from where the missing file would be copied?
MS2

#4   mparrishxx

mparrishxx
  • Members
  • 3 posts
  • Real Name:Marc

Posted 25 March 2008 - 11:04 PM

Azer

These are all very good suggestions.  

I can do several of them, but elimination of selected directories I would like to see if someone else could do.

I think it also best to leave the language files in the root folder in the crawl, and try to align them based upon the language folders that appear.  For instance, when there are two language folders

languages/english/
languages/french/

we would need to align the files (and 'define' variables) for
languages/english.php
languages/french.php

That way many of the global variables could be translated.  This is also a big job!

mparrishxx

#5   gregy

gregy
  • Members
  • 678 posts
  • Real Name:Gregor
  • Gender:Male
  • Location:Slovenia, Celje

Posted 26 March 2008 - 01:07 PM

hmm .. what about error

Fatal error: Call to undefined function: tep_hide_session_id() in /home/web/domain.com/www/admin/verify_language.php on line 309

#6   jenswl

jenswl
  • Members
  • 3 posts
  • Real Name:Jens Wlodarczyk

Posted 26 March 2008 - 03:22 PM

View Postgregy, on Mar 26 2008, 02:07 PM, said:

hmm .. what about error

Fatal error: Call to undefined function: tep_hide_session_id() in /home/web/domain.com/www/admin/verify_language.php on line 309

Just copy the function tep_hide_session_id from the catalog/includes/functions/html_output.php to catalog/admin/includes/functions/html_output.php or into the verify_language.php (not the best way).

#7   gregy

gregy
  • Members
  • 678 posts
  • Real Name:Gregor
  • Gender:Male
  • Location:Slovenia, Celje

Posted 26 March 2008 - 03:34 PM

thanx .. moving on .. when i click on a file a receive

Fatal error: Call to undefined function: stripos() in /home/web/domain.com/www/admin/includes/functions/verify_language.php on line 30

#8   jenswl

jenswl
  • Members
  • 3 posts
  • Real Name:Jens Wlodarczyk

Posted 26 March 2008 - 04:34 PM

View Postgregy, on Mar 26 2008, 04:34 PM, said:

thanx .. moving on .. when i click on a file a receive

Fatal error: Call to undefined function: stripos() in /home/web/domain.com/www/admin/includes/functions/verify_language.php on line 30

change stripos to strpos

#9   gregy

gregy
  • Members
  • 678 posts
  • Real Name:Gregor
  • Gender:Male
  • Location:Slovenia, Celje

Posted 26 March 2008 - 04:45 PM

works like a charm .. thank you

#10   Jamez

Jamez
  • Members
  • 108 posts
  • Real Name:James

Posted 27 March 2008 - 05:15 AM

View Postgregy, on Mar 26 2008, 04:45 PM, said:

works like a charm .. thank you

Thanks to Jens for the 2 fixes, most of it is now working apart from..
I click a red x to copy it to another language and then get this permission denied error...

Warning: copy(/includes/languages/german/article_header_tags.php) [function.copy]: failed to open stream: Permission denied in /admin/verify_language.php on line 161

Edited by Jamez, 27 March 2008 - 05:16 AM.


#11   Jamez

Jamez
  • Members
  • 108 posts
  • Real Name:James

Posted 27 March 2008 - 05:17 AM

View PostJamez, on Mar 27 2008, 05:15 AM, said:

Thanks to Jens for the 2 fixes, most of it is now working apart from..
I click a red x to copy it to another language and then get this permission denied error...

Warning: copy(/includes/languages/german/article_header_tags.php) [function.copy]: failed to open stream: Permission denied in /admin/verify_language.php on line 161

Ah worked it out already, permissions error on the directories.
It didnt work for me on 755, changed it to 777 temporarily.

#12   Jamez

Jamez
  • Members
  • 108 posts
  • Real Name:James

Posted 27 March 2008 - 06:00 AM

I noticed a few other things too...
What is labelled the "English" directory, is actually the Spanish.

I cant get the Google AJAX translate to work either (it just hangs).
:-"

#13   jbastow

jbastow
  • Members
  • 54 posts
  • Real Name:Janna

Posted 04 April 2008 - 01:56 AM

View Postjenswl, on Mar 26 2008, 11:22 AM, said:

Just copy the function tep_hide_session_id from the catalog/includes/functions/html_output.php to catalog/admin/includes/functions/html_output.php or into the verify_language.php (not the best way).

Good call, thanks :)

#14   jbastow

jbastow
  • Members
  • 54 posts
  • Real Name:Janna

Posted 04 April 2008 - 02:21 AM

Spoke too soon - this doesn't look good:
Warning: fopen(/home/loveher/public_html/includes/languages/english/about_us.php) [function.fopen]: failed to open stream: Permission denied in /home/loveher/public_html/admin/ajax_rewrite_fields.php on line 107

Warning: fwrite(): supplied argument is not a valid stream resource in /home/loveher/public_html/admin/ajax_rewrite_fields.php on line 108

Warning: fclose(): supplied argument is not a valid stream resource in /home/loveher/public_html/admin/ajax_rewrite_fields.php on line 109


I get this when trying to edit or add text to any of my files (I'm editing the English about_us.php file in this example)

Janna

#15   jbastow

jbastow
  • Members
  • 54 posts
  • Real Name:Janna

Posted 04 April 2008 - 02:32 AM

View Postjbastow, on Apr 3 2008, 10:21 PM, said:

Spoke too soon - this doesn't look good:
Warning: fopen(/home/loveher/public_html/includes/languages/english/about_us.php) [function.fopen]: failed to open stream: Permission denied in /home/loveher/public_html/admin/ajax_rewrite_fields.php on line 107

Warning: fwrite(): supplied argument is not a valid stream resource in /home/loveher/public_html/admin/ajax_rewrite_fields.php on line 108

Warning: fclose(): supplied argument is not a valid stream resource in /home/loveher/public_html/admin/ajax_rewrite_fields.php on line 109
I get this when trying to edit or add text to any of my files (I'm editing the English about_us.php file in this example)

Janna


I'm not 100% sure why, but when I try to set permissions to 777 for certain folders, it just reverts back to 755.  There's that little message in DW which says "This command may not work with some servers.".... I'm not sure where to go from here.  Any ideas?

Thanks!
Janna

#16   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 08 April 2008 - 06:30 PM

REQ 1: give a maximum width to the editing page, when i edit my base_language.php the page now take more thatn the width of my screen and impossible to compare the 4 languages

QUE 1: what the red color of the sentence mean

REQ 2: i think we should really be able to switch with a dropdown menu or a radio boutton waht we want to see for me here is what is usefull:

- file missing
- file with missing fields
- when you click on the language, to see only missing fields

QUE 2: when he add a missing fields , is it created at the end of the file or at the same line than the comparaison one

REQ 3: the order of the language in the edition page is alphbetics, it should rather be the order defined in the admin of oscommerce
MS2

#17   h3dave

h3dave
  • Members
  • 24 posts
  • Real Name:Dave
  • Gender:Male
  • Location:MontrĂ©al, Quebec

Posted 18 April 2008 - 08:23 AM

Great Contrib yet,
I had the Stripos trouble first and then the tep_hide as everyone above.

After that everything seemed to work perfectly except if I'm doing a translation by google I've got a popup that says as follows:
<br />
<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in
<b>/homepages/20/xxxxxxxxx/htdocs/xxxxxx/admin/includes/classes/google_translates.php</b>
on line <b>3</b><br />
So this would be my first point.

For the second point, if I'm using the menu to crawl the admin section it says:
Warning: Invalid argument supplied for foreach() in /homepages/20/d189126093/htdocs/loic2/admin/verify_language_images.php on line 160

Warning: Invalid argument supplied for foreach() in /homepages/20/d189126093/htdocs/loic2/admin/verify_language_images.php on line 176
or this :
Warning: Invalid argument supplied for foreach() in /homepages/20/d189126093/htdocs/loic2/admin/verify_language.php on line 184

[b]With this where should be placed the window with comparisons :[/b]
Warning: Division by zero in /homepages/20/d189126093/htdocs/loic2/admin/verify_language.php on line 357

So I am actually lost in all this there is for sure something I don't get, and yeah I noticed that all my french sometimes appear in the portugues section?!?

Kind regards,
Dave
Light travels faster than sound. Thats why sometimes people look bright until they speak...

#18   gregy

gregy
  • Members
  • 678 posts
  • Real Name:Gregor
  • Gender:Male
  • Location:Slovenia, Celje

Posted 16 June 2008 - 03:05 PM

how can i use this on my secure server?

my domain is at www.domain.com and secure is secure.domain.com

i don't have admin directory on secure server!

#19   h3dave

h3dave
  • Members
  • 24 posts
  • Real Name:Dave
  • Gender:Male
  • Location:MontrĂ©al, Quebec

Posted 04 July 2008 - 08:09 AM

View Postgregy, on Jun 16 2008, 11:05 AM, said:

how can i use this on my secure server?

my domain is at www.domain.com and secure is secure.domain.com

i don't have admin directory on secure server!

If what you mean by secure is ssl (https) then you have to provide some more informations as ssl are trickies on some hosts with oscommerce. But actually I am using it on secured servers and have my access to Control panel within the "location" section under "verify language" title.
Light travels faster than sound. Thats why sometimes people look bright until they speak...

#20   mortal

mortal
  • Members
  • 139 posts
  • Real Name:jh

Posted 03 November 2008 - 09:46 AM

Hi. i must say that this is a great contribution. but im facing the same problem as a previous poster [h3dave]

<br />
<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in
<b>/homepages/20/xxxxxxxxx/htdocs/xxxxxx/admin/includes/classes/google_translates.php</b>
on line <b>3</b><br />


i have tried to disable line 3 in that file, but for some reason it still gives me that error, so i dont know if its cached or something


EDIT:
i tried to troubleshoot and disabled the first two lines in the classe file google_translates.php

//    public $opts = array("text" => "Hello", "language_pair" => "en|es");
//    public $out = "";

and it seems to get me going for now

Edited by mortal, 03 November 2008 - 09:51 AM.