Skip to content

Conversation

@santhoshtr
Copy link
Member

The simpleParse method of parser, which get invoked if message contains
only placeholders, was not supporting escaped placeholders($10)

The light weight versio of jquery.i18n when parser.js not included
also has the same fix now.

Add support for that and add tests.
Updated the documentation in README.md too

Fixes issue #74

@Nikerabbit
Copy link
Member

Can you rebase this to get rid of the conflict?

@santhoshtr santhoshtr force-pushed the issue74 branch 2 times, most recently from dcc4562 to 827ca13 Compare June 8, 2016 04:28
locale = $.i18n().locale;
}
if ( typeof source === 'string' &&
if ( typeof source === 'string' &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What changed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange. dont know.

The simpleParse method of parser, which get invoked if message contains
only placeholders, was not supporting escaped placeholders(\\$10)

The light weight versio of jquery.i18n when parser.js not included
also has the same fix now.

Add support for that and add tests.
Updated the documentation in README.md too

Fixes issue wikimedia#74
assert.strictEqual( $.i18n( 'Hello $1', 'Bob' ), 'Hello Bob', 'Parameter replacement' );
assert.strictEqual(
$.i18n( 'Price of {{PLURAL:$1|an item|$1 items}} is $2, you get \\$2 discount', 5, 2000 ),
'Price of 5 items is 2000, you get $2 discount', 'Parameter replacement with dollar sign escaped, not parsed using simplePaser'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The third param should be on its own line.

@winstonsung
Copy link
Contributor

Rebase needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants