-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support for %s parameters #56
Comments
Looks like this is not a |
Well since its a recommended way to use gettext I think this should be handled by the component. A lot of sites and apps use this format, don't believe they will create new strings just to be compatible. https://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html |
BTW I wrote my own component (which relies on vue-gettext) that handles this and interpolation with Vue components. But is should be nice to be part of the extension. |
Can I take a look at the code of your component? |
Sure :) . The components relies on the following markup to work:
All the %s are replaced with the corresponding slots based on their index e.g. the first %s is replaces with slot "s1", the second "%s" is replaced with slot "s2" and so on. The base text string to be translated is taken from the Text node inside the component tag without the slot(s). This is the code for the component. It is used only in this project and have not tested it thoroughly but seem to work ok.
|
Ok I may work on it when I have free time. But that's not guaranteed. |
Currently I'm using translations from a PHP application to translate. All the strings there are defined in the format: 'You have %s unread article in %s feed". How can I provide an array of params to be replaces in this order in the translated strings.
The text was updated successfully, but these errors were encountered: