Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
Mr.Easybb (1587)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
Bloodbath (745)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
Rukiafan (533)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
Dom (513)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
puppycheese (446)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
pedro (330)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
Neymar (301)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
Hitsu (281)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 
Flora (275)
Looking for a good translation tool Vote_lcapLooking for a good translation tool Voting_barLooking for a good translation tool Vote_rcap 


Looking for a good translation tool

avatarGuest
Thu 19 Feb 2015, 16:33
Hi all!

I've been looking all over the web for this but I can't find any. I don't use widgets on my website and my site consists of:

- A forum
- An AWC HTML page
- A WebShop (HTML page as well)

I'm looking for a very good translation tool, multiple languages (I saw 60 or so are possible, but I accept it to be a fair amount of common languages ofc.), Most of them I found, like Google (they don't support their little add-on tool beyond March 2015!) are not JS / JQuery / AJAX only but require it to be a widget. I want it to be JS (or whatever other language) and a bit of CSS only! I want it to show up in all the pages like an overlay, or even better still: to be part of the FM notification bar if possible (I really dreamed about such a feature for a long time now). Example: *country flag 1* translate to: *country flag 2* drop down menu, or just "Translate this page to: *country flag* drop down menu. This should all work ofc in the pages I select in the JS section of the ACP, like topics only or all the pages, etc., AND be accepted in HTML pages.

- " So, yeah, nice feature again, Sammy.... Rolling Eyes You're a blonde but you got the finest and brightest ideas all the time. ".
- I know I'm very a very demanding person at times, but I like this idea so much to come alive and we could all benefit, right? Smile

If any of you could please transform my dream into reality, please help me get this feature get alive! I'm requesting this for my phpBB3 board, http://www.friendcodes.nl and my other website which I will be working on soon.

Regards,

Samantha
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Fri 20 Feb 2015, 00:46
It looks like google just isn't accepting custom translations anymore. The source they provide can be applied to JavaScript. You'd just need to insert the HTML in the location you want, and then get the script provided.. It really depends on what translation tool you want to use. Which one will you be using, or prefer to use ?

At the moment, this is the example I can give of converting the HTML provided by google to a script that inserts the HTML and gets the source.
Code:
[panda=js]$(function(){$(function(){
  $('#fa_share').append("<div id=\"google_translate_element\" style=\"float:right\"></div><script type=\"text/javascript\">function googleTranslateElementInit() {new google.translate.TranslateElement({pageLanguage: 'fr', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL, autoDisplay: false}, 'google_translate_element');}</script>");
  $.getScript('http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit');
})});

It would insert the translation tool in the toolbar to the right of the share boutons.. I have an example here : http://forumbeta.forumactif.com/forum

Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Fri 20 Feb 2015, 02:40
Hey Samantha good thought, and now that all the forums have template editing let me explain what to do.

First off go to

http://translate.google.com/manager/website/add

Add your website URL, and what language your site is originally in.

Then click next.

Translation Languages ( All Languages ) this is my prefered method.

Display Mode: Dropdown only

CHECK: Automatically display translation banner to users speaking languages other than the language of your page.
CHECK: Your page contains content in multiple languages.
CHECK ONLY IF YOU HAVE A GA ID: Track translation traffic using Google Analytics. Learn more!

Click Get Code.

Now go to your admin panel, go to DISPLAY >> TEMPLATES >> GENERAL >> OVERALL_HEADER

Right below

Code:
[panda=html]<!-- BEGIN switch_compat_meta -->
<meta http-equiv="X-UA-Compatible" content="IE={switch_compat_meta.VERSION}" />
<!-- END switch_compat_meta -->

Add your meta tag:

Example

Code:
[panda=html]<meta name="google-translate-customization" content="TRANSLATE UID"></meta>

Then add this:

Code:
[panda=html]<div id="google_translate_element"></div>

If you want in your nav bar so find

Code:
[panda=html]{GENERATED_NAV_BAR}

And add the code snippet after that.

THEN add the JavaScript needed as well. After the The html I've given you above.

Code:
[panda=js]<script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

It'll look similar to that depending on your selections.

The only thing google won't offer is Custom Languages, which are usually unpopular languages but they do support 90 languages so you should be good with that.



Also depending on your boards language and how you prefer it to be you can edit this tag in the OVERALL_HEADER

