Only skip potx files when really needed

FrankT - July 24, 2009 - 15:37
Project:Translation template extractor
Version:7.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Gábor Hojtsy
Status:closed
Description

I updated the translation to match 6.x-3.0. Especially there's been a bug within the translation of 'Template file for !langname translations' which contained a wrong variable, additionally the translation made no sense, too. Also fixed only a very few minor things.

AttachmentSize
potx.de_.po5.21 KB

#1

Gábor Hojtsy - July 27, 2009 - 09:08
Status:active» postponed (maintainer needs more info)

Can you please commit this yourself?

#2

FrankT - July 30, 2009 - 08:00
Status:postponed (maintainer needs more info)» active

I do not have an account to write into CVS (and I had no time to learn about that to avoid any mistakes making commits), so usually I provide the translation and a maintainer submits it (I've translated dozens of modules like that)...

#3

FrankT - August 22, 2009 - 11:11
Category:feature request» bug report

Because of the wrong variable that is in the translation so far, I make this a bug report... Please commit the new translation to CVS. Thanks!

#4

hass - August 24, 2009 - 14:26
Status:active» needs work

Seems an incomplete extraction / POT file used. POTX themself requires some special extraction... I'm able to create a new POT later.

#5

FrankT - August 24, 2009 - 18:49

Could you tell me what special treatment is required, for the future!?

#6

hass - August 24, 2009 - 21:23

The problem is that potx.inc and the potx-cli.php files also have translatable strings, but they are excluded from extraction. This is why it's only possible from command line to extract *all* translatable strings from POTX module. You need to manually specify every single file.

#7

Gábor Hojtsy - August 25, 2009 - 08:04

@hass: There is a @todo in the code to fix this. The reason it is excluded is exactly on the command line automated extraction, when these files are in the webroot but should not be parsed as part of Drupal core. It would be great to only exclude them in this case and when a web based on API based export is done, they would not be excluded.

#8

hass - August 25, 2009 - 08:17

I know you have added this after my request :-). It's also for module extraction... we may need a check like if ( extraction not from potx module, exclude potx files). Not only for core.

#9

hass - August 25, 2009 - 08:22

I have an idea... a simple check could do a file_exists('potx.module')... should be save enough... maybe check for all potx files to be 100 %save. For extraction users should only have potx.inc and the potx-cli.php in the current folder.

#10

Gábor Hojtsy - August 25, 2009 - 15:53
Title:German translation» Only skip potx files when really needed
Assigned to:Anonymous» Gábor Hojtsy
Status:needs work» needs review

I've developed a fix which skips the potx files only if the automated file discovery was called from the command line. If it is from the web interface, it is purposefully with a path that either includes potx or not and we should not treat potx different in that case. This should also fix localize.drupal.org not parsing potx right. We need to make the code work to be able to parse potx as an API.

Patch should be applicable to both 6.x and 7.x given the same potx.inc and command line code.

AttachmentSize
potx-skip-self.patch 2.95 KB

#11

hass - August 25, 2009 - 17:26
Status:needs review» needs work

I cannot follow this patch... should I now add an extra param always if I use POTX on command line? I cannot see any new option added to the patch that enables skip = FALSE as it need to skip always and only do not skip if POTX is parsed themself.

#12

Gábor Hojtsy - August 25, 2009 - 18:48
Status:needs work» needs review

The patch makes potx parse potx by default (when run under l10n_server or on the web interface of a Drupal install) and only skip potx files if running with potx-cli.php without --files set. So --auto (which is the default for potx-cli.php) will still skip potx files, but I'm not assuming any significant number of people use that to generate a potx template anyway. People will use the web interface (short term) or the centrally generated (l10n_server output) template from localize.drupal.org.

#13

hass - August 25, 2009 - 19:06

Ah, ok. Aside - maybe I missed something, but does the l10n server supports splitted files per module?

#14

Gábor Hojtsy - August 26, 2009 - 07:54

@hass: not sure what a "splitted file" is. l10n_server parses all files with the supported extensions under the module with the exception of files under a subdirectory tests/ and *.api.php files. Can you or @FrankT confirm that the patch works for extracting potx strings from the potx web interface?

#15

hass - August 26, 2009 - 08:44

With splitted POT files I mean one pot file per modules submodule, a general.pot and a few others in the main translations directory combined into a ZIP. Therefore not only one big pot file having all strings. I will try to run this on CCK and see what will happen.

#16

Gábor Hojtsy - August 26, 2009 - 08:49

@hass: this question has nothing to do with what files potx actually parses.

#17

Gábor Hojtsy - November 17, 2009 - 12:26
Version:6.x-3.0» 7.x-1.x-dev
Status:needs review» patch (to be ported)

Committed to Drupal 6-x-3.x.

#18

Gábor Hojtsy - November 17, 2009 - 12:28
Status:patch (to be ported)» fixed

Also committed this to D7, since it applied straight.

AttachmentSize
potx-skip-self.patch 2.81 KB

#19

System Message - December 1, 2009 - 12:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.