Fork me on GitHub

Problems converting module to gettext  Bottom

  • I used the .sh script inside the Gettext-Module to convert an existing module as it was written at http://community.zikula.org/index.php?module=Wiki&tag=ConvertToGettext

    At the end it says that I should generate the .pot - file.

    Quote


    Create .pot file and place in locale/


    I think the Gettext module should be able to extraxt all language strings from a module but it does not work.
    I deleted the pnlang directory and uploaded the moduel in the Gettext module to get the .pot file.
    "module" was chosen and also the name of the module was written case sensitive...
    This message returns:

    Quote


    Gettext Key Extractor

    DEBUG OUTPUT:
    ERROR: This doesn't look like a Gettext enabled module.
    1. Make sure this is a module that has been written for Zikula 1.2.0+
    The module should NOT have a pnlang/ folder and it must have a locale/
    2. First make sure the name you entered for the folder matches exactly
    with the module Folder name (CaSE SenSITive)


    I created a locale-folder before I zipped the module and pnlag directory was removed...

    How can the .pot file be created?

    Thanks for help, Florian

    --
    ifs-net.de -- zksoft.de
  • are you running the Gettext module locally or using the one installed on this site? (I recommend the latter).

    Quote

    I think the Gettext module should be able to extract all language strings from a module but it does not work.

    that script only produces a 'rough draft' of the conversion and it mangles a few things (with all due respect to drak icon_smile ). It took my a while to 'fix' all the 'fixes' that the script produces. icon_wink

    perhaps you are not archiving the module correctly? I'm not familiar enough with other systems (win/linux) but on my Mac, I right click on the module folder and select 'archive' and it produces the right kind of archive. you shouldn't archive the directory structure (e.g. modules/) for this archive.
  • Thank you for your reply. I installed the gettextmodule at one of my servers with a new instance of 1.2.0 zikula

    The module is archived with

    Code

    zip -r MODNAME.zip MODULEFOLDER/


    in the archive:
    MODNAME/pnuser.php
    etc.

    Is there a special script that generates the .POT file?
    After a module is enhanced with new functions there are always also new language definitions...
    If new language definitions are added in the template, do they also have to be added manually to the pot file?

    Flo



    edited by: quan, datetimebrief

    --
    ifs-net.de -- zksoft.de
  • I think we are losing some information in the translation in this thread icon_wink I wish I spoke your language!

    again, I recommend you use the the POT extractor here at this site. I didn't have any luck using a version I installed myself. This is the special script that generates the POT file icon_smile

    there is no need to manually add anything. If you correctly utilized the Gettext plugins, magic methods, etc in your module, then the extractor will pull them all out and into your POT file.

    hope that was clearer...
  • I just used the online pot extractor myself and it worked fine. I can imagine that a script might be easier or more direct, but this is also doable.

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • Thank you for your replies...

    I used the shellscript inside the Gettext-Module to create the .pot file. This worked fine... Thanks to the author (drak?) of the Gettext module..

    No I'll learn how to use POEDIT and maybe I'll be back with some other questions later... ;)

    Flo

    --
    ifs-net.de -- zksoft.de
  • OK, translating worked well (I think) but whenever I switch my site to german as language the english language is still displayed for the module.

    I integrated the language domain in all functions using language defines and I think that the structure of the module for the language part is ok... But it dows not work

    Maybe someone has the time to take a look into the trunk folder of myProfile's SVN repository. This is the first module I try to convert to gettext...

    Flo

    --
    ifs-net.de -- zksoft.de
  • Problem seems to be solved. Shellscript to extract lang defines did not work right the first time I executed it.. Now it seems to work. Thanks to drak for your help via Skype!

    --
    ifs-net.de -- zksoft.de
  • For the record, 'mea culpa', I broke the extraction script today and fixed it.

    Regards,

    Drak

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak

This list is based on users active over the last 60 minutes.