Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Alex] Use two different languages in Links SQL 2.0

Quote Reply
Re: [Alex] Use two different languages in Links SQL 2.0 In reply to
Shocked Dear Alex and Eliot;

After a long time of studying Links SQL with my modest knowlegde in Perl, Cgi, and DB I succeeded in building pages in two different languages simaltaneously. And from a user point of view, he can browse categorys in both languages. My next step which I work on is to enable searching in both languages.

I made some modifications, I added columns to category table as follows: Namea, Full_Namea, and Descriptiona for arabic categories that correspond to english ones. I duplicated some files to let the second copy read the arabic columns and build the arabic pages, these files are: page.cgi, add.cgi, modify.cgi, search.cgi, rate.cgi, user.cgi, subscribe.cgi, nph-build.cgi, Build.pm, and siteHTML.pm. And I added some subroutines in the category.pm and link.pm to deal with arabic info. Now my major problem is that I want to enable inserting the arabic category name from the admin area. I tried to make some changes in the category.pm as a sample please read the following:

sub disp_fatherid_form {
# -------------------------------------------------------------------
# Display the list of subcategories as either a drop down list of a text box.
#
my ($self, $col, $rec) = @_;
my $font = $self->{font};
my $out;
my $form_name = $self->{multiple} ? "$self->{multiple}-FatherID" : 'FatherID';

if ($CFG->{db_gen_category_list}) {
my $sth = $self->{db}->select ( ["DISTINCT Full_Name, ID"] );
my %names;
if ($sth) {
while (my ($name, $id) = $sth->fetchrow_array) {
$names{$id} = $name;
}
}
$names{0} = '--Root--';
my $select = $self->select ( { name => $form_name, values => \%names, blank => 1, sort => sub { lc $_[0] cmp lc $_[1] }, value => defined $rec->{FatherID} ? $rec->{FatherID} : "" });
$out = qq~
<tr><td valign=top><font $font>Subcategory of</font></td><td><font $font>$select<input type=hidden name="FatherID-opt" value="="></td></tr> ~;
my $sth = $self->{db}->select ( ["DISTINCT Full_Namea, ID"] );
my %names;
if ($sth) {
while (my ($name, $id) = $sth->fetchrow_array) {
$names{$id} = $name;
}
}
$names{0} = '--ΜΠΡ--';
my $select = $self->select ( { name => $form_name, values => \%names, blank => 1, sort => sub { lc $_[0] cmp lc $_[1] }, value => defined $rec->{FatherID} ? $rec->{FatherID} : "" });
$out = qq~
<tr><td valign=top><font $font>Subcategory of arabic</font></td><td><font $font>$select<input type=hidden name="FatherID-opt" value="0"></td></tr> ~;

}



Where Full_Namea is the arabic field. However, I foud that the final result I got the arabic category names in the same location in the page above the english names so I can see the final result which is the arabic categories. Could you please help me in making 2 table cells one hold the menu of english category list and the other for the arabic one.

Thank in advance.
wewe
Subject Author Views Date
Thread Use two different languages in Links SQL 2.0 wewe 3483 Apr 3, 2001, 5:16 AM
Post Re: Use two different languages in Links SQL 2.0
Sir Up 3378 Apr 6, 2001, 1:52 PM
Thread Re: Use two different languages in Links SQL 2.0
wewe 3313 Aug 26, 2001, 4:27 AM
Thread Re: Use two different languages in Links SQL 2.0
Alex 3310 Aug 26, 2001, 10:47 PM
Thread Re: Use two different languages in Links SQL 2.0
wewe 3283 Aug 30, 2001, 12:47 AM
Post Re: Use two different languages in Links SQL 2.0
wewe 3262 Sep 2, 2001, 11:27 PM
Post Re: Use two different languages in Links SQL 2.0
wewe 3241 Sep 5, 2001, 1:40 PM
Post Re: [Alex] Use two different languages in Links SQL 2.0
wewe 3194 Jan 31, 2002, 6:36 AM