diff --git a/potx.inc b/potx.inc index 70406b0..27d0053 100644 --- a/potx.inc +++ b/potx.inc @@ -1920,8 +1920,8 @@ function _potx_init_yaml_translation_patterns($path = '') { * - test_label_2: * # An optional key, used as context for the translatable string. * context: label_2_context - * # You can use an empty string to mark all values for top-level keys as translatable. - * - '' + * # To mark all top-level keys as translatable, use the '%top-level-key' string. + * - %top-level-key * @endcode * * @param string $path @@ -1975,10 +1975,10 @@ function _potx_parse_yaml_file($code, $file_name, $save_callback) { */ function _potx_find_yaml_translatables($yaml, $trans_list, $file_name, $save_callback) { $extract_values = FALSE; - if (in_array('', $trans_list['keys'], TRUE)) { + if (in_array('%top-level-key', $trans_list['keys'], TRUE)) { $extract_values = TRUE; - $trans_list['keys'] = array_diff($trans_list['keys'], array('')); + $trans_list['keys'] = array_diff($trans_list['keys'], array('%top-level-key')); } foreach ($yaml as $key => $value) { diff --git a/yaml_translation_patterns.yml b/yaml_translation_patterns.yml index 9ad44c8..ed7e914 100644 --- a/yaml_translation_patterns.yml +++ b/yaml_translation_patterns.yml @@ -25,6 +25,6 @@ *.permissions.yml: - title - description - - '' + - %top-level-key config/schema/*.yml: - label