Multilingual weblog
Posted: 15 June 2005 04:09 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  72
Joined  05-25-2005

As I do have a large amount of international visitors I’m thinking of creating a multilingual weblog. What would be the best approach?

1. Just setting up a separte English weblog - so you would have a Dutch and English weblog

or

2. Adding a field “english” and having the translation per entry.

I would prefer the 2nd option as that would make my entries easier to manage, but is it somehow possible to have only the english fields displayed or only the dutch fields (with some cookie or something..)?

 Signature 

Random Garfield comic? from 1980-2004
Dutch Bakkenes Blog

Profile
 
 
Posted: 15 June 2005 04:42 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1477
Joined  09-16-2004

Michiel, have a look at this thread from a while ago that handled multiple languages on a site.
I tried Sue’s suggestion (using url segments combined with a weblog that has custom fields with an ” _en” or “_de” extension to indicate language) and it works flawlessly.
It’s a long thread so you’re in for a good read wink

 Signature 

Peace, e-man.
stookstudio.com, websites built with care and web standards. LinkedIn profile

Profile
 
 
Posted: 15 June 2005 04:43 PM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

One method I just thought of:

If you offer more than one Language Pack, then users can select which Language Pack to use under My Account > Localization Settings (or through their public profile section).

If the user is logged in, then that information would be accessible via PHP.  So, you could do something like this:

{exp:weblog:entries weblog="yourweblog" ...... }

  
....

  
<?php
    
global $SESS;

    
$language = $SESS->userdata['language'];

    if (
$language == "english")
    
{
    ?>
{english_field}
    <?php
    }
    
else if ($language == "spanish")
    
{
    ?>
{spanish_field}
    <?php
    }
    
else
    
{
    ?>
{some_other_language_field}
    <?php
    }
  ?>

{
/exp:weblog:entries}

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 15 June 2005 04:58 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  72
Joined  05-25-2005

Thanks guys…
@e-man, yup.. long thread grin

 Signature 

Random Garfield comic? from 1980-2004
Dutch Bakkenes Blog

Profile
 
 
Posted: 16 June 2005 06:16 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12779
Joined  04-29-2002
Chris Curtis - 15 June 2005 04:43 PM

One method I just thought of:

If you offer more than one Language Pack, then users can select which Language Pack to use under My Account > Localization Settings (or through their public profile section).

Great idea, Chris! That would work well.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 30 July 2005 03:53 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  144
Joined  06-19-2005
Chris Curtis - 15 June 2005 04:43 PM

One method I just thought of:

If you offer more than one Language Pack, then users can select which Language Pack to use under My Account > Localization Settings (or through their public profile section).

If the user is logged in, then that information would be accessible via PHP.  So, you could do something like this:

{exp:weblog:entries weblog="yourweblog" ...... }

  
....

  
<?php
    
global $SESS;

    
$language = $SESS->userdata['language'];

    if (
$language == "english")
    
{
    ?>
{english_field}

[
...]

{
/exp:weblog:entries}

Thanks Chris for this hint.

To make the language change easier would it be possible to change the userdata[‘language’] value with one click?
I thought of a simple “EN”, “FR”, “DE” link on the index page that changes the userdata[‘language’] to “French”, “German”, etc.

Would that be possible? If yes, how should that be coded?

Profile
 
 
Posted: 30 July 2005 10:14 AM   [ Ignore ]   [ # 6 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

You would have to use PHP and a query to update their value in the database for their user.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 31 July 2005 03:54 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  144
Joined  06-19-2005

Thanks for your fast answer Chris,

Chris Curtis - 30 July 2005 10:14 AM

You would have to use PHP and a query to update their value in the database for their user.

Well, that’s what I guessed.
As I’m a PHP Newbie I don’t know how to code that.
I would appreciate if anyone could drop some useful code lines on that.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66466 Total Logged-in Users: 27
Total Topics: 84857 Total Anonymous Users: 10
Total Replies: 455318 Total Guests: 172
Total Posts: 540175    
Members ( View Memberlist )