Skip to content

Commit

Permalink
Merge pull request #221 from pbiron/esc_xml
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera authored Jul 8, 2020
2 parents b2ebd76 + 233b499 commit b02ecdc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions features/makepot.feature
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,16 @@ Feature: Generate a POT file of a WordPress project
__( '__', 'foo-plugin' );
esc_attr__( 'esc_attr__', 'foo-plugin' );
esc_html__( 'esc_html__', 'foo-plugin' );
esc_xml__( 'esc_xml__', 'foo-plugin' );
_e( '_e', 'foo-plugin' );
esc_attr_e( 'esc_attr_e', 'foo-plugin' );
esc_html_e( 'esc_html_e', 'foo-plugin' );
esc_xml_e( 'esc_xml_e', 'foo-plugin' );
_x( '_x', '_x_context', 'foo-plugin' );
_ex( '_ex', '_ex_context', 'foo-plugin' );
esc_attr_x( 'esc_attr_x', 'esc_attr_x_context', 'foo-plugin' );
esc_html_x( 'esc_html_x', 'esc_html_x_context', 'foo-plugin' );
esc_xml_x( 'esc_xml_x', 'esc_xml_x_context', 'foo-plugin' );
_n( '_n_single', '_n_plural', $number, 'foo-plugin' );
_nx( '_nx_single', '_nx_plural', $number, '_nx_context', 'foo-plugin' );
_n_noop( '_n_noop_single', '_n_noop_plural', 'foo-plugin' );
Expand Down Expand Up @@ -396,6 +399,10 @@ Feature: Generate a POT file of a WordPress project
"""
msgid "esc_html__"
"""
And the foo-plugin/foo-plugin.pot file should contain:
"""
msgid "esc_xml__"
"""
And the foo-plugin/foo-plugin.pot file should contain:
"""
msgid "_e"
Expand All @@ -408,6 +415,10 @@ Feature: Generate a POT file of a WordPress project
"""
msgid "esc_html_e"
"""
And the foo-plugin/foo-plugin.pot file should contain:
"""
msgid "esc_xml_e"
"""
And the foo-plugin/foo-plugin.pot file should contain:
"""
msgid "_x"
Expand Down Expand Up @@ -440,6 +451,14 @@ Feature: Generate a POT file of a WordPress project
"""
msgctxt "esc_html_x_context"
"""
And the foo-plugin/foo-plugin.pot file should contain:
"""
msgid "esc_xml_x"
"""
And the foo-plugin/foo-plugin.pot file should contain:
"""
msgctxt "esc_xml_x_context"
"""
And the foo-plugin/foo-plugin.pot file should contain:
"""
msgid "_n_single"
Expand Down
3 changes: 3 additions & 0 deletions src/PhpCodeExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ final class PhpCodeExtractor extends PhpCode {
'__' => 'text_domain',
'esc_attr__' => 'text_domain',
'esc_html__' => 'text_domain',
'esc_xml__' => 'text_domain',
'_e' => 'text_domain',
'esc_attr_e' => 'text_domain',
'esc_html_e' => 'text_domain',
'esc_xml_e' => 'text_domain',
'_x' => 'text_context_domain',
'_ex' => 'text_context_domain',
'esc_attr_x' => 'text_context_domain',
'esc_html_x' => 'text_context_domain',
'esc_xml_x' => 'text_context_domain',
'_n' => 'single_plural_number_domain',
'_nx' => 'single_plural_number_context_domain',
'_n_noop' => 'single_plural_domain',
Expand Down

0 comments on commit b02ecdc

Please sign in to comment.