Welcome Guest! To enable all features please Login or Register.
Options
View
Go to last post Go to first unread
Offline pipRaptor  
#1 Posted : Sunday, May 8, 2016 5:57:11 AM(UTC)
pipRaptor


Rank: YAF Camper

Reputation:

Joined: 11/18/2014(UTC)
Posts: 14
Italy

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Of course your foreigner users can call the browser translator to read the forum in their language, but I found pretty to put this option directly in my menu

The code to insert the google translator is this and you can put it everywhere you want

Code:

<div id="google_translate_element"></div>
<script type="text/javascript">
	function googleTranslateElementInit() {
		new google.translate.TranslateElement({ pageLanguage: 'it', 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>


I decided to put it near the login menu, so I opened the /controls/YafHeader.ascx and I inserted a table to integrate the translator code in the same line of other login buttons

Code:

.....
<asp:Panel ID="UserContainer" CssClass="menuMyContainer" runat="server">
	<table>
		<tr style="vertical-align: middle;">
			<td style="font-weight: bold;">Translate language:
			</td>
			<td>
				<div id="google_translate_element"></div>
				<script type="text/javascript">
					function googleTranslateElementInit() {
						new google.translate.TranslateElement({ pageLanguage: 'it', 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>
			</td>
			<td>&nbsp;&nbsp;
			</td>
			<td>
				<ul class="menuMyList">
					<li class="menuMy myProfile">
						<asp:HyperLink ID="MyProfile" runat="server" Target="_top"></asp:HyperLink>
					</li>
					<asp:PlaceHolder ID="MyInboxItem" runat="server"></asp:PlaceHolder>
					<asp:PlaceHolder ID="MyBuddiesItem" runat="server"></asp:PlaceHolder>
					<asp:PlaceHolder ID="MyAlbumsItem" runat="server"></asp:PlaceHolder>
					<asp:PlaceHolder ID="MyTopicItem" runat="server"></asp:PlaceHolder>
					<asp:PlaceHolder ID="LogutItem" runat="server" OnPreRender="LogutItem_PreRender" Visible="false">
						<li class="menuAccount">
							<asp:LinkButton ID="LogOutButton" runat="server" OnClick="LogOutButton_Click" OnClientClick="if(!confirm('Vuoi veramente uscire dal sito?'))return false;else return true;"></asp:LinkButton>
						</li>
					</asp:PlaceHolder>
				</ul>
			</td>
			<td>
				<asp:LinkButton ID="LinkButtonLogout" runat="server" OnPreRender="LinkButtonLogout_PreRender" OnClick="LinkButtonLogout_Click" Style="font-weight: bold; margin-right: 10px;">Logout</asp:LinkButton>
			</td>
		</tr>
	</table>
</asp:Panel>
.....


It's only a little touch... but it makes your site/forum much more professional!

Edited by user Sunday, May 8, 2016 9:04:05 PM(UTC)  | Reason: Corrected error in the code

Sponsor
Offline Zero2Cool  
#2 Posted : Sunday, May 8, 2016 10:44:06 AM(UTC)
Zero2Cool


Rank: YAF Leader

Reputation:

Medals: Medal of Honor for the Support Knight: Given to a community member who has assisted lots and lots of people!

Joined: 4/26/2011(UTC)
Posts: 1,062
Man
United States
Location: in a van down by the river

Thanks: 234 times
Was thanked: 101 time(s) in 92 post(s)
Do you have an example of this online to view?
Offline pipRaptor  
#3 Posted : Sunday, May 8, 2016 8:11:02 PM(UTC)
pipRaptor


Rank: YAF Camper

Reputation:

Joined: 11/18/2014(UTC)
Posts: 14
Italy

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Zero2Cool Go to Quoted Post
Do you have an example of this online to view?


Can I post the address of my site (I use it as a BLOG) or it's against rules?

I'm a Forex trader, and I code only to relax while my orders are running, so my BLOG concerns precisely my job,

Edited by user Sunday, May 8, 2016 8:14:54 PM(UTC)  | Reason: Not specified

Offline Zero2Cool  
#4 Posted : Monday, May 9, 2016 6:55:09 AM(UTC)
Zero2Cool


Rank: YAF Leader

Reputation:

Medals: Medal of Honor for the Support Knight: Given to a community member who has assisted lots and lots of people!

Joined: 4/26/2011(UTC)
Posts: 1,062
Man
United States
Location: in a van down by the river

Thanks: 234 times
Was thanked: 101 time(s) in 92 post(s)
Originally Posted by: pipRaptor Go to Quoted Post
Originally Posted by: Zero2Cool Go to Quoted Post
Do you have an example of this online to view?


Can I post the address of my site (I use it as a BLOG) or it's against rules?

I'm a Forex trader, and I code only to relax while my orders are running, so my BLOG concerns precisely my job,


I have my site linked in my profile and Ingo hasn't banned me, yet. Cheesy Grin I think you'll be good.
Offline pipRaptor  
#5 Posted : Monday, May 9, 2016 10:42:18 AM(UTC)
pipRaptor


Rank: YAF Camper

Reputation:

Joined: 11/18/2014(UTC)
Posts: 14
Italy

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Zero2Cool Go to Quoted Post
Originally Posted by: pipRaptor Go to Quoted Post
Originally Posted by: Zero2Cool Go to Quoted Post
Do you have an example of this online to view?


Can I post the address of my site (I use it as a BLOG) or it's against rules?

I'm a Forex trader, and I code only to relax while my orders are running, so my BLOG concerns precisely my job,


I have my site linked in my profile and Ingo hasn't banned me, yet. Cheesy Grin I think you'll be good.


Perfect! Then this is my new BLOG I'm still coding, but you can see the translaction button and also other interesting stuff

Click here for my new BLOG, till in preparation

If you subscribe (for now there isn't the mail confirmation) you can also see how I developed a different attachment system for images and files, I intend publish all the code in the next days

Test and write what you want, the FORUM/BLOG is not yet published, I still have to solve some problems

Of course, anyone who wants can try it , it is still in development and before putting it online I 'll clean all

Edited by user Monday, May 9, 2016 11:38:24 AM(UTC)  | Reason: Not specified

thanks 1 user thanked pipRaptor for this useful post.
Zero2Cool on 5/9/2016(UTC)
Rss Feed  Atom Feed
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error