tags:

views:

195

answers:

3

Hi,

I am implementing a website with Joomla! and I am using a component named Jumi. This component basically allows you implement a PHP script and integrate it with the Joomla CMS. With this component, I created a PHP script which acts as a simple booking system. The user fills in information, such as name, surname, type of booking, etc... and an email is sent to me.

Since the website is multilingual, I need to translate these fields. I don't want to transfer them manually however. Joomla has a folder entitled languages which lets you translate from there. However I can't find how to do such a thing when using this component.

Any help?

Many thanks

EDIT----

Hi DisgruntledGoat,

I already tried that but didn't work. Here is my structure:

I have a folder in the root entitled booknow. Inside this folder there is ia php file with the booking form. I tried replacing

<td>Name</td>

with

<td><?php JText::_( 'Name' ) ?></td>

Then I created an ini file entitled it-IT.com_jumi.ini. I also created one with the folder name just in case it-IT.com_booknow.ini with the following content:

Name=Nome

Didn't work though...

Any other ideas?

Many thanks

Chris

A: 

You can echo your text using JText::_(). Here is an example:

$welcome = JText::_( 'Welcome To Simple Booking System');

Joomla will automatically translate this text to selected language.

Sarfraz
I Know that but there are many ini files in the language folder. How and where should I enter the translation? That is what I need to know.Many thanks.
Chris
+2  A: 

You need to create ini files in the language folder. If the script still runs as part of this jumi component, the ini file will probably be en-US.com_jumi.ini inside the en-US folder. If the component creates separate components for you, it may be en-US.com_bookingsystem.ini

The ini file structure is like this:

STRING KEY=The string to display

And you'd output "The string to display" by using:

JText::_( 'STRING KEY' );

For other languages, create a folder under languages, such as fr-FR for French, then an ini file like above, fr-FR.com_jumi.ini. Inside this put your translations, using the same string key:

STRING KEY=Le display stringé

Calling JText::_() will display the string in the correct language automatically.

DisgruntledGoat
A: 

I created a post in the Joomla website's forum and I fixed the problem following their instructions.

The missing part was that you have to load the language file in the php script first before you can use the multilingual capabilities.

Post can be found here:

http://forum.joomla.org/viewtopic.php?t=465720&amp;f=485&amp;sid=2473312316500a64083d0ecb61f67da9

Chris