taskGNU Herds - Free Software Association - Tasks: task #6174, Automate the POT file generation

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #6174: Automate the POT file generation

Submitter:  Davi Leal <davi>
Submitted:  Sat 02 Dec 2006 08:59:18 AM UTC
   
 
Should Start On:  Sat 02 Dec 2006 12:00:00 AM UTC Should be Finished on:  Tue 10 Feb 2009 12:00:00 AM UTC
Category:  New Feature Priority:  5 - Normal
Status:  Ready For Test Privacy:  Public
Assigned to:  None Percent Complete:  90%
Open/Closed:  Open Effort:  0.00

Jump to the original submission

Sun 31 Dec 2006 08:59:50 AM UTC, comment #9: 

I actually have no time (almost at all), because I'm studying for some university exams in Feb.

In the meanwhile, I'll think of some solutions to implement `msgmerge` in PHP.

I thought of a for-loop, looping through all the .php's, but I think it's too resource-consuming, "inefficient". I must think to a better algorithm.

I'll try something on my computer, so I'll commit only when "it works" :)

I'm not assigning it to me, at the moment, because of my exams (have no time to work constantly on it... sorry)

Cheers,
David

David Paleino <hanska>
Sat 30 Dec 2006 09:22:24 PM UTC, comment #8: 

David, after finishing the PhotoOrLogo feature, which I hope commit tomorrow, I will work on the below task:

  • Translate the vacancy title of the job offers

   exposed at the "FS Job Offers"

     https://savannah.nongnu.org/task/?6266


If you want, have time, etc., feel free to carry out this one. Later, if it is not done I will take over it.

Davi

Davi Leal <davi>
Group administrator
Sun 24 Dec 2006 06:07:07 PM UTC, comment #7: 

Well, I'd think of `msgmerge` (`man msgmerge` for more info ;) ).

In PHP... uhm... I don't know if there's something like that (obviously, without using the system() function...).

I think we could do a for-loop, look for each string beginning with "msgid", and compare it with our new string. If there is match, then go on, otherwise put:

msgid "$string"
msgstr ""

into our new file.

It's an odd solution, but I can't think of a best one.

David Paleino <hanska>
Sun 24 Dec 2006 05:52:12 PM UTC, comment #6: 

Argh.

I've found that this editor considers (asterisk)(text)(asterisk) the same as (bold)(text)(bold).

The right RE is:

/$ldq\'([\w\s](asterisk))\'\s(asterisk)\\|\s*gettext/

Substitute the "(asterisk)" with "*".

You'll find the right RE in the file though.

David Paleino <hanska>
Sun 24 Dec 2006 05:51:24 PM UTC, comment #5: 

Great!!

Now, we should think how to merge the POT file which we get after processing the source code and our current POT file (a.k.a. the Spanish o the Italian PO file).

Davi Leal <davi>
Group administrator
Sun 24 Dec 2006 05:49:11 PM UTC, comment #4: 

Please, refer to this file.

The previous upload was unsuccessful.

David

David Paleino <hanska>
Sun 24 Dec 2006 05:44:53 PM UTC, comment #3: 

I've (maybe) solved with this regular expression:

/$ldq\'([\w\s]*)\'\s*\\|\s*gettext/

considering that $ldq == {.

Look for the "XXX" tags to see my comments.

I've tested it with these two strings:

{'Your job offers'|gettext}
{'My second chance' | gettext | strip:'&nbsp;}

See here how it acts:

neo@matrix:/var/www/gnuherds$ cat a.tpl
{'Your job offers'|gettext}
{'My second chance' | gettext | strip:'&nbsp;'}
{t}My t test{/t}
neo@matrix:/var/www/gnuherds$ ./tsmarty2c__full_t_tag_support.php a.tpl
/* a.tpl */
gettext("My t test");

/* a.tpl */
gettext("Your job offers");

/* a.tpl */
gettext("My second chance");

neo@matrix:/var/www/gnuherds$

It should be tested IRL though.

I'm attaching the "fixed" file.

Cheers (and Merry Xmas),
David

(file #11592)

David Paleino <hanska>
Sun 24 Dec 2006 07:32:27 AM UTC, comment #2: 

Yes, I need help.

I attach you the tsmarty2c.php file, though you could download it following this reference:
  http://smarty.incutio.com/?page=SmartyGettext


.php files:

We have at least these two cases:

   gettext( trim( current($contractTypes)
     * This translate strings which are kept at
       the data base, as the country names, etc.

   gettext('To access ...')
      xgettext -o output.pot -n file.php


.tpl files:

Problem:
  Only strings which use the {t} tag are collected.
    For example:  {t}The Software Association.{/t}

Proposed solution:
  I attach you the tsmarty2c__full_t_tag_support.php
  file which add a new source code block to match
  the below case:

    {'Your job offers'|gettext

  We just need to modify the regular expression, set an echo $matches[3].. to debug what is matching, and modify the '3' index to get what we want, the sentence.


How to merge all this information in to the new POT file, taking into account that we have to keep the sentences which are not at the source code due to they are at the data base, as country names, etc.?. That is to say, what gettext commands should we use?.

Additionally, I think we should try to keep the current structure, sentences grouped by page. Anyway, if it is not possible, no problem. An automatic update system is cool :)

The tools used to merge all this POT files should be allow us delete the sentences which are not being used, add the new ones, etc.

Fill free to take over some of these tasks. Just change the "Assigned to".

(file #11590, file #11591)

Davi Leal <davi>
Group administrator
Sun 24 Dec 2006 12:05:27 AM UTC, comment #1: 

Could you post a comment about your progresses?

Thanks,
David

P.S.: if you ever need any help, don't hesitate. ;)

David Paleino <hanska>
Sat 02 Dec 2006 08:59:18 AM UTC, original submission:  


Davi Leal <davi>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #11593:  tsmarty2c__full_t_tag_support.php.bz2 added by hanska (2KiB - application/x-bzip - reattaching it - file upload error before)
file #11590:  tsmarty2c.php.bz2 added by davi (2KiB - application/x-bzip)
file #11591:  tsmarty2c__full_t_tag_support.php.bz2 added by davi (2KiB - application/x-bzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hanska (Posted a comment)
  • -email is unavailable- added by davi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 19 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-03-21 davi Should be Finished on2007-02-10 2009-02-10
    2008-03-21 davi Priority1 - Later 5 - Normal
        StatusPostponed Ready For Test
        Percent Complete20% 90%
    2007-04-08 davi Priority5 - Normal 1 - Later
    2006-12-30 davi Should be Finished on2007-01-10 2007-02-10
        StatusIn Progress Postponed
        Assigned todavi None
    2006-12-26 hanska CategoryNone New Feature
    2006-12-24 davi Priority7 - High 5 - Normal
    2006-12-24 hanska Attached File#11592 Removed
    2006-12-24 hanska Attached File- Added tsmarty2c__full_t_tag_support.php.bz2, #11593
    2006-12-24 hanska Attached File- Added tsmarty2c__full_t_tag_support.php.bz2, #11592
    2006-12-24 davi Attached File- Added tsmarty2c.php.bz2, #11590
        Attached File- Added tsmarty2c__full_t_tag_support.php.bz2, #11591
    2006-12-08 davi Should be Finished on2006-12-10 2007-01-10
    2006-12-02 davi Carbon-Copy- Added davi
        Carbon-Copy- Added antenore
        Carbon-Copy- Added cjlars

    Back to the top

    Powered by Savane 3.13-54b4.
    Corresponding source code