Code:
[panda=html]<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" id="min-width" lang="{L_LANG_HTML}" xml:lang="{L_LANG_HTML}" {NAMESPACE_FB_LIKE} {NAMESPACE_FB} {NAMESPACE_BBCODE}>

And edit the [ic]lang="{L_LANG_HTML}"[/ic] part. for mechge it to [ic]lang="en"[/ic] for english
avatarGuest
Fri 20 Feb 2015, 05:05
Thanks so much @"Ange Tuteur" and @Mr.EasyBB .

Mr.EasyBB, I've installed Ange's script for now and this is what it looks like: http://prntscr.com/67f3v2 . I'm happy with that result. You've made quite a lot of work out of that tutorial and I really appreciate the effort, but I didn't know the end result before getting started. Could you provide an example of how it 'd look like in your tuto before I start editing templates, please?
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Fri 20 Feb 2015, 06:38
It would create a drop down list for your users so they could select the language they want to translate to. Its almost like Anges said except, no offense, cleaner. Since we have the ability to edit templates you should always look for that first, because of rankings and crawlers. SEO. And again no offense Ange but that method is a little brittle to me and involves more jQuery then suits me Wink Ange calls TWO doc ready functions, then injects string when in fact we can create these DOM elements and last uses jQuery for an id selector when native js for id selection is literally a million processes faster.
avatarGuest
Fri 20 Feb 2015, 07:29
Sounds like a pretty neat idea. Thanks for having a little discussion about it here. Yeah, I'm very interested of course if you could integrate it into the FM notification bar somehow. I noticed when I use the solution Ange provided, it fully covers the notification bar, so when I'm in watching pages I can't see it until I hit the X -button, but then it stops translating as well, which is a bit unfortunate. The notification bar should remain fully visible at all times.

Could you please provide the CSS for the drop-down menu with it, so I could change the text color and background color of it? I believe text = #FFF and background color = #FF5100 (<-- Warning: better be wearing sunglasses watching that one Razz ). Thanks in advance.

Regards,

Samantha.
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Fri 20 Feb 2015, 09:19
@Mr.Easybb Thanks for the insight. I was originally going to recommend the templates, but since Samantha mentioned that she wanted it added to the toolbar, using two document ready events was the best solution I could come up with compared to waiting for window onload.

How would that be ? Surprised
Code:
[panda=js]$(function(){$(function(){
  var a = document.createElement('SCRIPT'), b = document.createElement('SCRIPT'), gte = document.createElement('DIV'), share = document.getElementById('fa_share');
  a.type = 'text/javascript';
  a.text = "function googleTranslateElementInit() {new google.translate.TranslateElement({pageLanguage: 'fr', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL, autoDisplay: false}, 'google_translate_element');}";
  b.type = 'text/javascript';
  b.src = 'http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';
  gte.id = 'google_translate_element';
 
  share.appendChild(gte);
  share.appendChild(a);
  share.appendChild(b);
})});

@Samantha CSS :
Should change the dropdown color, and show the toolbar when translating.
Code:
[panda=css].skiptranslate { top:30px !important }
#google_translate_element { float:right }
#google_translate_element select {
  color:#FFF;
  background:#F50;
}

I've been trying to use native JavaScript a lot more, but you can say that I'm sloppy, since I am self taught. Razz
avatarGuest
Fri 20 Feb 2015, 13:55
@"Ange Tuteur" : I just tried it out and it totally ruined my forum's navigation bar and the FM Notification bar all together Razz I'm sure on your test forum it must have worked the way intended, but I've got some special scripts installed that may be conflicting. It's not CSS causing it anyway.

I'm also curious about the script @Mr.EasyBB was telling us about.

By the way, I'm doing this for the good of @"Ch@lo Valdez", "@Dark-Avanger" and some other personal friends. Ty!
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Fri 20 Feb 2015, 21:35
What ruined the navigation bar ?

When I check your forum, I see a problem with _userdata; a majority of the values are undefined, so some of your scripts are throwing errors. I'm not sure what would cause that.. scratch
avatarGuest
Sat 21 Feb 2015, 14:39
Ange Tuteur wrote:[quotelink="http://www.avacweb.com/t2339-looking-for-a-good-translation-tool#22311"]What ruined the navigation bar ?

When I check your forum, I see a problem with _userdata; a majority of the values are undefined, so some of your scripts are throwing errors. I'm not sure what would cause that.. scratch

