如何正确转义翻译字符串中的单引号字符?我把它用作撇号。例如:
__( \'404. This isn\'t the page you\'re looking for.\', \'textdomain\' );
我相信有几种方法,但哪一种是正确的方法?
Approach 1: 使用反斜杠:
__( \'404. This isn\\\'t the page you\\\'re looking for.\', \'textdomain\' );
Approach 2: 使用角色实体:
__( \'404. This isn't the page you're looking for.\', \'textdomain\' );