Closed oandregal closed 2 years ago
From the existing metadata, we need the
Title
to be translatable
For this to be actually useful, Gutenberg should also actually translate the title. I don't see any $pattern_data['title'] = translate_with_gettext_context( $pattern_data['title'], 'Title of the pattern' );
call in https://github.com/WordPress/gutenberg/pull/36751
For this to be actually useful, Gutenberg should also actually translate the title. I don't see any $pattern_data['title'] = translate_with_gettext_context( $pattern_data['title'], 'Title of the pattern' );
Yeah, I need to follow-up with that as well :)
I've prepared the Gutenberg PR that uses this data at https://github.com/WordPress/gutenberg/pull/40047 but I'm having some trouble to get the translated strings.
Pending some tests this looks good to go! 👍
Pending some tests this looks good to go! +1
Tests would need to wait until tomorrow morning :)
@swissspidy pushed the test.
In https://github.com/WordPress/gutenberg/pull/36751 Gutenberg added the ability to automatically register patterns that live in the
/patterns
directory. These patterns provide metadata via headers in the PHP file as in:From the existing metadata, we need the
Title
to be translatable. This PR adds support for looking up those patterns and extracting the Title string into the pot file.How to test
foo-theme
directory at the top-level, which contains the following files:style.css
with at least these contents:patterns/my-pattern.php
with at least these contents:foo-theme/foo-theme.pot
file has been generated and that contains the pattern title and the theme name. You should get something along these lines: