PDA

View Full Version : Language options



Bok
09-05-2009, 11:33 AM
Few requests for this. Wouldn't be too difficult..

1. provide an optional dropdown to select the language.
2. store the language against the facebook user
3. Get the translations of the messages.
4. At publish time, decide which language to use and post accordingly.

gopher_yarrowzoo
09-05-2009, 08:19 PM
Fairly easy to do I would have thought...
ID english translation (language X) ....
1 this is english (this is french) etc... needs to be consistant

then it would be a case of <blank 1> instead of what we have now or maybe that would be too hard..

Bok
09-08-2009, 09:27 AM
I've made the database changes to save the ISO language code. Currently it's just defaulting to 'eng'.

Next step is to build a table of all the ISO languages (easy enough) and have a column for 'translated' - Only display those in a dropdown via join until translations are made.

An interesting point though is that the facebook app itself has translations available though from what I can see it's just for the webpages themselves.

AMDave
10-25-2009, 07:22 AM
Howzit going now Bok?
Did you get over the char-code issue?

Sorry I have not completed more of the translations since the 2nd draft.
I've been busy preparing the FDCPS migration to PCZ's server.
When you are ready for some more phrases give me a prod :thumbs:

gopher_yarrowzoo
10-25-2009, 10:53 AM
Dave, yeah we fixed it, ****ing stupid ISO / UTF-8 encoding issue now resolved we hope :P...
Well i've been offically slacking, but then again work and the bloody cold and other things have kept me busy..

Bok
10-25-2009, 06:51 PM
Howzit going now Bok?
Did you get over the char-code issue?

Sorry I have not completed more of the translations since the 2nd draft.
I've been busy preparing the FDCPS migration to PCZ's server.
When you are ready for some more phrases give me a prod :thumbs:

No, no resolution at all and no replies from the facebook dev forum either... :(

Gopher, this is the posts made using a different language where they show up completely different to what we put out, not using the characters specified..

gopher_yarrowzoo
10-26-2009, 11:43 AM
Ah right so what linguistically doesn't work right? See what happens when i don't look at the updates and Facebook ****s around with the UI in such away that no-one likes it..

Bok
10-26-2009, 12:30 PM
http://forum.developers.facebook.com/viewtopic.php?id=43809

All works ok on our server, just gets messed up on the facebook side. So until someone tells me how I'm supposed to encode it (if at all) I'm kind of stuck..

gopher_yarrowzoo
10-26-2009, 07:32 PM
There is a languages tab not sure if it's possible to use that to do the translations or not, just did a quick check looks like not... it's closed!

Bok
10-26-2009, 07:40 PM
It can, but it's only for online content like canvas pages and tabs. Works pretty well actually. I already did the English (Pirate) translation a few weeks ago :)

But it's not intended for posts at all.

gopher_yarrowzoo
10-26-2009, 07:45 PM
you tried this
< span lang='fr' >Èquipe:< /span > ?

Bok
10-26-2009, 09:12 PM
hah, think I got it....

If I utf8_encode it first before sending to facebook it comes out... will do more tests..

LAURENU2
10-27-2009, 01:10 AM
you tried this
< span lang='fr' >Èquipe:< /span > ?
That almost sounds like Asgard to me :lmao:

AMDave
10-27-2009, 05:06 AM
I just looked through a good few of the FB guides and tutoriels from more than one FB Resources page and no-where does anyone get into translation, linguistics or character encoding.

This sounds like a Facebook "Language" Quick Reference Guide in the making.

gopher_yarrowzoo
10-27-2009, 05:32 AM
Ja vol mien heir...
And thanks for volunteering :thumbs: lol sorry Dave couldn't resist.

Bok
10-27-2009, 06:53 AM
I just looked through a good few of the FB guides and tutoriels from more than one FB Resources page and no-where does anyone get into translation, linguistics or character encoding.

This sounds like a Facebook "Language" Quick Reference Guide in the making.

I tell you, it's like Black Magic at times..

This is what I end up with as a language file btw..



$milestone = number_format($mstone[$i],0,',','.');
$cat_project = 'Projekt';
$cat_milestone = 'Milestone';
$cat_projectapp = 'Projekt App';
$cat_team = 'Team';
$cat_title = 'BOINC Meilensteine';
$message = " bestanden $milestone in $descr[$i]!";


I'll likely make it live with French and German today (all I've done) and then just add them in as I go along

gopher_yarrowzoo
10-27-2009, 12:18 PM
I really should look at this, i did look at the code last night and try to figure our what was going where but because it's been a while since I really coded my brain went "wibble" and kinda gave up... maybe need to clear up the folders so all the "test" stuff is in a test folder or something...

