WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#27696 closed defect (bug) (wontfix)

makepot.php looks for hardcoded dependency 'src/wp-includes/pomo/po.php'

Reported by: BjornW Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.7
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

I've checked out the rev 27986 of the i18n tools using svn (http://develop.svn.wordpress.org/trunk/tools/i18n/) so I could generate a POT from my plugin with makepot.php. All according to the instructions found here: http://codex.wordpress.org/I18n_for_WordPress_Developers#Command_Line_Script

However this causes an error since it cannot find the po.php file which it looks for in '/src/wp-includes/pomo/'.

It seems makepot.php and its required files need these files from WordPress core to run. As far as I remember the i18n tools were able to run standalone from WordPress core files so this seems to be a regression?

Apparently this problem exists already for some revisions according to this forum thread:
http://wordpress.org/support/topic/warning-makepotphp-revision-25726-trunktoolsi18n

Solutions

  1. Add a readme in the i18n tools directory explaining how to use the tools including the new dependency on WordPress core files & change the wiki instructions as well
  1. Remove the dependency and make the tools run standalone again
  1. Checkout trunk in total so the dependencies are met. This means you cannot just checkout i18n to use the tools.


I prefer option nr 2 since it feels kinda weird to depend on WordPress itself to create a POT file from a plugin file. IMHO tools should be able to run standalone.

Change History (12)

This ticket was mentioned in IRC in #wordpress-dev by gcorne. View the logs.


7 years ago

#2 @jeremyfelt
7 years ago

  • Version changed from trunk to 3.7

This dates back to pre 3.7 when unit tests were in a separate repository. The path is built with ABSPATH. It does seem like we could separate the requirement.

#3 @Otto42
7 years ago

Solution 3 is what I have been recommending to people, since everything changed over to develop.svn.

#4 @chriscct7
5 years ago

  • Keywords close added

Per comment:3

#5 @Otto42
5 years ago

Given that core and now themes and plugins all get their strings directly imported into GlotPress when they get put in the directory, making POT files is no longer something devs have to do themselves unless they're outside the WordPress.org systems.

+1 to wontfix

#6 @markoheijnen
5 years ago

I understand both cases and my preference would be solution 2 as well. I do believe that tools in general shouldn't depend on WordPress unless it's to much copy/paste which isn't in this case.

I do agree with Otto that the usage of running this yourself has become lower. However I do believe that you still could need it when you or on WordPress.org systems. When you add it the first time and directly want to have certain languages available. The same could be applied for updates but is less likely.

A solution for some would be the usage of a (Grunt) task doing this for you.

#7 @swissspidy
5 years ago

A solution for some would be the usage of a (Grunt) task doing this for you.

+1 for this solution when needed. From what I've heard, makepot.php is far from perfect and using it should be avoided when possible.

#8 follow-up: @markoheijnen
5 years ago

Using grunt task still means running makepot.php in the end. So avoiding to use it is impossible. For the grunt task they manage their own copy of makepot.php at https://github.com/cedaro/grunt-wp-i18n/tree/master/vendor/wp-i18n-tools.

So if it's far from perfect then we probably should make a ticket with improvements for that.

#9 in reply to: ↑ 8 @netweb
5 years ago

Related: #34749 "Sync i18n Tools"

That ticket has a couple of patches that merge outstanding develop.svn/tools and i18n.svn/tools changes.

Not sure if it will fix the issue in this ticket as I cannot test this right now but when I was creating the patches I vaguely remember something in regard to the differing include paths /src/wp-includes/pomo/

#10 @ocean90
5 years ago

  • Summary changed from makepot.php looks for hardcoded dependcy 'src/wp-includes/pomo/po.php' to makepot.php looks for hardcoded dependency 'src/wp-includes/pomo/po.php'

This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.


5 years ago

#12 @ocean90
5 years ago

  • Component changed from I18N to Build/Test Tools
  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

You can use https://i18n.trac.wordpress.org/browser/tools/trunk if you need a standalone version.

Note: See TracTickets for help on using tickets.