Use the GLOB_BRACE option for globbing

Created on 14 January 2019, almost 6 years ago
Updated 11 April 2024, 9 months ago

Problem

We have the following use-case.

Potx is used (by Drupal) to extract all translatable strings from modules and installation profiles. However, sometimes you have some extra files in your project that may also contain translatable strings. We would like to extract all those strings into a single PO file so that they can be translated as a single project while being kept separate from reusable (e.g. contrib) modules.

Solution

The PHP glob function takes the GLOB_BRACE option: Expands {a,b,c} to match 'a', 'b', or 'c'. This would add the desired versatility to the folder option. The following expression would work for the above scenario: potx single --folder 'html/{themes/custom,modules/custom,modules/features}/'.

The PHP man page does show a caveat for this option that we may want to consider: Note: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris.

Feature request
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇳🇱Netherlands kingdutch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024