The project I'm attempting is to make it easy for a user to convert a language file from one language to another using a form while saving the file being translated. In the case the original file is English and if someone wants to use the script in a different language--in this case Tagalog as I'm currently in the Philippines but also to be used in China eventually.
All pages opened will be in the language designated in a settings file (db). The first page of the script will contain a short form where an interpreter can choose from the language files in place via a <select> input as follows:
print"Please Select A Language To Convert\n" print"<select name="lang_files_completed">\n"; print"<option value="$lang_files{'1'}">$lang_files{'1'}</option>\n";#l +ist all files already written print"</select>\n"; print"<br />Enter The Name Of The New Language\n"; print"<input type="text"name="new_language">\n"
Submitting this form will put in place another form with all the entries in the language file selected with a textbox under it to type in the new language:
print"$lng{'1'}\n"; print"<input type="text"name="new_language_text">\n";
When this form is submitted the new file will be created and also added to the <select> input for future translations.
I still have much to figure out such as how to call the values from the text file which holds them without entereing a hash into that file. One of the things I am considering at this point(thought I had it all figured out) was just creating the files to process the forms as I go. That was where I came up with the idea of using a forloop and just using numbers for the keys. Once the number of entries in the db are counted my intention was creating the file on the fly(please excuse using $a and $b for variables---for simplicity sake).
for($b=0;$b<$cnt;$b++){$a=$b+1;###$cnt---is number of entries in the h +ash print AAA"print\"\$lng{\'$a\'}<br />\\n\"\;\n"; print AAA"print\"<input type=\\\"text\\\"name=\\\"nl$a\\\"size=\\\"200 +\\\"><br />\\n\"\;\n"; }
My thinking was since the keys are numbers I would just use the forloop and creating the file on the fly this way prints out like $nl1, $nl2, etc.,... Please overlook things if I'm out of line doing it this way but with what little I know about perl at this point I'm just trying to make ends meet. I have other things to get squared away on also I realize. If you would like I will still post the code for the project. I've learned most from online tutorials, forums, etc.,. If budget allowed for it I would stock up on perl books(I do have a 11 year old copy of the Perl Cookbook which has also helped from what I've been able to understand of it. I see a bunch of tutorials at this site I intend to feast on. I hope I was able to explain the nature of the project clear enough. Thanx. Dave
In reply to Re^4: Double Variables
by typomaniac
in thread Double Variables
by typomaniac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |