Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

working with different languages.

Quote Reply
working with different languages.
Hi,
I want to use different languages with Links SQL 2.0, i.e. having the appearance of the pages with two choices one to see english pages and the other for seeing arabic pages. Also, it is necessary that the search be in english and in arabic. Please note that Arabic is a language that does not use latin letters.
Consequently, is it possible to duplicate the data in the DB to be in english and arabic, so a user can search in english and in arabic? Can find a solution for me?

wewe
Quote Reply
Re: working with different languages. In reply to
If you want two sets of LINKS tables (not databases...think out of the flat file system) with different data, but share the same link, then you could do one of the following:

1) Add duplicated fields like the Description field in the LINKS table and then add a new field called Language (this should be an ENUM field - Arabic/English)[/b]. Then you could possibly duplicate the build process across a different set of folders for the Arabic veruse English pages.

OR you could:

2) Use two licenses of Links SQL to cleanly build two different directories without hacking the scripts.

OR you could:

3) Simply use the DYNAMIC script called page.cgi and create a duplicate set of template files in Arabic versus English. Then you would use page.cgi to call the different template sets: English versus Arabic. Out-of-the-box, Links SQL already comes with a set of different templates.

Regards,

Eliot Lee
Quote Reply
Re: working with different languages. In reply to
We have used Links SQL 1.1 in a multi language directory (and coincedentally, an arabic-english directory). The easiest way to do what you want is to use dynamic mode.

1. Add new columns English_Title, Arabic_Title, English_Description, Arabic_Description, etc.

2. Create two template sets, english and arabic.

3. Go to page.cgi?t=arabic for the arabic ones, and page.cgi?t=english for the english side.

Hope that helps,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: working with different languages. In reply to
Thanks all. You gave me useful info.

wewe
Quote Reply
Re: working with different languages. In reply to
Using different template sets sounds like the best solution for the dynamic mode. However, if I want to use built html files, than that's no option.

It would sound more natural to have several files in each directory, one for each language version. Something like:

www.site.com/A/B/C/index.html - English version
www.site.com/A/B/C/arabic.html - Arabic version

Of course, each page uses a different set of templates, each adapted to work with the proper database columns (title_english, title_arabic, etc.). So I guess the question is:

Is it possible to use simultaneously several template sets with a "static" (built) directory, each template working with the same categories (and hence directory tree), but generating different files for each set of templates?

If the answer is "no", then how easy is it for an average programmer to tweak the system this way? Would this require making changes in the "kernel" of the system (hence require a "hack"), or could a plugin do the job?

Thanks in advance.
Alexander

Quote Reply
Re: working with different languages. In reply to
You could use separate nph-build.cgi and reference a different SiteHTML.pm (these separate SiteHTML.pm files should reference different template files than the main SiteHTML.pm file) to build the other set of "static" pages...but you might want to check with Alex before doing this...since you might have to purchase additional licenses for each Language...

Regards,

Eliot Lee
Quote Reply
Re: working with different languages. In reply to
Hi,

It's fairly easy to do as a hack, a little more difficult to do properly. Basically, you want to alter $CFG->{build_root_url} and $CFG->{build_root_path} in nph-build.cgi so that if you goto nph-build.cgi?t=arabic then it builds to http://yoursite/arabic and if you pass in nph-build.cgi?t=english then it builds to http://yoursite/english.

It's not too difficult a mod to do.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: working with different languages. In reply to
Alex, as far as I understand the solution you suggest would result in the following file structure:

www.site.com/english/cat1/cat2/index.html - English version
www.site.com/arabic/cat1/cat2/index.html - Arabic

What I had in mind was different:

www.site.com/cat1/cat2/index.html - English
www.site.com/cat1/cat2/arabic.html - Arabic

The main difference is the ease of use - in the second case you can link to the other version with:

<a href=arabic.html>Arabic</a>

And it is the same link on ALL pages! That is because both language files are located in the same directory.

However, when using two parallel sets of directories (as suggested by Alex), you have to find a way to determine the path to the other directory:

<a href=/arabic/cat1/cat2/>Arabic</a>

Of course, this link will be unique for each category page. This may be quite simple to achieve, but why do it when there is a potentially easier way?

There is also a usability issue here: some people may change language by "hacking" the url in the browser's address field. Most do it by deleting something from the end of the url, and adding something instead. So placing the language-specific part of the url at the end seems like a better idea.

Sorry for being so picky - really have to make sure Links can perform everything I need.

Alexander

Quote Reply
Re: working with different languages. In reply to
That is something that will be hard to get around with static sites.

This is why sites will have /en or /fr or /de in the paths, to show
the different trees.

With dynamic sites you can use t=<%cooke_languge%> to pick which set
of templates to use.


PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: working with different languages. In reply to
Hi,

It's fairly easy to add a link that will switch from one template set to the other, you just need to replace the word english with arabic in the url. This can be done in the templates with a one or two line function.

However, the way you suggest might work (I just haven't tried it). You could change $CFG->{build_index} from 'index.html' to 'arabic.html' depending on what gets passed in. I don't see any major problem with that..

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: working with different languages. In reply to
Hi All,
Attn. Alex & Eliot
I want to have two options with Links SQL 2.0 one for Arabic and the other for English language. I read your replies and did not understand exactly what did you meant by "duplicate set of template files" and
"Go to page.cgi?t=arabic for the arabic ones, and page.cgi?t=english for the english side."
Could you please explain in more details.
Thanks in advance.

wewe
Quote Reply
Re: working with different languages. In reply to
I think all you need to do is put all your arabic templates in a directory called arabic and the english templates in a directory called english, then you can call page.cgi like page.cgi?t=arabic and the arabic templates will show and page.cgi?t=english and the english templates will show.


Mods:http://wiredon.net/gt/download.shtml
Installations:http://wiredon.net/gt/