Solved

How to add a translate module for my joomla site

Posted on 2010-09-20
23
786 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:Amanda Watson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 10
23 Comments
 
LVL 8

Expert Comment

by:austega
ID: 33721937
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
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33722562
Hi,

try this.

http://translateth.is/

In the settings you can kep only spanish..

Hope this will help you.

Thanks
Parag
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33723318
Hi Parag, that translate tool works beautifully, thanks so much.
I just don't know how to make it translate to only spanish?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:Parag_t567
ID: 33723346
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
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33723460
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??
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33723479
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
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33723623
Use this javascript. I have removed the unnecessary options

Thanks
Parag
translate-this.js
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33723628
Dont use that it has many errors..


0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33725076
Any update? Did that worked for you properly?

Thanks
Parag
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33728867
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
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33731705
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
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33732322
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?
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33741966
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
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33748559
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?

0
 
LVL 4

Accepted Solution

by:
Parag_t567 earned 500 total points
ID: 33750891
OKay i have checked your javscript and you are not attaching the right javascript.

See the code snippet below:

"af","sq","ar","be","bg","ca","zh-CN","zh-TW","hr","cs","da","nl","en","et","fi","fr","gl","de","el","iw","hi","hu","is","id","ga","it","ja","ko","lv","lt","mk","ms","mt","no","fa","pl","pt-PT","ro","ru","sr","sk","sl","es","sw","sv","tl","th","tr","uk","vi","cy","yi"

This part should not be there in the javascript and you have this in your javascript.

Please delete that javascript from the server and upload the one i gave you earlier or instead for a safer side upload the one i am attaching now.

It is working absolutely fine here.

Thanks
Parag
translate-this.js
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33765558
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
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33765566
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?
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33765571
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?
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33767061
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
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33767072
About the cookie issue i have no idea how to get over that :(

Parag
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 33767227
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
0
 
LVL 11

Author Closing Comment

by:Amanda Watson
ID: 33767228
Excellent Expert
0
 
LVL 4

Expert Comment

by:Parag_t567
ID: 33767240
Thanks a lot. I am glad that i could help you. :)
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question