Bok
10-27-2009, 05:58 PM
Running live now with german, french and italian. It's only on the project milestones though. I haven't done the combined or bagdes ones yet.

Looks ok though, last run had a couple of italian and one french which looked good..

Bok

Bok
10-28-2009, 03:48 PM
hmmmm, hope this isn't gibberish as it did post...



PROCESSING: <fb_id> - ca0f67f204015c0bb41b4f2eb3796ad4 9.999 in Yoyo@Home - neu gewonnenen ein Abzeichen in bronze Yoyo@Home!Successfully posted!...


and it is a valid badge gained today - shown here (http://stats.free-dc.org/stats.php?page=user&proj=yoy&name=184)

Bok :thumbs:

AMDave
10-28-2009, 05:26 PM
Well done Bok!

If it is gibberish it will be my problem and I will fix the translations.

When you run out of what is there so far, prod me and I'll get some more done.

Great job :thumbs:

Bok
10-28-2009, 06:11 PM
only done 3 languages so far, will get spanish and dutch next I think and then be more adventurous and go for Czech..

Bok
10-28-2009, 06:39 PM
added spanish. The phrases are a little different Dave, so I put a few of them through Google translate for spanish and they came out slightly different, let me know what you think. If you want to do some others (or anyone for that matter) - this is the format I need them in..

This is es_ES.php, note the number format I need too, last two parameters are what needs to change and they are decimal point and thousand seperator..



$cat_project = 'Proyecto';
$cat_subproject = 'Subproyecto';
$cat_milestone = 'Hito';
$cat_projectapp = 'Solicitud del proyecto';
$cat_team = 'Equipo';
$cat_title = 'Hitos BOINC';
$milestone = number_format($mstone[$i],0,',','.');
$message = " acaba de pasar $milestone en $descr[$i]!";
$message2 = " acaba de pasar en $milestone BOINC combinado!";
$message3 = " gan" . chr(23) . " una insignia de $badge_type[$i] en $descr[$i]!";


I'm NOT (yet) transcribing the names of the badges as I pull them from my database and haven't figured out a convenient way to do it yet (could go down the 'switch' way but am avoiding that for now..thinking of the future mainly...)

a en_US.php would look like



$cat_project = 'Project';
$cat_milestone = 'Milestone';
$cat_projectapp = 'Project App';
$cat_team = 'Team';
$cat_title = 'BOINC Milestones';
$message = " just passed $milestone in $descr[$i]!";
$message2 = " just passed $milestone in Combined BOINC!";
$message3 = " just gained a " . $badge_type[$i] . " badge in $descr[$i]!";



Bok

gopher_yarrowzoo
10-28-2009, 07:39 PM
I know this may seem silly but would it not be quicker to have a lang translate table in the DB?
id,lang,cat_project,cat_subproject,cat_milestone,cat_projectapp,cat_team,cat_title,milestone_numform ,message,message2,message3
'1','en_US','Project','Milestone','Project App','Team','BOINC Milestones',',',' just passed #milestone in #descr[#i]!',' just passed $milestone in Combined BOINC!',' just gained a #badge_type[#i] badge in #descr[#i]!'
'2','fr_FR','....french here..............'
'3','de_DE','....german here............'
'4','it_IT','.....italian here...........'
'5','es_ES','Proyecto','Subproyecto','Hito','Solicitud del proyecto','Equipo','Hitos BOINC','.','acaba de pasar #milestone en #descr[#i]!',' acaba de pasar en #milestone BOINC combinado!',' gan' . chr(23) . ' una insignia de #badge_type[#i] en #descr[#i]!'

SELECT cat_project,cat_subproject,cat_milestone,cat_projectapp,cat_team,cat_title,milestone_numform,message ,message2,message3 WHERE lang==$lang FROM lang_table
assign $cat_project, $cat_subproject, $cat_milestone, $cat_projectapp, $cat_team ,$cat_title, $milestone1, $message, $message2, $message3

$milestone = number_format($mstone[$i],0,',',$milestone1);
$message=str_replace("#","$",$message);
$message2=str_replace("#","$",$message2);
$message3=str_replace("#","$",$message3);

Quicker?
Badges could do the same depends on how many badges we got and how many languagues
badge,image,en_US,fr_FR,de_DE,it_IT,es_ES.....etc..

Bok
10-28-2009, 08:00 PM
Would be another way to do it, not necessarily quicker though, just different complications.

AMDave
10-29-2009, 04:33 AM
there is a double-up on the Pirate lingo


Cap'n Cap'n David Nicol just passed 1,900,000 in Combined BOINC!
2 x Cap'n

Bok
10-29-2009, 07:11 AM
I haven't done a pirate translation for this yet ! Not sure where that is coming from, must be a facebook bug itself..