Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for positional placeholders #12

Open
RinkAttendant6 opened this issue Dec 12, 2015 · 0 comments
Open

Add support for positional placeholders #12

RinkAttendant6 opened this issue Dec 12, 2015 · 0 comments
Labels

Comments

@RinkAttendant6
Copy link
Owner

It is common to have positional placeholders when localizing due to differences in word order in different languages.

There exists several different formats for positional placeholders. For example:

// ICU format:
'{0, number} files exist on disk {1} at this time'

 // jquery.i18n format:
'$1 files exist on disk $2 at this time'

// PHP printf format
'%1$d files exist on disk %2$s at this time'

Since sprintf and vsprintf are currently being used, the last format already works.

It would be nice to support the jquery.i18n format by parsing the strings and converting the placeholders to printf-style placeholders. However since it does not specify type for its placeholders (string, number, etc.), they would be assumed string by default. A possible improvement would be to look for {{PLURAL to determine if the placeholder could be an integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant