Link to home
Start Free TrialLog in
Avatar of Amanda Watson
Amanda WatsonFlag for Australia

asked on

How to add a translate module for my joomla site

Hi,
I would like to add a translate tool for my joomla site.
I only want to offer one other language.

I have downloaded the language pack and would like to add a module to the site so you can select to see the site in english or spanish.

Can I use the language packs to do this?

I see the google translate tools, but I don't want to use that, I want only to have the site translated to spanish...?

Any ideas?
Avatar of austega
austega
Flag of Australia image

The language packs from the Joomla site only handle the Joomla core system messages - for one or both of front and back end. You need to install the Spanish language pack for at least the front end, but it will not cover your extensions, menus, sections, categories etc or of course your content.

You need a translation extension to handle these well.

The most popular is JoomFish (justifiably) and it is full-featured for the task. There is a bit of a learning curve, but this is principally around:

1. The multitude of different elements in a Joomla site that need to be translated - and JoomFish monitors them all
2. The fact that even a trivial change in say an article's category or meta data will cause JoomFish to show that its translation is incomplete - quite appropriate but you have to get used to it.

David
Hi,

try this.

http://translateth.is/

In the settings you can kep only spanish..

Hope this will help you.

Thanks
Parag
Avatar of Amanda Watson

ASKER

Hi Parag, that translate tool works beautifully, thanks so much.
I just don't know how to make it translate to only spanish?
Hi,

check this

http://translateth.is/docs#default-options

keep only Spanish in the javascript.

http://x.translateth.is/translate-this.js this is the link to javascript.

Change it according to you and keep it on your server and in the script keep the address of the js stored on your server.

Thanks
Parag
Ok, I just tried to do this and the translate tool disappeared completely.

I changed the code from this
<!-- Begin TranslateThis Button -->

<div id="translate-this"><a href="http://translateth.is/" class="translate-this-button">Translate</a></div>

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://x.translateth.is/translate-this.js"></script>
<script type="text/javascript">
TranslateThis();
</script>


<!-- End TranslateThis Button -->

to this



<!-- Begin TranslateThis Button -->

<div id="translate-this"><a href="http://translateth.is/" class="translate-this-button">Translate</a></div>

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://x.translateth.is/translate-this.js"></script>
<script type="text/javascript">
TranslateThis({
    GA : true, // Google Analytics tracking
    scope : 'content', // ID to confine translation
    wrapper : 'translate-this', // ID of the TranslateThis wrapper
   
    onLoad : function() { alert('loaded') }, // Callback function
    onClick : function() { alert('translation started') },
    onComplete : function() { alert('translation finished') },
   
    cookie : 'tt-lang', // Name of the cookie - set to 0 to disable
   
    panelText : 'Translate Into:', // Panel header text
    moreText : '36 More Languages »', // More link text
    busyText : 'Translating page...',
    cancelText : 'cancel',
    doneText : 'Translated by the', // Completion message text
    undoText : 'Undo »', // Text for untranslate link
   
    fromLang : 'en', // Native language of your site
   
    ddLangs : [ // Languages in the dropdown
        'cs',
        'pt-PT',
        'it',
        'ru',
        'ar',
        'zh-CN',
        'ja',
        'ko'
    ],
   
    noBtn : false, //whether to disable the button styling
    btnImg : 'http://x.translateth.is/tt-btn1.png',
    btnWidth : 180,
    btnHeight : 18,
   
    noImg : false, // whether to disable flag imagery
    imgHeight : 12, // height of flag icons
    imgWidth : 8, // width of flag icons
    bgImg : 'http://x.translateth.is/tt-sprite.png',
   
    maxLength : 900, // maxLength of strings passed to Google
    reparse : true // whether to reparse the DOM for each translation
   
});
</script>

<!-- End TranslateThis Button -->

Which has most of the options set, but then the tool just disappears completely.

I was going to see if this was going to work and then trim it down to my needs??
Hi,

I have attached the files.

Download those files and save it in a folder and open test.html . You will see the only option for translate is spanish.

Thanks
Parag
test.html
translate-this.js
Use this javascript. I have removed the unnecessary options

Thanks
Parag
translate-this.js
Dont use that it has many errors..


Any update? Did that worked for you properly?

Thanks
Parag
Hi,
Sorry for the late update but I was asleep.  ;-)  You are probably asleep now??
So I am using your javascript and entered in the code you gave to the html and it doesn't seem to have changed anything?

I am a little concerned also that I need the default language to always be english and if they want the site to be translated, then they select spanish...

Here is my test page http://webfd.omega.studiocoast.com.au
Do one thing.

Uplioad the js that i have attached with this and let me know. I will then see the url.

Thanks
Parag
translate-this.js
Ok, I have uploaded that js file....

Its still not working correctly.

It actually translates the page as soon as it loads rather than waiting to do a translation?
Sorry for the late reply as i was away from Internet.

Okay it is not actually translating the page as soon as it is loaded, the problem is with the browser cookies. If you delete the cookies from the browser then the page will be loaded properly.

And about translating it into spanish only. you have not linked the javascript properly that's the reason it is showing for the rest of the languages as well.. Please link the javascript properly. It is working absoultely fine here.

I have downloaded your page and linked the new javascript. See the files attached.

EE is not allowing me to aattach the files. I will try again to attach it later.

Thanks
Parag
Ok, I added in the link as an absolute link...it should be working now, but i am getting the same result still?

Any ideas?

ASKER CERTIFIED SOLUTION
Avatar of Parag_t567
Parag_t567
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thats great, thank you.
I just need to add English back as an option and I should be right.
I am a little concerned about this cookie issue, but otherwise its perfect
Thank you
Sorry I can't actually find where I can add the english option in with the spanish in your js...can you resend with spanish and english?
Im sorry I do have one other request...I need to change the translate image so it only shows the spanish and english flag.

Where would I change this image reference to my own image?
To change image:

locate this is in the javascript:

false;f.btnImg=f.btnImg||"http://x.translateth.is/tt-btn1.png";

and replace it with

false;f.btnImg=f.btnImg||"absoulte path of image";

I have attached Js with spanish and english option to translate

Thanks
Parag
translate-this.js
About the cookie issue i have no idea how to get over that :(

Parag
Parag,
Thank you so much for you help.
This is so perfect for what I need.
I guess the cookie issue won't be an issue for other users as they will choose their language and stick to the chosen language...I hope?

Thanks again. your points are well deserved
Excellent Expert
Thanks a lot. I am glad that i could help you. :)