qTranslate-X格式在各种语言中不统一(撇号与右单引号)

时间:2016-09-05 08:37:39

标签: formatting apostrophe punctuation qtranslate-x

启用英语和荷兰语。我将formatting.php设置为区分撇号(笔直,')和右单引号(卷曲,'):

$apos = _x( ''', 'apostrophe' );
$opening_single_quote = _x( '‘', 'opening curly single quote' );
$closing_single_quote = _x( '’', 'closing curly single quote' );

这在英语中很好用,但在荷兰语中,它也适用于撇号的单引号。我的输出:

  

英文:   调试是一件“棘手”的事情

     

荷兰语:   调试是一件“棘手”的事情

我已经尝试用正确的双引号拼贴正确的单引号“,它确实适用于这两种语言,但我无法弄清楚为什么,在荷兰语中,它总是采用正确的单引号而不是撇号。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

格式化.php中的正则表达不被调用,因为荷兰语文本中的撇号被替换为第113-130行之间的某个位置。

// if a plugin has provided an autocorrect array, use it
        if ( isset($wp_cockneyreplace) ) {
            $cockney = array_keys( $wp_cockneyreplace );
            $cockneyreplace = array_values( $wp_cockneyreplace );
        } else {
            /* translators: This is a comma-separated list of words that defy the syntax of quotations in normal use,
             * for example...  'We do not have enough words yet' ... is a typical quoted phrase.  But when we write
             * lines of code 'til we have enough of 'em, then we need to insert apostrophes instead of quotes.
             */
            $cockney = explode( ',', _x( "'tain't,'twere,'twas,'tis,'twill,'til,'bout,'nuff,'round,'cause,'em",
                'Comma-separated list of words to texturize in your language' ) );

            $cockneyreplace = explode( ',', _x( '’tain’t,’twere,’twas,’tis,’twill,’til,’bout,’nuff,’round,’cause,’em',
                'Comma-separated list of replacement words in your language' ) );
        }

        $static_characters = array_merge( array( '...', '``', '\'\'', ' (tm)' ), $cockney );
        $static_replacements = array_merge( array( '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace );

评论此部分可以解决问题。