Results 1 to 26 of 26

Thread: Language options

  1. #1
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13

    Language options

    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.

  2. #2
    Free-DC Semi-retire gopher_yarrowzoo's Avatar
    Join Date
    Mar 2002
    Location
    Knoxville, TN
    Posts
    3,985
    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..
    Semi-retired from Free-DC...
    I have some time to help.....
    I need a new laptop,but who needs a laptop when you have a phone...
    Now to remember my old computer specs..


  3. #3
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    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.

  4. #4
    Administrator AMDave's Avatar
    Join Date
    Sep 2004
    Location
    deep in a while-loop
    Posts
    1,948
    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
    . . . . . ___
    . . . . . . .\___/\______
    . . . . . . . \__AMD___\\__
    -----------------------------------------

  5. #5
    Free-DC Semi-retire gopher_yarrowzoo's Avatar
    Join Date
    Mar 2002
    Location
    Knoxville, TN
    Posts
    3,985
    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..
    Semi-retired from Free-DC...
    I have some time to help.....
    I need a new laptop,but who needs a laptop when you have a phone...
    Now to remember my old computer specs..


  6. #6
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    Quote Originally Posted by AMDave View Post
    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
    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..

  7. #7
    Free-DC Semi-retire gopher_yarrowzoo's Avatar
    Join Date
    Mar 2002
    Location
    Knoxville, TN
    Posts
    3,985
    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..
    Semi-retired from Free-DC...
    I have some time to help.....
    I need a new laptop,but who needs a laptop when you have a phone...
    Now to remember my old computer specs..


  8. #8
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    http://forum.developers.facebook.com...c.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..

  9. #9
    Free-DC Semi-retire gopher_yarrowzoo's Avatar
    Join Date
    Mar 2002
    Location
    Knoxville, TN
    Posts
    3,985
    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!
    Semi-retired from Free-DC...
    I have some time to help.....
    I need a new laptop,but who needs a laptop when you have a phone...
    Now to remember my old computer specs..


  10. #10
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    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.

  11. #11
    Free-DC Semi-retire gopher_yarrowzoo's Avatar
    Join Date
    Mar 2002
    Location
    Knoxville, TN
    Posts
    3,985
    you tried this
    < span lang='fr' >Èquipe:< /span > ?
    Semi-retired from Free-DC...
    I have some time to help.....
    I need a new laptop,but who needs a laptop when you have a phone...
    Now to remember my old computer specs..


  12. #12
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    hah, think I got it....

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

  13. #13
    =>Team Joker<= LAURENU2's Avatar
    Join Date
    Dec 2004
    Location
    Chicago IL USA
    Posts
    5,478
    Blog Entries
    1
    Quote Originally Posted by gopher_yarrowzoo View Post
    you tried this
    < span lang='fr' >Èquipe:< /span > ?
    That almost sounds like Asgard to me

  14. #14
    Administrator AMDave's Avatar
    Join Date
    Sep 2004
    Location
    deep in a while-loop
    Posts
    1,948
    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.
    . . . . . ___
    . . . . . . .\___/\______
    . . . . . . . \__AMD___\\__
    -----------------------------------------

  15. #15
    Free-DC Semi-retire gopher_yarrowzoo's Avatar
    Join Date
    Mar 2002
    Location
    Knoxville, TN
    Posts
    3,985
    Ja vol mien heir...
    And thanks for volunteering lol sorry Dave couldn't resist.
    Semi-retired from Free-DC...
    I have some time to help.....
    I need a new laptop,but who needs a laptop when you have a phone...
    Now to remember my old computer specs..


  16. #16
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    Quote Originally Posted by AMDave View Post
    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..

    Code:
    $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

  17. #17
    Free-DC Semi-retire gopher_yarrowzoo's Avatar
    Join Date
    Mar 2002
    Location
    Knoxville, TN
    Posts
    3,985
    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...
    Semi-retired from Free-DC...
    I have some time to help.....
    I need a new laptop,but who needs a laptop when you have a phone...
    Now to remember my old computer specs..


  18. #18
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    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

  19. #19
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    hmmmm, hope this isn't gibberish as it did post...

    Code:
    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

    Bok

  20. #20
    Administrator AMDave's Avatar
    Join Date
    Sep 2004
    Location
    deep in a while-loop
    Posts
    1,948
    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
    . . . . . ___
    . . . . . . .\___/\______
    . . . . . . . \__AMD___\\__
    -----------------------------------------

  21. #21
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    only done 3 languages so far, will get spanish and dutch next I think and then be more adventurous and go for Czech..

  22. #22
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    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..

    Code:
    $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

    Code:
    $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

  23. #23
    Free-DC Semi-retire gopher_yarrowzoo's Avatar
    Join Date
    Mar 2002
    Location
    Knoxville, TN
    Posts
    3,985
    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..
    Semi-retired from Free-DC...
    I have some time to help.....
    I need a new laptop,but who needs a laptop when you have a phone...
    Now to remember my old computer specs..


  24. #24
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    Would be another way to do it, not necessarily quicker though, just different complications.

  25. #25
    Administrator AMDave's Avatar
    Join Date
    Sep 2004
    Location
    deep in a while-loop
    Posts
    1,948
    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
    . . . . . ___
    . . . . . . .\___/\______
    . . . . . . . \__AMD___\\__
    -----------------------------------------

  26. #26
    Administrator Bok's Avatar
    Join Date
    Oct 2003
    Location
    Wake Forest, North Carolina, United States
    Posts
    24,601
    Blog Entries
    13
    I haven't done a pirate translation for this yet ! Not sure where that is coming from, must be a facebook bug itself..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •