http://drupal.org/node/114774#translations_directory

Is there any way the directory name for translations can be checked?

CommentFileSizeAuthor
#15 coder_226965.patch991 bytesstella
#10 226965.patch969 bytesFreso
#4 226965.patch968 bytesstella
#1 226965.patch946 bytesdouggreen

Comments

douggreen’s picture

StatusFileSize
new946 bytes

Good idea, please test the attached patch. It looks for the presence of ./po without ./translations. If you run this on many modules with several directories that need to be moved, it will give you the error only once, and only mention that one directory. It would be better to show it foreach directory that needs to be moved, but I think that this is an edge case that probably doesn't deserve the extra half-dozen lines of code we'd need to do that.

nancydru’s picture

I'll try to do this right away. I generally run it on only one module at a time, so the limitation is not a big deal.

nancydru’s picture

Status: Active » Needs work

PHP Parse error: parse error, unexpected ')' in C:\\www\\drupal-6\\sites\\all\\modules\\coder\\includes\\coder_6x.inc on line 509.

After I removed the extra ')' it worked fine and caught the change.

BTW, you're killing me - modules that are already converted keep getting more flags... ;-(

stella’s picture

Status: Needs work » Active
StatusFileSize
new968 bytes

I get the error:

Parse error: syntax error, unexpected ')' in /var/www/drupal_6.1_20080212/html/sites/all/modules/coder/includes/coder_6x.inc on line 509

Removing the extra ')' fixes it. I've re-attached a fixed version of the patch.

The patch does correctly identify that I have a 'po' directory instead of 'translations'. However, the warning is printed once for each file in the module directory, so it's printed for e.g. faq.install, faq.module and for each of my 8 theme tpl.php files. Maybe it should just alarm on the first one?

Cheers,
Stella

nancydru’s picture

Yes, I get the same thing - message on each file. However, once I corrected the directory problem, the message still appears on the .install file even though it disappeared on the .module file.

stella’s picture

The same is not true for me. Once I fixed the directory name, no more warnings appeared.

nancydru’s picture

I haven't committed yet; could that be it?

stella’s picture

I don't see how it could be, but I guess there's no harm trying. It's not there as a hidden directory, no?

Freso’s picture

Status: Active » Needs work

freso@nayru /s/h/l/h/d/s/a/m/c/includes> patch -p0 < ../226965_0.patch
patching file coder_6x.inc
Hunk #1 FAILED at 498.
1 out of 1 hunk FAILED -- saving rejects to file coder_6x.inc.rej

(Why was it set to "active" instead of "patch (foo)"?)

Freso’s picture

StatusFileSize
new969 bytes

Here's a re-roll. I think, though, that it should probably only appear for either .module or .info. The current one makes it way cluttered, and it's not that critical an issue.

Freso’s picture

@nancyw: I had the same problem (created a 'po' dir to trigger the warning, then made a 'translations' dir to remove it again... only it didn't), but clearing the cache solved the problem. So it looks like a cache issue.

nancydru’s picture

Indeed. I've had multiple "opportunities" to clear the cache and now the flag is gone.

douggreen’s picture

@Freso, You should only get this error once per module. What project did you use that displays the error for each .module and .install?

Freso’s picture

@douggreen: snpower wrote However, the warning is printed once for each file in the module directory, so it's printed for e.g. faq.install, faq.module and for each of my 8 theme tpl.php files. – and I see the same behaviour. But if you really must know, I used Akismet with the patch from this issue applied. I created the "po" folder myself, to check the warning.

stella’s picture

Status: Needs work » Needs review
StatusFileSize
new991 bytes

The attached patch should work without producing the warning for each file in the directory. It will only produce the warning for the .module file.

Doug - the check in the previous patches wasn't within the if (substr($filename, -7) == '.module') {....} section and so was being applied to every file.

Cheers,
Stella

stella’s picture

Status: Needs review » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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