I just had a quick glance at my JS and actually that MOOD script by Twisted has been conflicting with some other JS before on my board. It's in http://fcnl.actieforum.com/15486.js right?

Here's the JS, which consists of the Member Reputation + Moods (yeah 2 scripts in 1 in fact because they've been conflicting before) in the topics:

Code:
[panda=js]$(document).ready(function() {
   
      var version = 'phpbb3';
   
      var settings = {
          repName : 'Rep',
          repImage1 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-100.png',
          repImage2 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-80.png',
          repImage3 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-60.png',
          repImage4 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-40.png',
          repImage5 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-20.png',
          repImage6 : 'http://i380.photobucket.com/albums/oo242/LH-Justin/TranslucentWarningBars-0.png'
        };
   
      var repLv = {
          lv1 : 5,
          lv2 : 4,
          lv3 : 3,
          lv4 : 2,
          lv5 : 1,
          lv6 : 0,
        };
   
        var ver = { phpbb2 : version.toLowerCase() == 'phpbb2', phpbb3 : version.toLowerCase() == 'phpbb3', punbb : version.toLowerCase() == 'punbb', invision : version.toLowerCase() == 'invision' };
        var reg = new RegExp('.*'+settings.repName+':\\s+(\\d+).*'), regex = new RegExp('<span class="label"><span style="color:#.*?;">'+settings.repName+'</span>: </span> \\d+<br>');
   
      if (ver.phpbb3 || ver.punbb || ver.invision) {
          if (ver.phpbb3 || ver.invision) { var profSel = '.postprofile'; var addRepu = $(this).find('dt').append('<div id="repu">'); }
          else if (ver.punbb) { var profSel = '.user'; var addRepu = $(this).find('.user-ident').prepend('<div id="repu">'); }
          $(profSel).each(function() {
              var rep = Number($(this).text().replace(reg,'$1'));
              addRepu;
              if (rep == repLv.lv1) { $(this).find('#repu').html('<img src="'+settings.repImage1+'"/>') }
              if (rep == repLv.lv2) { $(this).find('#repu').html('<img src="'+settings.repImage2+'"/>') }
              if (rep == repLv.lv3) { $(this).find('#repu').html('<img src="'+settings.repImage3+'"/>') }
              if (rep == repLv.lv4) { $(this).find('#repu').html('<img src="'+settings.repImage4+'"/>') }
              if (rep == repLv.lv5) { $(this).find('#repu').html('<img src="'+settings.repImage5+'"/>') }
              if (rep == repLv.lv6) { $(this).find('#repu').html('<img src="'+settings.repImage6+'"/>') }
              $(this).html($(this).html().replace(regex,''));
          });
        }
    });



