@@ 1570-1589 (lines=20) @@ | ||
1567 | return $this->assertEquals( $output, $result ); |
|
1568 | } |
|
1569 | ||
1570 | function filter_translate( $translations, $text, $context, $domain ) { |
|
1571 | switch ($text) { |
|
1572 | case '–' : return '!endash!'; |
|
1573 | case '—' : return '!emdash!'; |
|
1574 | case '‘' : return '!openq1!'; |
|
1575 | case '’' : |
|
1576 | if ( 'apostrophe' == $context ) { |
|
1577 | return '!apos!'; |
|
1578 | } else { |
|
1579 | return '!closeq1!'; |
|
1580 | } |
|
1581 | case '“' : return '!openq2!'; |
|
1582 | case '”' : return '!closeq2!'; |
|
1583 | case '′' : return '!prime1!'; |
|
1584 | case '″' : return '!prime2!'; |
|
1585 | case '’tain’t,’twere,’twas,’tis,’twill,’til,’bout,’nuff,’round,’cause,’em' : |
|
1586 | return '!apos!tain!apos!t,!apos!twere,!apos!twas,!apos!tis,!apos!twill,!apos!til,!apos!bout,!apos!nuff,!apos!round,!apos!cause,!apos!em'; |
|
1587 | default : return $translations; |
|
1588 | } |
|
1589 | } |
|
1590 | ||
1591 | function data_translate() { |
|
1592 | return array( |
|
@@ 1987-2004 (lines=18) @@ | ||
1984 | return $this->assertEquals( $output, $result ); |
|
1985 | } |
|
1986 | ||
1987 | function filter_translate2( $translations, $text, $context, $domain ) { |
|
1988 | switch ($text) { |
|
1989 | case '–' : return '!endash!'; |
|
1990 | case '—' : return '!emdash!'; |
|
1991 | case '‘' : return '!q1!'; |
|
1992 | case '’' : |
|
1993 | if ( 'apostrophe' == $context ) { |
|
1994 | return '!apos!'; |
|
1995 | } else { |
|
1996 | return '!q1!'; |
|
1997 | } |
|
1998 | case '“' : return '!q2!'; |
|
1999 | case '”' : return '!q2!'; |
|
2000 | case '′' : return '!prime1!'; |
|
2001 | case '″' : return '!prime2!'; |
|
2002 | default : return $translations; |
|
2003 | } |
|
2004 | } |
|
2005 | ||
2006 | function data_primes_quotes_translation() { |
|
2007 | return array( |