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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.