Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Use two different languages in Links SQL 2.0

Quote Reply
Use two different languages in Links SQL 2.0
Hi,
Now we have set up links sql 2.0 properly in our site and we set a copy in our standalone pc as an offline version. The both copies work well. Now we need to know how to build it with info using two languages, e. g. English and Arabic, so a search can be made in both languages.
Can anybody help us or advise us how this can be achieved?


wewe
Quote Reply
Re: Use two different languages in Links SQL 2.0 In reply to
You need to use different fonts, english and arabic.
That means you need to create all fields separate for each language and use different templates for each language.

I dont know how links can works with forreign fonts like cyrillic or arabian.

Maybe someone of the staff or a veteran can give an answer.

Michael

Quote Reply
Re: Use two different languages in Links SQL 2.0 In reply to
Hi,
I ask tgis question before in Links SQL 2.0 pre sale and I got several answers.
I tried the 3rd solution which Eliot gave me in following link:
http://www.gossamer-threads.com/perl/forum/showflat.pl?Cat=&Board=LSQLQuest&Number=129581&page=&view=&sb=&vc=1
I duplicted the columns of the tables and then translated the templates to have 2 sets of templates one in English and the other in arabic.
Then I searched in the dynamic file page.cgi but could not understand what things I have to change to let the script work using the two language with dual languages search, and where to put the built pages for the different languages.
Please help me.
Thanks


wewe
Quote Reply
Re: Use two different languages in Links SQL 2.0 In reply to
Hi,

You don't build pages anymore, everything is dynamic. Your english home page is:

page.cgi?t=english&d=1

and your arabic home page is:

page.cgi?t=arabic&d=1

That should be all you have to do.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Use two different languages in Links SQL 2.0 In reply to
Hi,
Thank you for your help, but I still stuck in the middle way since I'm just a newbie in this matter.
I translated the template. I'm using yahoo templates, I created two directories
/templates/arabic for the translated temples to arabic
/templates/english for the english templates
I called the arabic templates using page.cgi?t=arabic&d=1 and the english ones using page.cgi?t=english&d=1. however, the problem is that the page that I always had the template that I want but with the same categories (english). I duplicated most of the field in each table using Mysqlman accompanying the Links SQL 2.0, e.g. in the category table I have full_name field for english names and full_namea for arabic names, however I did not duplicate the ID field for example since it should be the same between the two languages because the two versions should be synchronous and have the same data in two languages. Then, I entered the arabic name of the existing english categories using also mysqlman. Now how can I can let the page.cgi read from the tables so that it reads the arabic fields and provide the info to the arabic template so that I can have a full arabic page, and reads english fields to provide them to english teplates and have the english pages.
I want to have two different versions one in arabic and the other in english without duplicating all Links SQL 2.0 which need a new license.
Please help, I hope you all be patient with me because I'm still a newbie and I used to continue my way in the light of your help.
Thanks in advance,


wewe
Quote Reply
Re: Use two different languages in Links SQL 2.0 In reply to
Hi,
Anybody there who can answer my questions?
Please help!

wewe
Quote Reply
Re: Use two different languages in Links SQL 2.0 In reply to
Hey Alex and Eliot,
Where are you?
Please reply to my question. I translated the templates. What to do now?
Please read my past post to know the details.
I depend on your help, so please do not be late.
Thankx.

wewe
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