Jump to content

Language Translations


infinity86

Recommended Posts

Describe the actual dictionary in some form. How you realize the UI for mactching the words in the dictionary will depend highly on your method.One method is that you store the mappings in a database. Read the W3Schools SQL tutorial to learn how to work with databases, and get yourself MySQL (and its GUI tools) in order to practice what you've learned.Only once you have the words described can be do something more. On the very least, desribe them in some small portion that represents your total vision.

Link to comment
Share on other sites

Describe the actual dictionary in some form. How you realize the UI for mactching the words in the dictionary will depend highly on your method.One method is that you store the mappings in a database. Read the W3Schools SQL tutorial to learn how to work with databases, and get yourself MySQL (and its GUI tools) in order to practice what you've learned.Only once you have the words described can be do something more. On the very least, desribe them in some small portion that represents your total vision.
Hi,Well the dictionary is going to be in English translating into Persian and vice versa. Its going to be sorted in order of alphabet and also will contain a search box where a user can look for a particular word.I hope this will give you a good idea of what i am trying to do.Thanks alot.
Link to comment
Share on other sites

I told you - learn (and install) MySQL and PHP.I suppose you figured the PHP part out, since you're posting in the PHP forum. Your other piece of the puzzle is SQL. Learn that, and you'll know what to do.

Link to comment
Share on other sites

I told you - learn (and install) MySQL and PHP.I suppose you figured the PHP part out, since you're posting in the PHP forum. Your other piece of the puzzle is SQL. Learn that, and you'll know what to do.
I have got both PHP and MYSQL (WAMP) installed in my computer, and have spent alot of time reading the tutorials for php and mysql but still dont realy know how to begin. I know its not a rocket science but im not good at programming at all.
Link to comment
Share on other sites

I can tell you the basic algoritm, but if if I (or anyone) give you sample code, it will be almost as I'm writing the whole dictionary.Like I said earlier, store the mapping in the DB. That is, have a DB table in which you'll have the English words in one column and the Persian ones in another one.Upon form submittion in PHP (either with GET or POST, doesn't matter), make a query on the DB. In it (the query), select all rows from the table where the word is present in one of the columns (which ones depends on whether the user has chosen to translate from or to English). Print the results from the query.In addition to plain 1:1 mappings like this one, you could also store more detailed translations, as most detailed dictionaries do. For that, you'll need two tables - one in which you describe the English words, and the associated persian translation in detail, and a second one in which you describe the Persian words and their associated English translations in detail. Like before, perform a query over one of those two tables (depending on what the user has chosen) and print the matches. You may also print matches for either table, but that will make the dictionary slightly slower.

Link to comment
Share on other sites

I can tell you the basic algoritm, but if if I (or anyone) give you sample code, it will be almost as I'm writing the whole dictionary.Like I said earlier, store the mapping in the DB. That is, have a DB table in which you'll have the English words in one column and the Persian ones in another one.Upon form submittion in PHP (either with GET or POST, doesn't matter), make a query on the DB. In it (the query), select all rows from the table where the word is present in one of the columns (which ones depends on whether the user has chosen to translate from or to English). Print the results from the query.In addition to plain 1:1 mappings like this one, you could also store more detailed translations, as most detailed dictionaries do. For that, you'll need two tables - one in which you describe the English words, and the associated persian translation in detail, and a second one in which you describe the Persian words and their associated English translations in detail. Like before, perform a query over one of those two tables (depending on what the user has chosen) and print the matches. You may also print matches for either table, but that will make the dictionary slightly slower.
Thanks that helped me to understand quite clearly, but when i am writing the persian (Arabic) words in the database (MYSQL 5.0.51b) it doesnt seem to be working, nothing can be shown!any ideas?
Link to comment
Share on other sites

Thanks that helped me to understand quite clearly, but when i am writing the persian (Arabic) words in the database (MYSQL 5.0.51b) it doesnt seem to be working, nothing can be shown!any ideas?
Sample code you've used please?
Link to comment
Share on other sites

well i have created tables, but when inserting the persian words it doesnt recognise.
Again - sample code please.Or... how are you inserting the persian words? Aren't you using some kind of code? Or are you using some sort of GUI (and which one)?
Link to comment
Share on other sites

Again - sample code please.Or... how are you inserting the persian words? Aren't you using some kind of code? Or are you using some sort of GUI (and which one)?
sorry my mistake i meant when creating table to enable me to insert persian words into it, i get this error, which is shown below.mysql> create table dari1( -> d_id int(5)NOT NULL auto_increment, -> id int(5) NOT NULL, -> word varchar(100), -> def varchar(100), -> PRIMARY KEY (d_id), -> FOREIGN KEY (id) references englishwords(id) -> character set latin1 collate latin1_persian_ci);ERROR 1064: You have an error in your SQL syntax near 'character set latin1 collate latin1_persian_ci)' at line 8
Link to comment
Share on other sites

How are you using MySQL? It looks like you're using the command line.I suggest you get yourself the GUI tools (see the link from my first post) and use them to create the tables. It will be much easier.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...