#41 ✓resolved
Johannes Schirge

Feature request: Multi-Language-Support

Reported by Johannes Schirge | May 5th, 2009 @ 12:52 AM | in 0.6

Hey, I searched a file where I can edit the language.

am I right, that the text-strings are in the files without any variables?

Would it help if I add a new folder wp-content/language/ and set variables (like $text_greeting) into the files where text-strings are and include a language.php (include 'wp-content/language/language.php';) to every file?

So it would be possible to make omb multilangual ;)

Or do you have other plans for this?

Comments and changes to this ticket

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 5th, 2009 @ 02:01 AM

    • State changed from “new” to “open”

    Yes, that would be great! I totally support any approach because right now there is none :-)

    In addition to the wordpress theme there are templates for omb pages down this path /app/omb/views and /app/omb/views/posts and /app/omb/views/identities

    Eventually I want to create database-driven/dynamic translation so that users can create new translations while using omb.

  • Johannes Schirge

    Johannes Schirge May 5th, 2009 @ 01:13 PM

    I tried database-driven/dynamic translation. My approach was not bad, but I wasn't able to realize it. Not enough skills for that ^^

    If it's okay I'll create a text-based translation. The beginning looks promising ;-)

  • Johannes Schirge

    Johannes Schirge May 5th, 2009 @ 05:24 PM

    Okay, here is the first preview. I changed the theme p2 and the folders you said.

    But there are many more variables left and I didn't understand the structure completely.

    in /wp-content/language/lang_chooser.php you can edit the selected language with $language_selected.

  • Brian Jesse Hendrickson
  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 8th, 2009 @ 12:21 AM

    • State changed from “open” to “resolved”

    thanks a lot, Shen, I've just committed this to the master branch.

    I created this patch, and applied it to my latest SVN version without a problem. I haven't committed to GitHub yet.

    there could be trouble when you pull updates from my git, because I didn't actually do a PULL from your repo. (I created a patch that applied your changes and used that)

    however, Git is pretty smart and I bet it will successfully figure out where to put all the hunks and which ones have already been applied.

    I am attaching the patch, here is how I applied it:

    git clone git://github.com/voitto/openmicroblogger.git

    mv openmicroblogger omb

    patch -p0 < Shenlang.diff

  • Johannes Schirge

    Johannes Schirge May 8th, 2009 @ 05:04 AM

    Hey, I downloaded and extracted the patch to my gid-omb-folder.

    I only entered patch -p0 Shenpatch.diff and got an error message (attached).

    Do I always have to enter git clone git@github.com:Shen/openmicroblogger.git to sync my local-folder with the source-folder?

    or is there a possibility to update from souce?

    Am I right that git pull origin master pulls my personal git and not the main source?

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 8th, 2009 @ 04:38 PM

    • State changed from “resolved” to “open”

    let me think about this for a minute

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 8th, 2009 @ 04:48 PM

    you can do this

    git pull git://github.com/voitto/openmicroblogger.git master

    I tried it, and it said I would just have to fix one file

    CONFLICT (content): Merge conflict in app/omb/views/posts/_profile.html

    I did it like this

    git clone git://github.com/Shen/openmicroblogger.git

    cd openmicroblogger

    git pull git://github.com/voitto/openmicroblogger.git master

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 8th, 2009 @ 05:11 PM

    here's how I was able to apply your patch

    git clone git://github.com/voitto/openmicroblogger.git

    mv openmicroblogger omb

    // roll back to the revision Shen started with

    cd omb

    git checkout 87b076b11585dad7bfa4bdd6e3e8790753032676

    cd ..

    patch -p0 <Shenpatch.diff

    but there is a problem, if I now pull it throws some errors

    git pull git://github.com/voitto/openmicroblogger.git

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 8th, 2009 @ 11:32 PM

    • State changed from “open” to “resolved”
  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 9th, 2009 @ 06:55 PM

    wait til you see the new app called "translate" !!! in 0.3b66

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 10th, 2009 @ 12:18 AM

    the lang_chooser was lame/broken but I just posted fixes to http://dbscript.net/omb.zip

  • Johannes Schirge

    Johannes Schirge May 10th, 2009 @ 12:35 AM

    Hey Brian, wow!! Thats really impressive! Great feature :-)

    But some notes: Every user can see the language of other people and can choose it. But only the owner of the language can change it. So every user has to add a new language file and has to make all translations twice if he wants to add new translations. This could be solved by an import-function.

    But if you have a lot of people using omb there will be a plurality of language-files (maybe of the same language) which users could choose and nobody knows which on is most completed.

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 10th, 2009 @ 02:02 AM

    • State changed from “resolved” to “open”

    You raise good points.

    There is an [import] function now. If you click export you can copy that serialized array and [paste] it to the "data" field when creating a new translation.

    Most people would find the language they want and use it. if they didn't like part of it they could @reply the author and suggest a fix, OR they could export it, create a new lang and paste into the data field and make the modifications they want.

    people could choose a translation-style from an author they like, might be a unique and cool social feature?

    I don't have to worry yet about too many people :-)

  • Johannes Schirge

    Johannes Schirge May 10th, 2009 @ 03:20 AM

    Yes, its really a cool feature :)

    how about displaying in percent the translation-status of the several translations.

    And never forget to this of the future! ;) bleeper.de a german laconica-clone gets well-established in a short time :)

    Maybe we should remove german language as standard so that only english is like a template.

  • Johannes Schirge

    Johannes Schirge May 11th, 2009 @ 03:23 AM

    Forget my latest scentence. It doesn't make sense ;) Keep the german language-file :)

    There is an update for Theme P2 Language and the eng.php file attached. The ger.php will follow as soon as it is translated.

    I upload it here because I don't get my gid fork synced or overwritten with the master-version :(

  • Johannes Schirge

    Johannes Schirge May 11th, 2009 @ 03:47 AM

    Just had a few minutes. Update ger.php / eng.php

  • Johannes Schirge

    Johannes Schirge May 11th, 2009 @ 04:13 AM

    sidebar.php generates an error on line 155.

    $before = "

    <?php echo $txt['recent_projects']; ?>

    \n";

    I tried to resolve it with

    $before = "

    " . $txt['recent_projects'] . "

    \n";

    but it did't work. Error message is away, but text, too ;)

  • Johannes Schirge

    Johannes Schirge May 11th, 2009 @ 04:31 AM

    similar error on line 19 + 23 in page.php :(

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 11th, 2009 @ 05:36 AM

    Hi Johannes, thanks again for all the stuff you've been building!

    your page.php

        <?php the_content('<p class="serif">'<?php echo $txt['page_read_rest']; ?>'&rarr;</p>'); ?>
    
        <?php if ( comments_open() ) comments_template(); ?>
    
        <?php wp_link_pages(array('before' => '<p><strong>'<?php echo $txt['page_pages']; ?>'</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    

    should be like this I think

        <?php the_content('<p class="serif">'.$txt['page_read_rest'].'&rarr;</p>'); ?>
    
        <?php if ( comments_open() ) comments_template(); ?>
    
        <?php wp_link_pages(array('before' => '<p><strong>'.$txt['page_pages'].'</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    

    AND

    line 155 in sidebar

    $before = "<li><h2>".$txt['recent_projects']."</h2>\n";
    
    

    I will go ahead and make these changes when I install your code, unless you post an updated version here.

    really would like to help you fix your github repo! also I do use assembla SVN for all of my commits before I send patches to github

    maybe you can do something like this:

    git clone git@github.com:Shen/openmicroblogger.git

    cd openmicroblogger

    git checkout 87b076b11585dad7bfa4bdd6e3e8790753032676

    git pull git://github.com/voitto/openmicroblogger.git

    git commit -a -m "syncing up"

    git push origin master

    cheers! p.s. tinyblog.de looks really cool, good domain name too

  • Johannes Schirge

    Johannes Schirge May 11th, 2009 @ 07:41 AM

    Thanks for your help. I have added the code as you said and updated ger.php again. so the attached files are up to date.

    I will try to activate git again. And do it as you said. Hope it will work :)

    tinyblog.de is not mine. But great to see that some people starting to use omb :) My Domains are tiquer.me /tiquer.de

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 13th, 2009 @ 01:54 PM

    this is cool I will get the updates merged soon, thanks a lot. or let me know if you put them in your github

    here's what I notice right now on GitHub

    if I do

    git clone voitto/openmicroblogger

    git pull Shen/openmicroblogger

    then I [diff]

    these files have some differences, maybe the line-enders were switched to Mac or something?

    openmicroblogger/install.php

    openmicroblogger/db/library/json.php

    openmicroblogger/db/library/xpertmailer/ABOUT

    openmicroblogger/resource/flash_upload.php

    openmicroblogger/resource/jqUploader.css

    openmicroblogger/resource/jquery.ajaxfileupload.js

    openmicroblogger/resource/micro_player/skin.xml

    openmicroblogger/resource/jquery.ui/*

    openmicroblogger/wp-content/plugins/wordpress-friendfeed-comments/*

    however, I can maybe just pull your new [patches] instead of pulling [all of your commits] so it's not that big of a deal but i didn't try that yet

    but if you want others to be able to pull from you directly you might want to fix it

    it is tricky because those files are "managed" by Git so you don't want to just overwrite the directories and lose the .git folders, I can't remember exactly how to do that safely with git

  • Johannes Schirge

    Johannes Schirge May 13th, 2009 @ 02:46 PM

    Thats strange. I reset my repo and pulled your master. In my last commit there was just my updated install.php. Nothing else should be different....

    Gid will not be my best friend I think ;)

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 13th, 2009 @ 03:02 PM

    git is the future, you are right to avoid SVN and just learn git

    what happened is you made a noisy commit on your first one, with a bunch of modified files, so I can't pull that commit

    maybe you can just delete that commit individually? I am not a git expert

    but that first commit you made is what introduces the modfied files

    I will help you fix it but right now i'm working hard on another project, tomorrow I will help you with your git

    • brian
  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 13th, 2009 @ 03:07 PM

    in other words, if you look at all of your commits to Shen/openmicroblogger

    that's what gets pulled down by someone who does a pull on your repo

    so you need to make your total sequence of commits result in a "clean" omb plus your modifications

    you can test it quickly like this


    mkdir testdir

    cd testdir

    git clone git://github.com/voitto/openmicroblogger.git

    mv openmicroblogger shenpull

    cd shenpull

    git pull git://github.com/Shen/openmicroblogger.git

    cd ..

    git clone git://github.com/voitto/openmicroblogger.git

    mv openmicroblogger omb

    diff -raupN --exclude=.git --exclude=.DS_Store --exclude=.svn shenpull/ omb/ > shenpulldiff

    cat shenpulldiff

    rm -rf testdir

  • Brian Jesse Hendrickson
  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 14th, 2009 @ 12:41 PM

    ok i'm gonna figure this out

  • Johannes Schirge

    Johannes Schirge May 14th, 2009 @ 01:43 PM

    Thanks for the link. If you can see on github I synced my version with yours :)

    I tried to commit a new branch but had the problem again that there were files included which I haven't changed.

    I think could be because of the line-ending-problem
    http://code.google.com/p/msysgit/issues/detail?id=83&amp;can=1&amp;...

  • Johannes Schirge

    Johannes Schirge May 14th, 2009 @ 01:43 PM

    Thanks for the link. If you can see on github I synced my version with yours :)

    I tried to commit a new branch but had the problem again that there were files included which I haven't changed.

    I think could be because of the line-ending-problem
    http://code.google.com/p/msysgit/issues/detail?id=83&amp;can=1&amp;...

  • Johannes Schirge

    Johannes Schirge May 14th, 2009 @ 01:43 PM

    Thanks for the link. If you can see on github I synced my version with yours :)

    I tried to commit a new branch but had the problem again that there were files included which I haven't changed.

    I think could be because of the line-ending-problem
    http://code.google.com/p/msysgit/issues/detail?id=83&amp;can=1&amp;...

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 14th, 2009 @ 03:10 PM

    hey I tried it and yes, I can pull from you!

    nice!

  • Johannes Schirge

    Johannes Schirge May 15th, 2009 @ 03:44 PM

    Okay, added some new langage-updates.

    Can you tell me where I can find the strings from Settings - Profile (Settings, Friends, Password, Streams,...,Translate)?

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson May 18th, 2009 @ 03:53 PM

    Johannes I was able to pull from your repo and everything is working great, I don't see any problems at all. I will pull your commits to my master and push them out to my git repo

  • Brian Jesse Hendrickson

    Brian Jesse Hendrickson June 17th, 2009 @ 11:02 PM

    should this ticket be closed?

  • Johannes Schirge

    Johannes Schirge June 19th, 2009 @ 04:00 AM

    • State changed from “open” to “resolved”
  • Johannes Schirge

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

a(nother) PHP implementation of the http://openmicroblogging.org standard for distributed microblogging. Compatible with identi.ca and laconi.ca

Attachments

Pages