Fork me on GitHub

Convert Module to Gettext incl. languages  Bottom

Go to page 1 - 2 [+1]:

  • Hi,

    I have an old instance of the Gettext module (1.0) but where is the latest Module? Or is 1.0 the latest versionß
    It is not in the extdb and I can't find it when browsing the core repository files.

    Using the module and uploading the "old style" module via zip file I get this error:
    msgmerge: error while opening "/tmp/c6b0828403fe82aaa3b93a7b1c3fd3826a0b77db/module_xxxxxxxxxx.pot" for reading: No such file or directory
    ERROR: Failed to generate POT file - see output for explanation.

    What does this message tell me?

    Second question: I already have a not english translation for the old module. Which of the helper-scripts (and how has it to be used?) can "copy" the old translation?

    Thanks, Flo

    --
    ifs-net.de -- zksoft.de
  • Everything is here http://code.zikula.org/gettext - including all the shell scripts.

    Drak

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


  • ..throws the same error:

    Quote


    EXTRACTING TRANSLATION STRINGS...
    Done.
    GENERATING POT FILE...
    msgmerge: error while opening "/tmp/c8714efb6ccebac705877b362565500db3ed0192/module_contactlist.pot" for reading: No such file or directory
    ERROR: Failed to generate POT file - see output for explanation.


    Quote

    verything is here http://code.zikula.org/gettext - including all the shell scripts.


    I couldn't find documentation there what each shellscript does and which is the right to convert other languages than english into gettext

    Thanks for your help, Flo

    --
    ifs-net.de -- zksoft.de
  • To migrate a define based module to gettext you need this:

    http://code.zikula.org/gettext/browser/trunk/src/Gettext/helpers/xmigratepnmlcomponent.sh

    You must run the module from inside a Zikula install and you need all the language defines in place. Use full paths.

    Regards,

    Drak

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak
  • for the usage of this script: [corelangfile] - what has to be specified here?

    --
    ifs-net.de -- zksoft.de
  • The path to the core language file :)

    Drak

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

    The path to the core language file :)


    ok then it should be corelangfilepath and not corelangfile icon_wink

    I'll try the script this evening, let's see if it works ;)

    --
    ifs-net.de -- zksoft.de
  • The scripts absolutely work as they were used time and time again for converting around 30 modules I did personally. One thing to watch for is module language defines - many people have file includes and PHP code inside the language files. All that must be removed. The language files must contain just the opening PHP syntax and then lines of define(...); with no logic inside the calls and no calls to Zikula APIs.

    Make sure you use an IDE after the conversion. There are deliberate syntax breaks for certain things to force manual review. The script were designed for use with an IDE for this reason.

    Regards,

    Drak

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

    The scripts absolutely work


    hmm. The upload function of the Gettext module does not work - If you want to try I can send you the zip file to test it for your own icon_wink

    I now tried to use the script to convert from pnml to gettext but it failed.

    Can you give a example for the command that has to be entered to convert a module from pnml to gettext?

    I try to convert the ContactList module to gettext:

    Code

    sh ~/dummy_zikula_123/modules/gettext/helpers/xmigratepnmlcomponent.sh ~/dummy_zikula_123/modules/gettext/helpers/ ~/dummy_zikula_123/modules/ContactList/pnlang ~/dummy_zikula_123/locale/zikula.pot


    What's wrong? Inserting all the script's output would break the forum I think... The script seems to check all language strings from every module (or just the core?) anbd even templates.

    Just a little part of the errors thrown out...

    Quote


    PHP Warning: require_once(/home/xxxxxxx/dummy_zikula_123/modules/ContactList/pnlang/eng): failed to open stream: Inappropriate ioctl for device in /home/xxxxxxx/dummy_zikula_123/modules/Gettext/helpers/xmigratepnmltemplate.php on line 24

    Warning: require_once(/home/kunden/xxxxxxx/dummy_zikula_123/modules/ContactList/pnlang/eng): failed to open stream: Inappropriate ioctl for device in /home/kunden/xxxxxxx/dummy_zikula_123/modules/Gettext/helpers/xmigratepnmltemplate.php on line 24
    PHP Fatal error: require_once(): Failed opening required '/home/xxxxxxx/dummy_zikula_123/modules/ContactList/pnlang/eng' (include_path='.:/php/includes:/usr/share/php:/usr/local/lib/php:/usr/local/php/current/lib/php') in /home/xxxxxxx/dummy_zikula_123/modules/Gettext/helpers/xmigratepnmltemplate.php on line 24

    Fatal error: require_once(): Failed opening required '/home/xxxxxxx/dummy_zikula_123/modules/ContactList/pnlang/eng' (include_path='.:/php/includes:/usr/share/php:/usr/local/lib/php:/usr/local/php/current/lib/php') in /home/xxxxxxx/dummy_zikula_123/modules/Gettext/helpers/xmigratepnmltemplate.php on line 24


    --
    ifs-net.de -- zksoft.de
  • quan


    hmm. The upload function of the Gettext module does not work

    You mean the upload for generating pot files? I used this yesterday the last time, it works usually.

    quan

    I try to convert the ContactList module to gettext:

    I guess the problem is that you need to do this inside the Zikula root folder. So please try doing a "cd dummy_zikula_123" and repeat the commands accordingly.

    --
    Guite | ModuleStudio
  • Thanks for your reply Axel,

    Quote

    You mean the upload for generating pot files? I used this yesterday the last time, it works usually.


    I also used it for all other modules but the Gettext module does not seem to like the Contactlist module icon_wink It's a pitty that the Gettext module doesn't throw an understandable error about the problem that seems to exist with the ContactList module.

    Quote

    I guess the problem is that you need to do this inside the Zikula root folder. So please try doing a "cd dummy_zikula_123" and repeat the commands accordingly.


    I did the call from Zikula root, module root, gettext root - no one worked.

    Maybe it would be great if drak (or someone who understands all the scripts) could explain the usage of the shellscript with a simple example.

    If any user has a hint for me to solve the problem it would be nice...

    Flo



    Edited by quan on Aug 15, 2010 - 06:47 PM.

    --
    ifs-net.de -- zksoft.de
  • Florain :) I think you misundestood my original quote

    Quote

    The path to the core language file :)


    You need to specify something like language/eng/core.php - core language file, not the path to the core language file.

    Copy the languages/ folder from a Zikula 1.1.x installation. The script is not interested in Zikula 1.2 specific stuff at all, only in language define files and the old module.

    cd into the module you are converting. You do not need to use sh, you do

    cd ~/dummy_zikula_123/modules/ContactList
    ~/dummy_zikula_123/modules/gettext/helpers/xmigratepnmlcomponent.sh ~/dummy_zikula_123/modules/gettext/helpers ~/dummy_zikula_123/modules/ContactList/pnlang ~/dummy_zikula_123/languages/eng/core.php

    You really must do this with an SVN checkout of the module. After conversion fire up your IDE and check the PHP files for syntax errors and you use a gui coloured diff to verify the changes especially in templates. According to how deviant the module is from API standards, you will have a varying amount of cleanup work to do.

    This process is strictly for getting modules to 1.2 standards, not 1.3.

    Hope this helps, let me know if you need any more support.

    Drak

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak
  • Last foot note, if anything goes wrong (like not to remove the said forbidden hack from language files) you need to SVN revert the entire module folder, fix, then rerun the conversion.

    Drak

    --
    Zikula Lead Developer
    Board Member of the Zikula Foundation
    Follow me on twitter.com/zikuladrak
  • GetText could on zikula 1.3 version run?



    Edited by tyroneyeh on Aug 16, 2010 - 06:02 PM.

Go to page 1 - 2 [+1]:

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