You will also need to install the Farsi language pack. Go to site admin -> language packs or simply go direct to yourmoodlesite.com/admin/tool/langimport/index.php and select Farsi.

If you want to translate the existing Moodle strings, then it might be better to translate them via AMOS. Then everyone will benefit from the translations. https://docs.moodle.org/dev/Contributing_a_translation

I will explain how to do it for a generic PHP project, which should work for Moodle too.
Firstly create a separate folder named lang in your project. This folder can be used to put your language packs and unicode handler libraries.
For unicode handling , save the following file as portable-utf8.php in the lang folder.

portable-utf8.php

Your language pack files can be named as bahar.php, tamil.php etc. and saved in the same location.
A sample file should look like this; with the keyword string followed by the translation.

Please note that this string should match with the string in your language pack file.
The language of your choice is passed from page to page through the GET method. So you will need to pass it when when linking. Optionally, if you want to do dynamic translation on a button click, you can just use this jQuery code.

this might look lengthy at first, but when you have hundreds, or maybe thousands of strings to add, this is the easiest way. All you need to do is add the PHP code to the top of your page, replace the string as given above with a single line of code and add the string to your language pack file if it does not exist.
If you need any further explaination, please let me know.

I will explain how to do it for a generic PHP project, which should work for Moodle too.
Firstly create a separate folder named lang in your project. This folder can be used to put your language packs and unicode handler libraries.
For unicode handling , save the following file as portable-utf8.php in the lang folder.

portable-utf8.php

Your language pack files can be named as bahar.php, tamil.php etc. and saved in the same location.
A sample file should look like this; with the keyword string followed by the translation.

Please note that this string should match with the string in your language pack file.
The language of your choice is passed from page to page through the GET method. So you will need to pass it when when linking. Optionally, if you want to do dynamic translation on a button click, you can just use this jQuery code.

this might look lengthy at first, but when you have hundreds, or maybe thousands of strings to add, this is the easiest way. All you need to do is add the PHP code to the top of your page, replace the string as given above with a single line of code and add the string to your language pack file if it does not exist.
If you need any further explaination, please let me know.