// Post Profile Mood Selector By:_Twisted_Mods_
// Special Thanks To Ange Tuteur For Helping And Testing
// Also To SamanthaS For The Idea And List Of Moods
jQuery(document).ready(function(){
var idd = 'field_id4';
var namee = 'profile_field_2_4';
var list1 = ['Geen','Gelukkig','Blij','Ongelukkig','Verrast','Geschokt','Cool','Grappig','Boos','Lollig','Schaamt zich','Verdrietig','Kwaad','Woest','Onbegrepen','Goed','Creatief','Neutraal','Een ster','Verdacht','Verliefd','Ziek','Amusant','Stil','Witjes','Buitenaards','Stuiterbal','Verward','Bang','Geweldig!','Explosief','Dronken','Slaperig','Het zonnetje','De Kerstman','Als de Koning','Als de Koningin','Als een joker','Als een nerd','Ongeinteresseerd','Supergeweldig!','Rockend','In feeststemming','Mediterend','Genereus','Kan me niets schelen','Zin in een dansje','Kom maar op!','Als een engeltje','Als een winnaar!','Erg druk ...'];
var list2 = [' ',':D',':)',':(',':o',':shock:','8)',':lol:',':x',':P',':oops:',':cry:',':evil:',':twisted:',':roll:',';)',':idea:',':|',':star:',':suspect:',':heart:',':no:',':clown:',':silent:',':pale:',':alien:',':bounce:',':confused:',':affraid:',':cheers:',':bom:',':drunken:',':sleep:',':sunny:',':santa:',':king:',':queen:',':joker:',':geek:',':study:',':superman:',':rock:',':party:',':zen:',':roos:',':mouais:',':bananadance:',':boxing:',':angelic:',':mvp:',':computer:'];
var list3 = ['http://2img.net/i/fa/empty.gif','http://2img.net/i/fa/i/smiles/icon_biggrin.png','http://2img.net/i/fa/i/smiles/icon_smile.gif','http://2img.net/i/fa/i/smiles/icon_sad.gif','http://2img.net/i/fa/i/smiles/icon_surprised.gif','http://2img.net/i/fa/i/smiles/icon_eek.gif','http://2img.net/i/fa/i/smiles/icon_cool.gif','http://2img.net/i/fa/i/smiles/icon_lol.gif','http://2img.net/i/fa/i/smiles/icon_mad.gif','http://2img.net/i/fa/i/smiles/icon_razz.gif','http://2img.net/i/fa/i/smiles/icon_redface.gif','http://2img.net/i/fa/i/smiles/icon_cry.gif','http://2img.net/i/fa/i/smiles/icon_evil.gif','http://2img.net/i/fa/i/smiles/icon_twisted.gif','http://2img.net/i/fa/i/smiles/icon_rolleyes.gif','http://2img.net/i/fa/i/smiles/icon_wink.gif','http://2img.net/i/fa/i/smiles/icon_idea.png','http://2img.net/i/fa/i/smiles/icon_neutral.gif','http://2img.net/i/fa/i/smiles/star3.png','http://2img.net/i/fa/i/smiles/suspect.gif','http://2img.net/i/fa/i/smiles/herz.png','http://2img.net/i/fa/i/smiles/kopfschuettel.gif','http://2img.net/i/fa/i/smiles/icon_clown.png','http://2img.net/i/fa/i/smiles/icon_silent.png','http://2img.net/i/fa/i/smiles/icon_pale.gif','http://2img.net/i/fa/i/smiles/alien.png','http://2img.net/i/fa/i/smiles/icon_bounce.gif','http://2img.net/i/fa/i/smiles/confused.png','http://2img.net/i/fa/i/smiles/affraid.gif','http://2img.net/i/fa/i/smiles/icon_cheers.png','http://2img.net/i/fa/i/smiles/bom.png','http://2img.net/i/fa/i/smiles/drunken_smilie.png','http://2img.net/i/fa/i/smiles/sleep.gif','http://2img.net/i/fa/i/smiles/icon_sunny.png','http://2img.net/i/fa/i/smiles/icon_santa.png','http://2img.net/i/fa/i/smiles/icon_king.png','http://2img.net/i/fa/i/smiles/icon_queen.png','http://2img.net/i/fa/i/smiles/icon_jokercolor.png','http://2img.net/i/fa/i/smiles/icon_geek.png','http://2img.net/i/fa/i/smiles/icon_study.png','http://r16.imgfast.net/users/1616/35/61/96/smiles/1838004359.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2896949932.gif','http://www.websmileys.com/sm/party/fest02.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/80174283.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/3305799796.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/4046336487.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2097953958.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/1218057395.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/89381941.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2265350431.gif','http://r16.imgfast.net/users/1616/35/61/96/smiles/2297342943.gif'];  var lcolors = ['E9967A','FFA07A','DC143C','FF0000','FFB6C1','FF69B4','FF1493','C71585','FF6347','FF4500','FF8C00','FFD700','FFFF00','7CFC00','00FF00','32CD32','7FFFD4','40E0D0','48D1CC','C0C0C0','A9A9A9'];
var thecode = '</br></br><center>Wijzig stemming:<select id="blahh">';
for(var i=0;i<list1.length;i++){
 thecode = thecode + ' <option value="'+i+'" style="background-image: url('+list3[i]+');">'+list1[i]+'</option>';
};
$('.postprofile').each(function(){

var uid = _userdata.user_id;
if($(this).find('a[href="/u'+uid+'"]').length ==0){}else{
$(this).append(thecode+'</select><br><span id="mstat">Status: Inactief.<span></center><br>');
};
});
$('.postprofile #blahh option').click(function(){
var ggg = $(this).val();
var hhhk = $(this);
function getcolor() {
  return lcolors[Math.floor(Math.random() * lcolors.length)];
};

var newcolor = getcolor();

var newwmood = list2[ggg]+'[b][color=#'+newcolor+'] '+list1[ggg]+'[/color][/b]';
$('#mstat').text('Status: Laden.');
 $.getScript('http://illiweb.com/rs3/86/frm/jquery/json/jquery.json-1.3.min.js', function(){
 var id = idd, name = namee, content = new Array();
 content.push(new Array(name, newwmood));
 $.post('/ajax_profile.forum?jsoncallback=?', {
  id: id.substring(8, id.length),
  user: _userdata.user_id,
  active: '1',
  content: $.toJSON(content),
  tid: document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1')
 },function(data){}, 'json') .done(function() {
$('.postprofile').each(function(){
 $(this).find('#mstat').text('Status: Klaar.');
 var oldhtm = $('.postprofile:contains('+_userdata.username+') dd:contains(Stemming)').html();
newhtm = oldhtm .replace(/(.*)Stemming<\/span>: <\/span>(.*)<\/strong><br>(.*)/,'$1Stemming</span>: </span> <img src="'+list3[ggg]+'"><strong><font color="#'+newcolor+'"> '+list1[ggg]+'</font></strong><br>$3');
$('.postprofile:contains('+_userdata.username+') dd:contains(Stemming)').html(newhtm);                         
                             
                                });
})
 .fail(function() {
$('.postprofile').each(function(){$(this).find('#mstat').text('<center>Status: Fout');});
})
})
.fail(function() {
$('.postprofile').each(function(){$(this).find('#mstat').text('<center>Status: Fout');});
})
.always(function() {
 $('.postprofile').each(function(){$(this).find('#mstat').text('<center>Status: Bijwerken...');});

})
});
});

