Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Multilingual features  (Read 5747 times)

0 Members and 1 Guest are viewing this topic.

lu-x

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 10
Multilingual features
« on: January 17, 2005, 10:21:18 am »

I would like to have my database not only in German but also in English.
Do I have to have 2 databases? Is there a simple way to connect to a different database, depending on language?
Or would it be simpler to connect a special language file somewhere.

I'm stuck.

Does anybody know?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Multilingual features
« Reply #1 on: January 17, 2005, 05:42:19 pm »

Are you talking about having German and English titles, descriptions, comments, etc for your pictures?  The items that are stored in your MySQL database?
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

lu-x

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 10
Re: Multilingual features
« Reply #2 on: January 17, 2005, 05:49:47 pm »

Yes exactly. I am talking about not only about the whole navigational framework - as it is now - but for a whole different database connect, depending on the language request [index.php?lang=en or de].

Is that easier than attaching a kind of customized php.language file, that contains and translates only the set of the used words of the database into the other language?

I have no idea.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Multilingual features
« Reply #3 on: January 17, 2005, 06:30:33 pm »

For comments this would be pretty easy, since it's a separate table.
 
Create a new table called [yourCPGprefix]_commentsgerman.  The easiest way would be to copy the table and rename it, or you can look in sql/schema.sql and find CPG_comments.  Rename the table to [yourCPGprefix]_commentsgerman, copy that section and execute it with phpMyAdmin.
Code: [Select]
CREATE TABLE [yourCPGprefix]_commentsgerman (
  pid mediumint(10) NOT NULL default '0',
  msg_id mediumint(10) NOT NULL auto_increment,
  msg_author varchar(25) NOT NULL default '',
  msg_body text NOT NULL,
  msg_date datetime NOT NULL default '0000-00-00 00:00:00',
  msg_raw_ip tinytext,
  msg_hdr_ip tinytext,
  author_md5_id varchar(32) NOT NULL default '',
  author_id int(11) NOT NULL default '0',
  PRIMARY KEY  (msg_id),
  KEY com_pic_id (pid)
) TYPE=MyISAM;

In init.inc.php, before
Code: [Select]
if (!file_exists("lang/{$CONFIG['lang']}.php")) $CONFIG['lang'] = 'english';add
Code: [Select]
if ($CONFIG['lang'] == 'german' ) {
    $CONFIG['TABLE_COMMENTS'] .= "german";
}

That should display German comments only to German users, and everyone else gets the English comments.

Titles and captions would be harder, since they are in the pictures table.  It would be easier to have both German and English in the title and caption instead of trying to change the table structure and make changes to the code.

Web translators don't seem to work too well, so I wouldn't try to adapt one to your site.  If you choose that option, you'll have to figure out how to do it - I wouldn't know where to start.
« Last Edit: January 17, 2005, 06:36:15 pm by kegobeer »
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

lu-x

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 10
Re: Multilingual features
« Reply #4 on: January 18, 2005, 10:25:46 am »

Thank you very much for your efforts - this may be a  start. I do not like the solution with 2 languages in one database [English and German titles and captions] - it may be the easiest way to set up coppermine at two different urls each with a different DB in the background and then connect them with links...

The comments are not so important for me.

see the problem at: http://www.lu-x.de/base/

P.S. If I can be of any help in questions of design - let me know.
Ludwig
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Multilingual features
« Reply #5 on: January 18, 2005, 12:21:10 pm »

Why don't you want everything in one database?  Duplicating an entire install just to have a different language is unnecessary.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

lu-x

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 10
Re: Multilingual features
« Reply #6 on: January 19, 2005, 10:36:38 am »

This may be feasible just for English and German but if I want to go on and add Spanish an Chinese later on...?
I would need special fields for every language right - e.g. with a prefix 'en_' or 'de_'....and then wouldn't it be easier upon loading the index.php to find out which language the user has and then just connect to a different database?

? ???
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Multilingual features
« Reply #7 on: January 19, 2005, 05:46:29 pm »

Multiple databases are totally unnecessary.  I have a bunch of different apps using the same database; there isn't any need to create a separate database for each one.  Each app uses a different table prefix (smf_, cpg_, etc) so you can easily tell which table belongs to which app.

Choosing a language specific title/caption would require changing the structure of the pictures table, and changing each query that gathers picture information.  You would have to remove the title/caption from the picture table and put it in a separate table.  That table would have this type of structure: the picture id, the picture title, the picture caption, the language used.  Each picture could be listed numerous times, and Coppermine would choose the entry based on the language field.

To edit all the data for each picture, you could use phpMyAdmin or alter the picture editing functions to pull and display all titles/captions and comments for all languages.

Coppermine wasn't designed to do what want it to do.  The changes required are extensive and would mean any future upgrades wouldn't work without applying all the changes to the new version before you upgrade.

If you want to have a database for each language, you'll have to create a database each time you want to add a language, edit each database every time you upload/edit/delete a picture, and then hard code a switch in config.inc.php to use the correct database name/user/password/table prefix for each language.

In case you misunderstood, I was not offering my services to code this for you.  I don't have the time to do it.  I'm just giving you ideas on how to go about adapting Coppermine to meet your requirements.  If you need someone to underake this task, you should post in the freelancers/paid help board.

From a developer's standpoint, this is something the majority of Coppermine users would never need, so I don't think you'll see this ever becoming core code.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

lu-x

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 10
Re: Multilingual features
« Reply #8 on: January 22, 2005, 07:04:56 pm »

Thank you very much for your answer.

See - I am a designer and photographer not a programmer. In any case I will need some professional help to accomplish having multiple languages in the gallery.
Logged

Cyclist

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Multilingual features
« Reply #9 on: November 14, 2005, 12:30:06 am »

From a developer's standpoint, this is something the majority of Coppermine users would never need, so I don't think you'll see this ever becoming core code.

Are you sure about that? It's nothing for the majority of the english speaking users or users who have an onelingual website but for everybody with multilingual website ist's really importan. As far as I know only Exhibition Engine is able to do that and it's a pity that Coppermine can't!
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.