How to get the main cultur's language from Country Code?http://forums.asp.net/t/1544419.aspx/1?How+to+get+the+main+cultur+s+language+from+Country+Code+Fri, 09 Apr 2010 03:08:15 -040015444193771632http://forums.asp.net/p/1544419/3771632.aspx/1?How+to+get+the+main+cultur+s+language+from+Country+Code+How to get the main cultur's language from Country Code? <p>Hello,</p> <p>I am using a web service which return country code by&nbsp;the IP.&nbsp;</p> <p>Now I need to retrieve the language code&nbsp;so I can create a <strong>CultureInfo.</strong></p> <p>How do I do that?</p> <p><font size="2">&nbsp;</p> </font> 2010-04-07T06:16:41-04:003771664http://forums.asp.net/p/1544419/3771664.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>Hi,</p> <p>You need to set CultureInfo in global.asax.</p> <p>Please go through below link:<br> </p> <p>http://www.c-sharpcorner.com/UploadFile/pradeepkv/MultilingualAppsInNet11282005010748AM/MultilingualAppsInNet.aspx</p> <p>I hope it will helpful to you.</p> <p>Regards,</p> <p>Tapan<br> </p> 2010-04-07T06:33:58-04:003771665http://forums.asp.net/p/1544419/3771665.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>You have to store in DB with country and language, because on country can have multiple language.<br> </p> <p><br> </p> 2010-04-07T06:35:02-04:003771684http://forums.asp.net/p/1544419/3771684.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>Hi,</p> <p>Please go through below link:</p> <p>http://madskristensen.net/post/Get-language-and-country-from-a-browser-in-ASPNET.aspx</p> <p><br> </p> 2010-04-07T06:42:40-04:003771729http://forums.asp.net/p/1544419/3771729.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>If you will go to above link it was mentioned that language code can be multiple and it is not 100% accurate, so that why I am prefering to keep in our own database because we needs only limited culture and that should be 100% as per our expectation not surprise :)<br> </p> <p><br> </p> 2010-04-07T07:04:33-04:003771756http://forums.asp.net/p/1544419/3771756.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>right u have to store country code in DB.</p> <p>If u developing very complex application and u not have such time than u use online webservices that providing </p> <p>Language code of any country code.</p> <p>Here u will get standard language code if country using multiple languages.</p> <p><br> </p> <p>Thanks</p> 2010-04-07T07:15:18-04:003772076http://forums.asp.net/p/1544419/3772076.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Chintan Dave</h4> <p>right u have to store country code in DB.</p> <p>If u developing very complex application and u not have such time than u use online webservices that providing </p> <p>Language code of any country code.</p> <p>Here u will get standard language code if country using multiple languages.</p> <p><br> </p> <p>Thanks</p> <p></p> </blockquote> &nbsp; <p></p> <p>do you familiar with such a web service out there? I don't have a time to make my own database because I am using for about 60 languages, and for them there is hundreds of culture....</p> <p>&nbsp;</p> <p>&nbsp;</p> <p></p> 2010-04-07T11:07:48-04:003772160http://forums.asp.net/p/1544419/3772160.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>Hi havent use this type of web service. It should be availbe in Net.</p> <p>by the way i can get data from this site and also can download.</p> <p><br> </p> <p>http://www.mcanerin.com/EN/articles/meta-language.asp</p> <p>From this link u can download codes:<br> </p> <p>http://www.ethnologue.com/codes</p> <p><br> </p> <p>Thanks,</p> <p><br> </p> 2010-04-07T12:05:09-04:003773320http://forums.asp.net/p/1544419/3773320.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>Thank you for your links.</p> <p>although, you cannot create CultureInfo object with that database. CultureInfoe.GetCulture will&nbsp;accept code such of &quot;en&quot;&nbsp;and not such as presented in database.</p> <p>about the accept-language you have suggested. this is according to a browser settings. that means that when a user login from INDIA and it's OS using HEBREW it will still displays HEBREW and not INDIA nativae language (which I don't know what it is:) ).</p> <p>I am looking for a way to convert IP location into language codes that will be accepted by cultureInfo object.</p> <p>here is my code:</p> <pre class="prettyprint">foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.NeutralCultures)) { if (!string.IsNullOrEmpty(ci.ToString())) { DataRow dr = data.NewRow(); dr[&quot;ControlID&quot;] = ci.IetfLanguageTag; dr[&quot;ControlName&quot;] = ci.NativeName; dr[&quot;ImageName&quot;] = ci.IetfLanguageTag &#43; &quot;.png&quot;; data.Rows.Add(dr); }</pre>}</PRE> <p>I selected here only languages. from <strong>IetfLanguageTag</strong> I have to conver it to the correct language codes as they displayed on <strong>IetfLanguageTag</strong> variable.</p> <p>&nbsp;</p> <p>What do you think? maybe a redesign is needed?<br> </p> <p>&nbsp;</p> 2010-04-08T01:23:24-04:003773742http://forums.asp.net/p/1544419/3773742.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>Ohh.<br> <br> So may be u can try to set language according User's Browser language.<br> <br> But If u want to get lan. code from Ip Address.Than i can suggest some sites. <br> <br> Also i found some Web service that convert Ip 2 LOcation and so by use of it u can convert it in a lan. code.<br> <br> I dont no these service are free or not. But Check it out your self.<br> <br> http://www.fraudlabs.com/ip2location.aspx<br> http://www.ip2location.com/webservices.aspx<br> http://ws.ip2location.com/ip2locationwebservice.asmx?op=IP2Location<br> Google Search:<br> ip2location web service<br> <br> <br> alo check out this sites for more knowledge:<br> <br> http://www.ipaddresslocation.org/<br> http://www.1keydata.com/blog/2006/09/convert-ip-address-to-country.html<br> http://www.filebuzz.com/files/Convert_Ip_Address_To_Geographic_Location/freeware-1.html<br> http://www.byteblocks.com/post/2009/06/01/Convert-IP-To-Location-and-Address-To-Location.aspx<br> http://ip-to-country.webhosting.info/book/print/5<br> http://www.ip2location.com/free.asp<br> <br> Reverse DNS Lookup<br> http://www.ipaddresslocation.org/dns-ipaddress-lookup.php<br> <br> Thanks<br> Chintan Dave.</p> 2010-04-08T06:31:12-04:003773777http://forums.asp.net/p/1544419/3773777.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>Chintan has given good suggestion,but keep in mond that even you are fetching culture rom web service but keep hook on your hand like in db we have hindi but we need to set genrally prefer to see in english en-GB, so it overrides service else it will display hindi for tamil or telgu person. Please&nbsp; let me know if you need more info. Hope I am not confusing :)<br> </p> 2010-04-08T06:57:07-04:003774122http://forums.asp.net/p/1544419/3774122.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Chintan Dave</h4> <p>Ohh.<br> <br> So may be u can try to set language according User's Browser language.<br> <br> But If u want to get lan. code from Ip Address.Than i can suggest some sites. <br> <br> Also i found some Web service that convert Ip 2 LOcation and so by use of it u can convert it in a lan. code.<br> <br> I dont no these service are free or not. But Check it out your self.<br> <br> http://www.fraudlabs.com/ip2location.aspx<br> http://www.ip2location.com/webservices.aspx<br> http://ws.ip2location.com/ip2locationwebservice.asmx?op=IP2Location<br> Google Search:<br> ip2location web service<br> <br> <br> alo check out this sites for more knowledge:<br> <br> http://www.ipaddresslocation.org/<br> http://www.1keydata.com/blog/2006/09/convert-ip-address-to-country.html<br> http://www.filebuzz.com/files/Convert_Ip_Address_To_Geographic_Location/freeware-1.html<br> http://www.byteblocks.com/post/2009/06/01/Convert-IP-To-Location-and-Address-To-Location.aspx<br> http://ip-to-country.webhosting.info/book/print/5<br> http://www.ip2location.com/free.asp<br> <br> Reverse DNS Lookup<br> http://www.ipaddresslocation.org/dns-ipaddress-lookup.php<br> <br> Thanks<br> Chintan Dave.</p> <p></p> </blockquote> &nbsp; <p></p> <p>Thank you for your links:)</p> <p>Although all of this links is to get the country code.</p> <p>Here is a data example that this webservices returnes:</p> <p> <table id="Table1" cellspacing="0" cellpadding="0" width="96%" align="center" border="0"> <tbody> <tr> <td></td> </tr> <tr> <td align="middle"> <table id="Table2" cellspacing="0" cellpadding="0" width="70%" border="0"> <tbody> <tr> <td bgcolor="#cccccc"> <table id="Table3" cellspacing="1" cellpadding="3" width="100%" border="0"> <tbody> <tr bgcolor="#eeeeee"> <td colspan="2">Input Data</td> </tr> <tr bgcolor="#ffffff"> <td width="38%">IP</td> <td width="62%">68.142.197.65</td> </tr> <tr bgcolor="#ffffff"> <td>LICENSE</td> <td>(Your License Key)</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td align="middle"> <table id="Table4" cellspacing="0" cellpadding="0" width="70%" border="0"> <tbody> <tr> <td bgcolor="#cccccc"> <table id="Table5" cellspacing="1" cellpadding="3" width="100%" border="0"> <tbody> <tr bgcolor="#eeeeee"> <td colspan="2">Result</td> </tr> <tr bgcolor="#ffffff"> <td width="38%">COUNTRYCODE</td> <td width="62%">US</td> </tr> <tr bgcolor="#ffffff"> <td>COUNTRYNAME</td> <td>UNITED STATES</td> </tr> <tr bgcolor="#ffffff"> <td>REGION</td> <td>CALIFORNIA</td> </tr> <tr bgcolor="#ffffff"> <td>CITY</td> <td>SUNNYVALE</td> </tr> <tr bgcolor="#ffffff"> <td>IP2LATITUDE</td> <td>37</td> </tr> <tr bgcolor="#ffffff"> <td>IP2LONGITUDE</td> <td>-122</td> </tr> <tr bgcolor="#ffffff"> <td>ZIPCODE</td> <td>94089</td> </tr> <tr bgcolor="#ffffff"> <td>ISPNAME</td> <td>INKTOMI CORPORATION</td> </tr> <tr bgcolor="#ffffff"> <td>DOMAINNAME</td> <td>YAHOO.COM</td> </tr> <tr bgcolor="#ffffff"> <td>CREDITSAVAILABLE</td> <td>(Your Credit Available)</td> </tr> <tr bgcolor="#ffffff"> <td>MESSAGE</td> <td>&nbsp;</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> </tr> </tbody> </table> </p> <p>How can I create a CultureInfo object from that? CultureInfo using such codes&nbsp; EN-US EN-GB and so on.<br> If there is a tables that will do the connection between country code (US) to &quot;EN&quot; language, then the problem solved. untill I cannot doing the conversion and get &quot;EN&quot; value I cannot create CultureInfo object, which is the object needed to work multilangual with ASP.NET</p> <p>I hope I am clear. </p> <p>&nbsp;</p> 2010-04-08T10:51:04-04:003774129http://forums.asp.net/p/1544419/3774129.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>create base page and have to use connection table as I mentioned above, go through below forum</p> <p><a href="/t/1514920.aspx">http://forums.asp.net/t/1514920.aspx</a><br> </p> <p><b>Mark as answer</b> if it helps.<br> </p> <p><br> </p> 2010-04-08T10:55:50-04:003774241http://forums.asp.net/p/1544419/3774241.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>ye. </p> <p>check this page to implement Localisation.</p> <p>http://forums.asp.net/t/1514920.aspx</p> <p>http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx</p> <p>Mark as Answer if u get<br> </p> <p><br> </p> 2010-04-08T11:51:57-04:003775715http://forums.asp.net/p/1544419/3775715.aspx/1?Re+How+to+get+the+main+cultur+s+language+from+Country+Code+Re: How to get the main cultur's language from Country Code? <p>Thanks!&nbsp;</p> 2010-04-09T03:08:15-04:00