add a language

Questions about how to install and problems installing - please read the documentation first!
shazam
Posts: 6
Joined: Thu Nov 06, 2008 12:10 am
Location: Galicia - Spain

add a language

Post by shazam » Thu Oct 08, 2009 11:18 pm

Hello!!

Sorry for this question but i try many changes with no good results, i only want to add an aditional language, explained:

- I want the web with 2 languages, spanish and english, spanish work good, the problem is when i try to add english.

- I created in root a folder called "en"
- I put in \images\flags\ the files: "es.gif" and "en.gif"
- I put in \cmsimple\languages\ the files: "es.php" and "en.php"
- I put into the folder "en" this: folder content with files "content.htm" and ".htaccess"
file "en.php"
file "index.php" copied from root folder

When i load the web, i can see the flag, and when i make clik on the flag obtain this error:

Warning: include(./cmsimple/cms.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\en\index.php on line 1

Warning: include() [function.include]: Failed opening './cmsimple/cms.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\en\index.php on line 1


I think i don't make this correct an have an error adding the second language, i read about this but don't see the solution.

Thanks in advance!!!
Greetings From Spain

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: add a language

Post by Tata » Fri Oct 09, 2009 6:38 am

Wrong! You have read not enough about CMSimple :-).
Depending on CMSimple version you may have also the "2lang" folder in your installation packet - this is exactly what you need - simply rename it to en and it will work. If there is no "2lang" folder in the installation:
1. Make the "en" folder
2. copy here from root: [content] and index.php
3. edit index.php and change the path:

Code: Select all

<?php include('./cmsimple/cms.php'); ?>
to

Code: Select all

<?php include('../cmsimple/cms.php'); ?>
4. If you already have some images on "es" page, open also the [en]/[content]/content.htm file and change all

Code: Select all

<img src="./images
to

Code: Select all

<img src="../images
Eventually the same way change all

Code: Select all

=./downloads
That's all.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

MMellema
Posts: 15
Joined: Thu Jul 08, 2010 10:20 am

Re: add a language

Post by MMellema » Thu Jul 08, 2010 10:27 am

Hi,
Same topic...
I have installed CMSimple_XH 1.1.2 Build: 2010031002. In the folders are indeed the languages. How to get the flags + link to my Homepage so people can choose the language.

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: add a language

Post by Holger » Thu Jul 08, 2010 11:22 am

MMellema wrote:Hi,
Same topic...
I have installed CMSimple_XH 1.1.2 Build: 2010031002. In the folders are indeed the languages. How to get the flags + link to my Homepage so people can choose the language.
Hi,

you need to add the function languagemenu() to your template.
http://www.cmsimple.org/?Installer%27s_ ... mplate.htm

Holger

MMellema
Posts: 15
Joined: Thu Jul 08, 2010 10:20 am

Re: add a language

Post by MMellema » Thu Jul 08, 2010 11:30 am

Hi,
You mean that I have to add a HTML code in my index.php? Please help me with this, I am trying to learn this... :?

leenm
Posts: 116
Joined: Wed Dec 09, 2009 12:33 pm
Location: Kloetinge, Netherlands
Contact:

Re: add a language

Post by leenm » Thu Jul 08, 2010 11:42 am

MMellema wrote:Hi,
You mean that I have to add a HTML code in my index.php? Please help me with this, I am trying to learn this... :?
No, don't change anything in index.php. CMSimple works with templates. You must add the function languagemenu() to the file ./templates/<fill in name of your template>/template.htm. See the link Holger provided for more information about how to do that.

Leen

MMellema
Posts: 15
Joined: Thu Jul 08, 2010 10:20 am

Re: add a language

Post by MMellema » Thu Jul 08, 2010 11:50 am

Hi, OK I see. So I found my template....I can change it in the CHANGE SETTINGS / edit template.
But I don't know what to add or change in this file. I just want EN and NL (dutch) languages in my template. I checked out that these are available so it shouldn't be so difficult is it? I can not find the parameters to fill in. Thnks!

I only can find;

<tr><td valign="top" class="menu"><?php echo languagemenu();?></td></tr>

leenm
Posts: 116
Joined: Wed Dec 09, 2009 12:33 pm
Location: Kloetinge, Netherlands
Contact:

Re: add a language

Post by leenm » Thu Jul 08, 2010 12:01 pm

ok, find the place in the html where you want the languagemenu and add

Code: Select all

<?php echo languagemenu(); ?>
Is the site already online? Can you provide a link then, it's easier to help you when we can see it too.

Leen

EDIT: Ok, the languagemenu should be visible.

MMellema
Posts: 15
Joined: Thu Jul 08, 2010 10:20 am

Re: add a language

Post by MMellema » Thu Jul 08, 2010 12:03 pm

sure, it is http://www.adritec.nl
it should be visible, yeah I thought so. But don't I need to put a parameter on YES or EN or something like this/ Because I found also the same for GUESBOOK , with EXACt the same code, but this one is also not visible. So it is strange for me....

leenm
Posts: 116
Joined: Wed Dec 09, 2009 12:33 pm
Location: Kloetinge, Netherlands
Contact:

Re: add a language

Post by leenm » Thu Jul 08, 2010 12:07 pm

Have you two ore more languages installed? That means is there a folder in the root of your installation with a two-letter name (en or nl)?

Post Reply