aMSN Forums
September 30, 2014, 12:48:23 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: 1 2 [3] 4 5 ... 8
  Print  
Author Topic: Multilanguage amsn Web site  (Read 49224 times)
sabit ertan
Newbie

Offline Offline

Posts: 34


View Profile WWW
« Reply #30 on: October 21, 2009, 02:17:28 pm »

hi folks. finally translation is done(only text based). also amsn.tar.gz in previous post is updated.
Logged

kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #31 on: October 22, 2009, 09:32:28 am »

cool, good job!
I'm currently away on business travel, so I'll have a look when I get back home... did you get the sql dump from lephilousophe ?
Logged

KaKaRoTo
arantes
Super Power User
**
Offline Offline

Posts: 364



View Profile
« Reply #32 on: October 24, 2009, 01:05:38 am »

Hi. Nice job =D Only one little thing we should change, it's the way dates are displayed. I think displaying "September 20, 2009 @ 22:55:23" in every languages is... not correct.
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #33 on: October 24, 2009, 04:58:09 pm »

hehe, good point!
Logged

KaKaRoTo
sabit ertan
Newbie

Offline Offline

Posts: 34


View Profile WWW
« Reply #34 on: October 24, 2009, 09:22:05 pm »

Quote from: "arantes"
Hi. Nice job =D Only one little thing we should change, it's the way dates are displayed. I think displaying "September 20, 2009 @ 22:55:23" in every languages is... not correct.

Smiley yeah this is the another sql problem for us(which we already talking about). but thanks to point it is proof that we are not alone Smiley. when i get current sql dump i'll try to solve problem.
Logged

sabit ertan
Newbie

Offline Offline

Posts: 34


View Profile WWW
« Reply #35 on: October 25, 2009, 12:09:01 pm »

hi there, thanks lephilousophe for sending me current sql dump. i work on it. i try to add new rows to sql and some php code to admin part.
Logged

kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #36 on: October 25, 2009, 01:37:18 pm »

ah, he got time to do it, cool, glad you've got the data now, good luck with everything! can't wait to see the result!
Keep it up! Smiley
Logged

KaKaRoTo
sabit ertan
Newbie

Offline Offline

Posts: 34


View Profile WWW
« Reply #37 on: October 27, 2009, 09:39:41 am »

hi, i listened LePhilousophe   and i add new columns to sql. finally i wrote a php script for adding new language easily(addnewlang.php). for now there is three files for each language: languages definitions php(example for french:fr.php ) for text in php files and the others are   skins.xml and plugins.xml anyone can edit this files and an admin can add new language to site and mysql by using addnewlang.php.(website doesnt require xml file its just use adding translated part to mysql)
to do:
1. adding translatable news and pool section(both mysql and xml files(also adding codes to addnewlanguage.php))
2. making gui for addnewlanguage.php(i think it will be in admin/index.php)
3. share translatable files here
4. make good translation for my language(Turkish) Smiley
Logged

kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #38 on: October 27, 2009, 11:02:58 am »

oh cool! so you use an xml file and your php script imports the language translations into the database, right ? I think that's the best solution, good job on designing that! Smiley
Keep up the good work Smiley
Logged

KaKaRoTo
sabit ertan
Newbie

Offline Offline

Posts: 34


View Profile WWW
« Reply #39 on: October 27, 2009, 11:16:31 am »

Quote from: "kakaroto"
oh cool! so you use an xml file and your php script imports the language translations into the database, right ?
Absolutely what i mean Smiley. and little news: i solve date showing in selected languages Smiley .
Logged

sabit ertan
Newbie

Offline Offline

Posts: 34


View Profile WWW
« Reply #40 on: October 27, 2009, 07:19:30 pm »

i made website fully multilingual Smiley but    we need translator. ok i add everything to demo site sorry for utf-8 characters. please look at news part title and date.
Logged

rubioxtu
Newbie

Offline Offline

Posts: 9


View Profile
« Reply #41 on: October 28, 2009, 01:00:28 am »

Hi, I can traslate to Spanish if needed.
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #42 on: October 28, 2009, 03:33:00 am »

Hi rubioxtu, thanks, we'll appreciate spanish translation! Keep monitoring this thread, we'll contact you very very soon for help!
@sabit_ertan: Ok, I finally had some time (not really, but I just will sleep less..) to have a look at your code... and I've modified a few things.. mainly to make the code cleaner... for example, I hated seeing :
Code:
<?php echo '<br/><br/><li><ul><blablabla><a uri=http&#58;//foo.bar>'._SOME_TRANS.'</a></ul></li><etc>'?>

I prefered :
Code:
<br/><br/><li><ul><blablabla><a uri=http://foo.bar><?php echo _SOME_TRANS?> </a></ul></li><etc>