So, if it was 'bad programming' conflicting with other JS and throwing errors, it's not my fault, I only had the idea behind the 'Moods' toy. And I'm surely surprised this popping up in another way adding other JS again, as I considered this to be 'solved'. Rolling Eyes .
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Sun 22 Feb 2015, 00:27
It doesn't look like it's that. What I mentioned before is actually coming from the document itself. When I open the console the first error I get is for the following : https://i.servimg.com/u/f38/18/45/41/65/captu112.png
( You can see that the values are missing )

Have you modified the templates at all ? If not, try disabling your JavaScript for a second to see if that's the problem. You can check if the error persists by pressing F12 and going to console. The error in question should look like this ( at least on Fx ) :
Looking for a good translation tool Captu113
avatarGuest
Sun 22 Feb 2015, 06:38
Well that's strange. When I don't log in I see this: http://prntscr.com/68amhb
When I log in using the account I didn't provide you the password for (!) I see this: http://prntscr.com/68aoa7

I don't know why it's giving you different readings. Also, in the picture you provided the ban message has been covered by your console and the toolbar shows one of the items that shouldn't be visible at all when not logged in: http://prntscr.com/68aoyw
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Sun 22 Feb 2015, 07:48
That is weird, I'm afraid I can't explain why i see it like that. scratch
avatarGuest
Sun 22 Feb 2015, 11:23
If you need an account to investigate, please PM me and don't use another former admin account for that purpose. I don't like what you showed me.

PS: K, I don't wanna sound cocky here, but I've seen a huge drop in members signing on @ FM support since I left like 40-60% even the last days. How come? Being the foremost admin you should be able to answer that, right? Wink

Best of my regards,

Sammy.
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Mon 23 Feb 2015, 00:19
I assume the translation is working then, or was it the recent one that didn't work ?

It depends what's going on. I noticed a lot of members signing up when the chatbox wasn't working, which is expected. Since the chatbox is starting to improve, you don't see too many people coming on to air their anger or report problems. I've been taking a break myself, mostly because I hurt my hand and it's not so easy to type.
avatarGuest
Mon 23 Feb 2015, 01:37
No, it's the most recent one not working. I installed the first one for the time being. So, if you want an account to have a look at those script errors, please say so, so we can move on with the most recent script.
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Mon 23 Feb 2015, 03:51
Hmm.. After looking at it, it seems kinda redundant to create two script elements. See how this works :
Code:
[panda=js]function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'fr',
    layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL,
    autoDisplay: false
  }, 'google_translate_element');
};
$(function(){$(function(){
  var gte = document.createElement('DIV');
  gte.id = 'google_translate_element';
 
  document.getElementById('fa_share').appendChild(gte);
  $.getScript('http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit');
})});

