diff --git a/features/makepot.feature b/features/makepot.feature index 92390399..031ba815 100644 --- a/features/makepot.feature +++ b/features/makepot.feature @@ -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' ); @@ -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" @@ -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" @@ -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" diff --git a/src/PhpCodeExtractor.php b/src/PhpCodeExtractor.php index 478c5271..364afcaf 100644 --- a/src/PhpCodeExtractor.php +++ b/src/PhpCodeExtractor.php @@ -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',