Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Problem with Event Calender

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4
Go to End
Author Topic: 3977 Views
  • banal
    Avatar
    Community Member
    901 Posts

    Re: Problem with Event Calender Link to this post

    Hi UncleCheese

    I just had some spare time and wrote a Script that extracts all translatable entries from a given Directory.
    The Script is called LangBuilder and is attached to this post. It should work under Mac OS X or Linux with PHP installed. I wasn't able to test this on Windows as of now.

    Usage instructions:
    Extract the archive. The LangBuilder.php script is a command line PHP script. You'll need to set the executable permission bit (eg. chmod 0755 LangBuilder.php).
    Open your shell and type:

    LangBuilder.php module/dir pathto/outputfile.php

    This will search the module/dir and all its sub-directories for translatable strings and write them to pathto/outputfile.php.
    For help, just enter

    LangBuilder.php

    I ran this script for the event_calendar module folder. Attached to this post, you'll find the auto-generated file (autocreated.php)
    Hope that helps.

    This script might be useful for all module developers. I should possibly provide it somewhere for download.

    Attached Files
  • UncleCheese
    Avatar
    4085 Posts

    Re: Problem with Event Calender Link to this post

    Wow, banal, I'm speechless. That is a really slick script for the two hours it took you. I had already started the copying-and-pasting process, but I suppose I can stop now and use your file. Anxious to use in my other modules. Please submit to the Silverstripe team. This is way to useful to be ignored.

    Thanks a million!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Problem with Event Calender Link to this post

    One quick note.. did it manage to handle all of the date templating features okay? All I see is:

    $lang['en_US']['Calendar']['$key'] =
       '';

  • UncleCheese
    Avatar
    4085 Posts

    Re: Problem with Event Calender Link to this post

    I've checked in the new lang file. Banal, any time you want to submit the German translation, I'd really appreciate that, as well.

    I'm going to check in with my colleagues about getting you write access to the SVN. You've got a lot to offer and I think we need to facilitate your contributions to the code.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Problem with Event Calender Link to this post

    Hi UncleCheese

    Glad the script is useful to you. Oh yes I see, now that you mention it... the date templates are broken. I guess my script can't resolve PHP variables as translate keys... that would be a task of other magnitude.
    Hmm I think that's a case where the developer has to do some work on his own

    Regarding SVN access: That would be nice, yes. You can contact me via mailbox [at] banal.ch

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Problem with Event Calender Link to this post

    Hello

    I fixed a problem with the LangBuilder (escaped quotes were matched as closing quotes). You can find the new version here:
    http://bummzack.ch/langbuilder

    Oh, btw. There seems to be a utility like this built into SilverStripe:
    http://doc.silverstripe.com/doku.php?id=i18n&s=textcollector#collecting_text

    It didn't work for me though.

    Update: I was just informed, that as of SilverStripe 2.3, the textcollector can be invoked using the following url:
    dev/tasks/i18nTextCollectorTask?module=modulename
    Use with caution, since this will overwrite your en_US.php file

    3977 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.