Nepali language support for your website: Tutorial

Naya is committed to providing Nepali language support to as many Nepali users as possible. Naya is thus announcing the release of a universal Nepali language plugin. With this plugin, you can now add Nepali language feature to any website. Your users will be able to type directly in Nepali in your own website. This plugin can be used to add Nepali language support to any text field (input or textarea). Follow these easy steps to add Nepali language support to your existing website.

View the demo here: deathg0d.github.io/nepali-demo.

Add javascript

Firstly, you need to download our js language pack from github. Go to https://github.com/deathg0d/nepali-demo…, browse to the javascripts folder and download the nayaEN2NPinit.js file. Upload this file to your server (May be under /js ? This is entirely up to you).

Edit: Or simply download the file from this link: https://raw.githubusercontent.com/deathg…

Once you have uploaded this file to your server, you need to include it in your website by adding the following line just before the end body tag (</body>).

<script src="YOUR_JS_FOLDER/nayaEN2NPinit.js"></script>
Your code should look something like the following:

     ....
     <script src="YOUR_JS_FOLDER/nayaEN2NPinit.js"></script>
</body>

Add tags

Add the following anchor tag before all textareas or input text fields that you would like to have the Nepali language feature on.

<a rel="nofollow" href="http://naya.com.np"; title="Nepali Social Network" class="naya_convert">naya.com.np</a>
Your html code should look something like the following:
<a rel="nofollow" href="http://naya.com.np"; title="Nepali Social Network" class="naya_convert">naya.com.np</a>
<textarea></textarea>
or
<a rel="nofollow" href="http://naya.com.np"; title="Nepali Social Network" class="naya_convert">naya.com.np</a>
<input/>

Toggle color template

Once the plugin is initialized, all selected input fields will have Nepali language support. When you click on these fields, you will see toggle options to switch between Nepali and English language. You can also customize the look of these options. You can add data-site = "dark" in the <a> tag as shown below for a darker design.

<a rel="nofollow" href="http://naya.com.np"; class="naya_convert" title="Nepali Social Network" data-site="dark">naya.com.np</a>

Hide tags

Lastly, you obviously do not want our link<a> tags appearing in your website. To hide these tags add the following css property to your stylesheet.

<style>
     .naya_convert{
          display: none;
     }
</style>
Your code could therefore look like the following:
<head>
	...

<style> .naya_convert{ display: none; } </style> </head>
Your input fields now have Nepali language support !! Your final html file could look something like the following:

<html>
	<head>
		...

<style> .naya_convert{ display: none; } </style> </head> <body> ... <a rel="nofollow" href="http://naya.com.np"; title="Nepali Social Network" class="naya_convert">naya.com.np</a> <textarea></textarea> <script src="YOUR_JS_FOLDER/nayaEN2NPinit.js"></script> </body </html>


A video demo: youtube.com/watch?v=oeYGCvryfE4…