Loading languages

3 views
Skip to first unread message

hardik7681

unread,
Jun 26, 2008, 2:30:28 AM6/26/08
to Google AJAX API, patelh...@gmail.com
Hi,
I have a PHP page that uses the google translation API. Currently I
have used google.load("language",1) and
google.setOnLoadCallback(init);
The init function loads the languages in the two combo boxes and
everything is working fine.
Now my requirement is to develop something similar to "http://
www.google.com/translate_t",

Now when i compare the 2 pages (mine and the what google has), the 2
language dropdown boxes are different, my language dropdown does not
have "Finnish" option and it has an "unknown" option at the end while
what google has the "Finnish" option and does not have the "unknown"
option.

So i was just wondering how can I make the dropdown in my page similar
to that what google has, any help would be greatly appreciated.

Thanks,
Hardik Patel.

Ben Lisbakken

unread,
Jun 26, 2008, 4:30:12 PM6/26/08
to Google-AJAX...@googlegroups.com
Hardik --

You could use the enum to construct your drop downs (http://code.google.com/apis/ajaxlanguage/documentation/reference.html#LangNameArray).  Then just leave out the Unknown option at the end, or change it to Detect Language (since that's what specifying a language of Unknown means).

-Ben

hardik7681

unread,
Jun 27, 2008, 12:03:54 AM6/27/08
to Google AJAX API
Hi Ben,
Does it mean that I have to hardcode the values to construct the drop
downs OR is there any way that I can populate the values in the drop
downs dynamically?

Hardik.

On Jun 27, 1:30 am, Ben Lisbakken <lisba...@google.com> wrote:
> Hardik --
>
> You could use the enum to construct your drop downs (http://code.google.com/apis/ajaxlanguage/documentation/reference.html...).
> Then just leave out the Unknown option at the end, or change it to Detect
> Language (since that's what specifying a language of Unknown means).
>
> -Ben
>

Ben Lisbakken

unread,
Jun 27, 2008, 3:31:16 PM6/27/08
to Google-AJAX...@googlegroups.com
You could loop through the enum, printing out <option> tags surrounding each item in the enum.

-Ben

hardik7681

unread,
Jun 30, 2008, 12:11:29 AM6/30/08
to Google AJAX API
Hi Ben,
I did exactly that but there are 2 problems now,

1) In the source drop down i cannot get "finnish" language option (btw
I am using isTranslatable() function to populate the drop downs).
2) If you compare my page here: - http://www.dailysouls.com/index.php?page=translate
with the google translate page, the destination drop down language
options are different, i.e. in the first dropdown google has only
"Chinese" as an option whereas in my case i have got "Chinese",
"Chinese Simplified" and "Chinese Traditional" as 3 different
options...

So my question still remains unanswered , "how can I make the drop
downs in my page similar to that what google has ???"

Thanks,
Hardik.


On Jun 28, 12:31 am, Ben Lisbakken <lisba...@google.com> wrote:
> You could loop through the enum, printing out <option> tags surrounding each
> item in the enum.
>
> -Ben
>

Ben Lisbakken

unread,
Jun 30, 2008, 1:49:47 PM6/30/08
to Google-AJAX...@googlegroups.com
Hardik --

1)  We are investigating why "finnish" returns false in the isTranslatable() method.
2)  If you don't want to include anything other than Chinese, then in the for loop don't include them (use an if statement).

-Ben

hardik7681

unread,
Jun 30, 2008, 11:48:49 PM6/30/08
to Google AJAX API
Thanks Ben.
Is there any way when I would come to know when the "finnish" language
would return true in the isTanslatable() method?

Hardik

On Jun 30, 10:49 pm, Ben Lisbakken <lisba...@google.com> wrote:
> Hardik --
>
> 1) We are investigating why "finnish" returns false in the isTranslatable()
> method.
> 2) If you don't want to include anything other than Chinese, then in the
> for loop don't include them (use an if statement).
>
> -Ben
>

Ben Lisbakken

unread,
Jul 1, 2008, 1:34:48 AM7/1/08
to Google-AJAX...@googlegroups.com
Hardik --

We have realized our error and have begun work on it.  It should be fixed in a short amount of time.

Regards,
Ben

hardik7681

unread,
Jul 3, 2008, 11:54:19 PM7/3/08
to Google AJAX API
Thanks Ben.

On Jul 1, 10:34 am, Ben Lisbakken <lisba...@google.com> wrote:
> Hardik --
>
> We have realized our error and have begun work on it. It should be fixed in
> a short amount of time.
>
> Regards,
> Ben
>

hardik7681

unread,
Jul 4, 2008, 5:30:32 AM7/4/08
to Google AJAX API
Thanks Ben once again,
Finnish language is now returns true in the isTranslatable() method
and is working fine.

Hardik
Reply all
Reply to author
Forward
0 new messages