Support Forum
Figured it would be better to start a new topic for this translation topic. It's a good reference for anyone wanting to do the same.
I was able to cobb the translation widget into spHead.php file. It works fine but has no style and it seemed the only option for placement was either before the php start or the end. Id really like to place it to the right of the user logged in and avatar. Unfortunately I'm not a coder and just know the very basics of php. Any suggestions?
Also since this code is freely available to download from Google, It would make a very useful plugin. I know sometimes my travels wind up on some foreign language site where translation would be useful. I have not tried it yet, but this might also work for a visitor to reply to a message too.
- Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
well you would need to add the styling yourself... and you can put it anywhere in there... but it may not appear exactly where you want without the styling...
for next to the avatar/user logged in, try floating it left with class of spLeft...
Visit Cruise Talk Central and Mr Papa's World
Mr Papa said
well you would need to add the styling yourself... and you can put it anywhere in there... but it may not appear exactly where you want without the styling...for next to the avatar/user logged in, try floating it left with class of spLeft...
Hmmm.. I'm lost in code land..
Anywhere in the header i put it other than before or after the php statement, the whole forum bonks. All that loads is my site header.
Could you give me a little code example please?
- Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
you are probably mixing html and php... please post the code you used, where you want it, including a couple lines before and after the code you inserted...
Visit Cruise Talk Central and Mr Papa's World
I appreciate the coding help. I'm totally lost in that department. Below is the code as it was copied from Google.
<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
This is where it's ideal position would be.
- Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
yup - mixing php and html... in your spHead.php, just change:
sp_SectionStart('tagClass=spPlainSection'); sp_LoggedInOutLabel('tagClass=spLabelSmall spLeft', __sp('Logged in as<br /><b>%USERNAME%</b>'), __sp('Please consider registering<br /><b>guest</b>'), __sp('Welcome back <b>%USERNAME%</b><br />Please log in to post')); sp_LogInOutButton('tagClass=spButton spRight', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));
to
sp_SectionStart('tagClass=spPlainSection'); sp_LoggedInOutLabel('tagClass=spLabelSmall spLeft', 'Logged in as<br /><b>%USERNAME%</b>', 'Please consider registering<br /><b>guest</b>', 'Welcome back <b>%USERNAME%</b><br />Please log in to post'); ?> <div id="google_translate_element"></div> <script> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'en' }, 'google_translate_element'); } </script> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> <?php sp_LogInOutButton('tagClass=spButton spRight', 'Log In', 'Log Out', 'Log in and log out');
Now this will put it pretty much flush up against the stuff on the left... but you can style the 'google_translate_element' div to push it to the right (ie padding-left)...
Visit Cruise Talk Central and Mr Papa's World
yes, <?php starts a php code block and ?> ends it... anything outside of that is just written to the file (and thusly should be html)...
you will have an issue trying to center it since you have it 'stacked up' with a bunch of other left or right aligned items... you would need to create sections for the left stuff and right stuff and then add a new section in between with the translate stuff and then use the spCenter class for it... think that would work, but have not actually tried it...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)