You already have the CSS added, right ? Surprised
avatarGuest
Mon 23 Feb 2015, 07:21
That worked alright! http://prntscr.com/68qpb0 Thanks Ange.

I see I could have added it also to for instance fa_search in JS when playing around with it a bit. Depending on position in the elements of the notification bar float:right or float:left one can use margin-left or margin-right to create more distance:

Code:
[panda=css]#google_translate_element {float:right;margin-left: 25px;}

There's another problem showing up now. While the Google translate bar is active, nothing can be done clicking the notifications / fa_welcome part. It just won't expand (nor collapse). Is there a way to solve that, for instance using a z-index? http://prntscr.com/68qpqe

Now, how can I remove the "powered by Google Translate" part marked with a green box in this picture: http://prntscr.com/68qluq in the notification bar?



PS: Just straightened up my FM Notification bar. This is the result and CSS involved: http://prntscr.com/68rbej

Code:
[panda=css]/*--- FA TOOLBAR ------------------------------------------------*/
#fa_toolbar {color: #FFF;font-family: Verdana,Helvetica,Arial,sans-serif !important;font-weight: 700 !important;font-size: 1.1em !important;}
#fa_toolbar span {color: #FFF;font-family: Verdana,Helvetica,Arial,sans-serif !important;font-weight: 700 !important;font-size: 1.1em !important;}
#fa_toolbar a {color: #FFF;font-family: Verdana,Helvetica,Arial,sans-serif !important;font-weight: 700 !important;font-size: 1.1em !important;}
#fa_right {font-family: Verdana,Helvetica,Arial,sans-serif !important;font-weight: 700 !important;font-size: 1.1em !important;}
#fa_icon {padding-bottom:3px!important;}
#fa_service {padding-bottom:3px!important;}
#fa_search {padding-bottom:2px!important;}
#fa_fb {padding-bottom:3px!important;}
#fa_gp {padding-bottom:3px!important;}
#fa_mail {display:none!important;}
#fa_rss {display:none!important;}
#fa_twitter {display:none!important;}
#fa_welcome {background-color:#FF5100!important;color:#FFF!important;}
#fa_notifications {background-color:#FF5100!important;color:#FFF!important;}
#notif_list {background-color:#FF5100!important;color:#FFF!important;}
#fa_menulist {background-color:#FF5100!important;color:#FFF!important;}
#fa_usermenu {color: #FFF!important;}
.skiptranslate {top:30px!important;}
#google_translate_element {float:right;margin-left:25px;}
#google_translate_element select {font-weight: 700!important;color:#FFF;background:#FF5100;}
.goog-logo-link {padding-bottom:3px!important;}


EDIT: Found 1 part of the solution for the question above so now it only shows this: http://prntscr.com/68rfum using this:
Code:
[panda=css].goog-logo-link {visibility:hidden!important;}
After the other part has gone next to the translate drop-down menu, I'll further remove the share buttons and change "Deel:" (share) into "Vertaal:" (translate).
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Wed 25 Feb 2015, 02:10
@Ange I have an unresolved issue and I absolutely despise the Official FM Support site. The Admins and most support mods are clueless and believe they know what they are doing. Except they don't write any of these codes that are added to FM. Anyways I don't know why they made it so that the javascript marked for all pages does not work for the official url "/chatbox" page anymore -_- such a huge disappointment that they even mod things with insight from knowledgeable people. I deal with erroneous factors all day long and I'm thinking FM will be taken off my list of things to deal with and I'll be resigning from all Support sites. This undoubtedly is not really towards you, but most of those who have been there for ever and never give real answers out.

So basically this me hinting to some people out there what my next big move is -_-

Also that double doc ready function for jquery is absolutely redundant. You should probably read up on what it actually does.
avatarGuest
Wed 25 Feb 2015, 02:25
@Mr.EasyBB : If it helps, I already deleted my account on the English FM support site after 3 years and 700 posts. Somehow they won't let me do the same on the Dutch one, even though it's an official FM support forum too. I wrote the admin on there, but he just won't have it. To me, Avacweb has become some kind of a support site now, though it always have been, but it has proven to be more stable. It's all about trust.

