pluck
pluck 4.7 out now, download it today!

pluck support forums

for all your questions about the easiest CMS on the planet

You are not logged in.

Announcement

New registrations are disabled for some spam problems. New registrations will be avaliable soon. If you want to help to keep forum away from spam - contact us.
Please post your bug reports on Launchpad.

#1 27-09-2009 14:57:19

westial
Member
From: Barcelona
Registered: 01-07-2009
Posts: 19
Website

multilanguage solution

LAST VERSION IN PLUCK MODULES PAGE http://pluck-cms.org/docs/addons:modules
AND ALSO WITH MORE MODULES http://internetismo.com/en/?file=kop7.php

I have my websites in a linux server. It's very easy.

The unique folder you need for every language is the settings folder (data/settings).

1. Create a main install directory of pluck, the reference. Install pluck here. For example http://internetismo.com/en

2. Create other directory for the second language. For example http://internetismo.com/es. Don't install pluck here. Copy the entire folder http://internetismo.com/en/data/settings in the directory http://internetismo.com/es/data/

3. Change the var $langpref of es/data/settings/langpref.php

4. Create symbolic link inside "es" directory for all the others files and folders of the "en" directory, not for settings.

et voilà, repeat the points 2, 3 and 4 for every language you want.

You can create symbolic link by php:
function _symlink( $target, $link ) {
  if ($_SERVER['WINDIR'] || $_SERVER['windir']) {
    exec('junction "' . $link . '" "' . $target . '"');
  } else {
    symlink($target,$link);
  }
}

function _unlink($link ) {
  if ($_SERVER['WINDIR'] || $_SERVER['windir']) {
    exec('junction -d "' . $link . '"');
  } else {
    unlink($link);
  }
}

Last edited by westial (04-01-2010 22:21:44)

Offline

#2 07-10-2009 18:05:15

Hallon
Member
From: Sweden
Registered: 05-10-2009
Posts: 24
Website

Re: multilanguage solution

This is exactly what i was looking for, i dont really understand how this works, where to implement the codes for the links to each language sites. I would think that some piece of code has to be in the theme file.

Can anybody explain in beginner language if you have the time and feel like it big_smile

Thanks in advance.

Offline

#3 10-10-2009 00:40:40

westial
Member
From: Barcelona
Registered: 01-07-2009
Posts: 19
Website

Re: multilanguage solution

hi Hallon,
I'm developping new module following these instructions. If you need it fastly you can download the 0.5 version here http://internetismo.com/testing/multilang.tar.gz

This module creates new directory "multilang" in the main folder. And puts the language you want. It makes a copy of the settings folder and creates all the other files and folders like a symbolic links of the source language (your first installation language).

You will see the multilang folder with the new languages "es, en, fr,..." you can link them manually. I'm optimizing it. I would like the days are 30h, not only 24h...

I have tested on linux server and runs fine. I don't know if it runs on windows but the functions have the windows option too

Offline

#4 10-10-2009 07:22:11

Hallon
Member
From: Sweden
Registered: 05-10-2009
Posts: 24
Website

Re: multilanguage solution

wow, cool big_smile gonna try it. Thanks.

I currently put up two flags with a link to the first page in respectivly language, i assume your module takes the visitor to the page that they are on to the other language. Well anyway. Gonna try it right away.

Offline

#5 10-10-2009 12:35:02

westial
Member
From: Barcelona
Registered: 01-07-2009
Posts: 19
Website

Re: multilanguage solution

ei,
the module only creates the other languages from the main language yet. There aren't flags or links to these pages in multilang, you must create a index.html with these links:

multilang/ct/ <-- public contents of catalan language
multilang/se/ <-- public contents of sweeden language

to admin:
multilang/se/admin.php <-- admin contents of sweeden language

It shares the images, themes, modules, etc,... between languages because all languages have the same folders of main language, by symbolic links. The settings folder is the only one is genuine of every language.

In index.html you can put a javascript to redirect automatically to the user explorer's language:
<script type="text/javascript">
<!-- language redit
if (navigator.userAgent.indexOf("Opera")!=-1) (language=navigator.language)
else { if (navigator.appName == "Netscape") (language=navigator.language)
else language=navigator.browserLanguage };
if (language){language=language.substring(0,2)}
else {language="zz"}
if (language=="se") {
    window.location="multilang/se";
}
if (language=="ct") {
    window.location="multilang/ct";
}
// fi -->
</script>

smile good pluck

Last edited by westial (10-10-2009 13:37:58)

Offline

#6 10-10-2009 15:07:22

Hallon
Member
From: Sweden
Registered: 05-10-2009
Posts: 24
Website

Re: multilanguage solution

Thanks for your information smile Really apreciate it.

Good luck to yourself in future development smile Looking forward what you are doing in the next update. smile

Offline

#7 11-10-2009 13:52:00

jedadesign
Member
From: Holland
Registered: 29-09-2009
Posts: 15

Re: multilanguage solution

westial wrote:

hi Hallon,
I'm developping new module following these instructions. If you need it fastly you can download the 0.5 version here http://internetismo.com/testing/multilang.tar.gz

This module creates new directory "multilang" in the main folder. And puts the language you want. It makes a copy of the settings folder and creates all the other files and folders like a symbolic links of the source language (your first installation language).

You will see the multilang folder with the new languages "es, en, fr,..." you can link them manually. I'm optimizing it. I would like the days are 30h, not only 24h...

I have tested on linux server and runs fine. I don't know if it runs on windows but the functions have the windows option too

Hello Westial

it works fine on a windows server cool Great job

about the links to the different language's confuses me you are writing abot a html doc but i havent any ?

i have index.php

can you explane what i have to do

Thnx in front

Offline

#8 11-10-2009 14:02:21

westial
Member
From: Barcelona
Registered: 01-07-2009
Posts: 19
Website

Re: multilanguage solution

hello jedadesign,
thank you for windows testing. I must finish this module with the index.html creation automatically, doesn't exists now, you must create manually. A index.html file, in the same main folder than admin.php, install.php,...

In this index.html you must link the different languages and/or implement the javascript language selector I have pasted before. Different languages linked to multilang/se or multilang/ct or multilang/[lang],...

And also you need to put the links to different languages on theme.php, this is other thing I must writte to finish the module

Offline

#9 04-01-2010 00:10:50

westial
Member
From: Barcelona
Registered: 01-07-2009
Posts: 19
Website

Re: multilanguage solution

I have finished one acceptable version of this module. I have added the downloadable module in http://pluck-cms.org/docs/addons:modules

The module doesn't create an index.html, but you can include the module in all pages to select the language preferred for the user.

I have tested, but I have not any page with this module. Please if someone installs this module and finds an error, please write here and I will repair it.

I have read what the pluck team are preparing a language solution for new version, if not, I will work in this module to make it optimal.

Last edited by westial (04-01-2010 00:15:23)

Offline

#10 05-01-2010 19:31:43

westial
Member
From: Barcelona
Registered: 01-07-2009
Posts: 19
Website

Re: multilanguage solution

New version 0.6 because 0.5 doesn't allow to create new languages from cloned languages.

This module doesn't create symbolic links in localhost, only in remote servers, linux and windows servers.

Last edited by westial (05-01-2010 23:34:18)

Offline

#11 11-03-2010 17:25:40

westial
Member
From: Barcelona
Registered: 01-07-2009
Posts: 19
Website

Re: multilanguage solution

Thank you elisabethabram,
I'm thinking to optimize it, after, I will send you the release advertising at all of this post

Offline

Board footer

Powered by FluxBB