Also, there were a lot of places where you forgot to put the semicolon at the end of the echo.
also the libs/cookies.php was not indented at all!!! So I indented it correctly...
I also removed the code that you had added but commented because it was useless.. if it's unused and useless, remove it!
Anyways, after lots of work, I've got a 'cleaner' version of the code. You can get it from http://amsn-project.net/~kakaroto/amsn-www.tar.gz
Please use that version for any additional work, this way we avoid having two branches of the code... and I won't have to re-read the whole thing again to see what you changed...

Also note that I didn't really finish everything from it, so I just took some personal notes, but I think you will find them interesting. You'll find them here : http://www.amsn-project.net/~kakaroto/www/todo
Right now, this is the notes I have :
Quote
check mysql_session.inc.php change, why add that ?
change includes/side-panel-polls.php (see solution below)
n includes/side-panel-polls.php fix typo it's POLL and not POOL
change includes/news.php (see solution below)
in includes/news.php, what does strftime do and why replace date ? can it respect the locale for date conversion?
maybe clean translations.php.. list of items should be a single multiline translation that gets auto-unrolled with <li>$line</line>
try to avoid having html <tags> in translated data as much as possible (but not necessarily completely remove it)
verify all the changes to stylesheet.css, what are all those changes, what do they do and why were they added?
update developer list
remove donation page
check admin stuff later, seems WIP
check libs/func.lib.php, why replace eregi by preg_match
fix index.php.. list of features should be a single multiline translation that gets auto-unrolled with <li>$line</line>
fix index.php.. the Download/plugins/skins text is overlayed and screws up the image a bit when its hovered (stylesheet issue for my browser?)
fix features.php.. same solution as translations.php and index.php
clean developer.php and remove donation
fix poll_results.php .. typo POLL and not POOL
in linux-downloads.php, fix typo s/INDEPENT/INDEPENDENT/
in linux-downloads.php, the source tarball notice disappeared. readd!
in linux-downloads.php, fix date of tarball to become universal
clean linux-downloads.php
fix skins.php


The system for database translation should be like this :
we keep getting the default key as english, but we'd have one additional table for translations. All tables use an 'id' as the primary key, so we'll use that to our advantage.. let's take for example the 'amsn_poll' database, we would leave it as it is, and do :
SELECT id, question FROM amsn_poll..
then we would do :
SELECT translation FROM amsn_translations WHERE id = $id AND lang = $lang_code AND type = "poll_question"
if we get something, we use that translation instead, if we don't, we keep the default english translation.
So our new amsn_translations table would have 4 columns :
id, type, lang, translation
with the primary key being the tuple (id, type, lang).

In that table we would have translations for (the 'type' column) : poll_question, poll_answer, skin, plugin, news_title, news_text

This makes it much more robust because we always have a value to fallback to, it also does not require modifying the database for every language.. and also, because this is a database, we don't create a column for each language!!! we create a column called 'lang' and put the value in there!!!


How I would see it is that we should be able to later have some way to dump the untranslated stuff, like use an SQL SELECT with a JOIN to quickly find all untranslated keys for a specific language...  and automatically generate the 'source xml' where we would only have :
id, original text, translation
and automatically generate a comment in the xml like <--? TODO: untranslated key --?> so that translaters can quickly edit the xml file

Note that they're not all critics, some are just personal notes like "clean this file" because I was lazy to clean it so I want to do it later and don't want to forget... or like why you replaced date by strftime, i'll need to check the php doc to understand the difference, so you don't have to do anything for those points...
However, I really didn't like the way you made the database change.. I believe you may not have a lot of experience with databases, that's why... as a general rule.. once you design your database.. you NEVER change it.. the "alter table" commands are just there to help in case of some big mistake, but they should never be used once the database is finished and runnning.
So I wrote  a different design which should be also pretty fairly simple to implement and which will be much much better design. I've written my ideas on the design in that todo file too, so you could have a look and work on it.
Hopefully, tomorrow, if we fix all this, I'll try to get the website running so we can test it a little!
And once we announce 0.98.1, everyone will be able to enjoy the new multilangual website! Smiley

Gotta sleep now.. good night!
Logged

KaKaRoTo
sabit ertan
Newbie

Offline Offline

Posts: 34


View Profile WWW
« Reply #43 on: October 28, 2009, 08:21:27 am »

as you said, i am not professional at database and php. i just gave an idea and people who is the professional like you kakaroto can improve it. thanks for all. i will listen you and try to make new database structure.
Logged

kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #44 on: October 28, 2009, 12:19:16 pm »

sure, no problem, I'm not trying to criticize, just trying to improve, I hope you didn't take it the wrong way!
Thanks for taking care of it.

p.s: I'm not really a database expert either, so I hope my design is good enough Smiley
Logged

KaKaRoTo
Pages: 1 2 [3] 4 5 ... 8
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!