Now, to stay on-topic again, I'm still waiting for the other code. I've only got Ange's so far.
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Wed 25 Feb 2015, 02:26
Sorry Samantha what do you mean the other code? also I mean all FM sites. I won't be supporting anyone I have real websites to work on not these silly forum boards.
avatarGuest
Wed 25 Feb 2015, 02:35
Mr.Easybb wrote:[quotelink="http://www.avacweb.com/t2339p15-looking-for-a-good-translation-tool#22357"]Sorry Samantha what do you mean the other code? also I mean all FM sites. I won't be supporting anyone I have real websites to work on not these silly forum boards.

Mr.Easybb on 2/20/2015, 07:38 < That post. I thought you were going to adjust your code you provided and re-write another one. And I'm in shock now that you've said that. Avacweb was about showing what can be done using FM sites, right? Surprised The full potential... But since you said you're not gonna support anyone who has a FM site, nvm and thanks. Clearly my bad, must have misunderstood. And thanks for calling my site a 'silly' one. I've invested many many hours into it.
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Wed 25 Feb 2015, 02:39
I'm sorry if I've offended you Samantha, this isn't what I meant. But these sites have limitations and no control over anything. One day they can just start changing more and more and then we can't do much on them anymore. That is why I build my own sites from scratch...

till another day guys.

Thanks for having me.
avatarGuest
Wed 25 Feb 2015, 02:54
Mr.Easybb wrote:[quotelink="http://www.avacweb.com/t2339p15-looking-for-a-good-translation-tool#22360"]I'm sorry if I've offended you Samantha, this isn't what I meant. But these sites have limitations and no control over anything. One day they can just start changing more and more and then we can't do much on them anymore. That is why I build my own sites from scratch...

till another day guys.

Thanks for having me.

Yes, yes you did. I haven't felt that much offended in years now. I feel anger, disbelieve and purely annoyed. Please stay on-topic and get a hold of yourself. If you need to post out on your grief against FM, please open another topic on that and keep this topic clean. Thanks for understanding.
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Wed 25 Feb 2015, 08:12
@Samantha that's a good question, that I'll have to take a look at. It seems like the translation messes with something, I'm not sure what. Actually, I noticed when you click the texts it doesn't work, but when you click around the texts it does. As for the google texts, I suppose you could set the font size to 0 if you wanted.

Mr.Easybb wrote:[quotelink="http://www.avacweb.com/t2339p15-looking-for-a-good-translation-tool#22355"] @Ange I have an unresolved issue and I absolutely despise the Official FM Support site. The Admins and most support mods are clueless and believe they know what they are doing. Except they don't write any of these codes that are added to FM. Anyways I don't know why they made it so that the javascript marked for all pages does not work for the official url "/chatbox" page anymore -_- such a huge disappointment that they even mod things with insight from knowledgeable people. I deal with erroneous factors all day long and I'm thinking FM will be taken off my list of things to deal with and I'll be resigning from all Support sites. This undoubtedly is not really towards you, but most of those who have been there for ever and never give real answers out.

So basically this me hinting to some people out there what my next big move is -_-

Also that double doc ready function for jquery is absolutely redundant. You should probably read up on what it actually does.
I don't think I ever saw you on the support forum, maybe because I came in later around 2013. It was the same time I started studying HTML, CSS, and later JS in 2014. I know a good degree, but I don't understand everything... I still have a lot to study. From what I remember the chatbox never supported JavaScripts from the admin panel. I've always accessed the chatbox frame to manipulate it. ..I think my method was a bit heavy since I used an interval, I never got fully into modifying the original chatbox. lol

In regards to the support staff, I think some feel obligated to say something when the members are asking for answers. The communication is bad between the FR and EN forums, so we usually get an accurate answer of what's going on hours or days later if our CM is absent. For a long time I think it was only me who had an understanding of web development, and I'm not perfect at it. Razz

Oh, I know that the jQuery document ready event executes code when the document is ready. With a test I tried you can see the difference :
Code:
[panda=js]$(function(){
  document.getElementById('fa_toolbar') ? console.log(true) : console.log(false);
});

Using 1 returns false whereas using 2 returns true. It's one of the methods I've used for accessing elements like the editor and toolbar, aside from waiting for the window to fully load. I chose this method mostly because it executes the code before window onload -- almost as soon as these elements come into view. Would there be a better way that I don't know about ? Like I said, I'm not perfect at this, but I'm up for learning new methods. Smile
Sponsored content

 • Previous Topic • Next Topic