|
|
|
|
|
|
|
|
|
|
|
function test() { |
|
|
|
|
|
var content = i18n.translate( 'My hat has three corners.' ); |
|
|
|
|
|
|
|
|
content = i18n.translate( { original: 'My hat has three corners too.' } ); |
|
|
|
|
|
|
|
|
var numHats = howManyHats(); |
|
|
content = i18n.translate( { |
|
|
original: { |
|
|
single: 'My hat has four corners.', |
|
|
plural: 'My hats have five corners.', |
|
|
count: numHats, |
|
|
}, |
|
|
} ); |
|
|
|
|
|
|
|
|
content = i18n.translate( { original: 'My hat has four corners.' } ); |
|
|
|
|
|
|
|
|
content = i18n.translate( `My hat has six corners.` ); |
|
|
content = i18n.translate( `My hat |
|
|
has seventeen |
|
|
corners.` ); |
|
|
|
|
|
|
|
|
content = i18n.translate( { |
|
|
original: 'post', |
|
|
context: 'verb', |
|
|
} ); |
|
|
|
|
|
|
|
|
content = i18n.translate( 'post2', { context: 'verb2' } ); |
|
|
|
|
|
|
|
|
content = i18n.translate( { |
|
|
original: 'g:i:s a', |
|
|
comment: 'draft saved date format, see http://php.net/date', |
|
|
} ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var city = getCity(), |
|
|
zip = getZip(); |
|
|
|
|
|
content = i18n.translate( { |
|
|
original: 'Your city is %(city)s and your zip is %(zip)s.', |
|
|
args: { |
|
|
city, |
|
|
zip, |
|
|
}, |
|
|
} ); |
|
|
|
|
|
|
|
|
content = i18n.translate( 'single test', 'plural test', { count: 1 } ); |
|
|
|
|
|
|
|
|
var varCount = 1; |
|
|
content = i18n.translate( 'single test2', 'plural test2', { count: varCount } ); |
|
|
|
|
|
|
|
|
|
|
|
content = <div>{ i18n.translate( |
|
|
"This is a multi-line translation with \"mixed quotes\" " + |
|
|
'and mixed \'single quotes\'' |
|
|
) }</div>; |
|
|
|
|
|
content = this.translate( 'The string key text', { |
|
|
context: 'context with a literal string key', |
|
|
} ); |
|
|
|
|
|
i18n.translate( 'My hat has three corners.', { |
|
|
comment: 'Second ocurrence', |
|
|
} ); |
|
|
|
|
|
i18n.translate( 'My hat has one corner.', 'My hat has many corners.', { |
|
|
context: 'context after new plural syntax', |
|
|
count: 5, |
|
|
} ); |
|
|
i18n.translate( 'This is how the test performed\u2026' ); |
|
|
|
|
|
i18n.translate( |
|
|
"It's been %(timeLapsed)s since {{href}}{{postTitle/}}{{/href}} was published. Here's how the post has performed so far\u2026", |
|
|
{ |
|
|
args: { |
|
|
timeLapsed: postTime.fromNow( true ), |
|
|
}, |
|
|
components: { |
|
|
href: <a href={ post.URL } target="_blank" rel="noopener noreferrer" />, |
|
|
postTitle: <b>{ postTitle }</b>, |
|
|
}, |
|
|
context: |
|
|
'Stats: Sentence showing how much time has passed since the last post, and how the stats are', |
|
|
} |
|
|
); |
|
|
} |
|
|
|
|
|
module.exports = test; |
|
|
|
|
|
|