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

support numeric tokens (params prefixed with v) #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

support numeric tokens (params prefixed with v) #10

wants to merge 1 commit into from

Conversation

drewfish
Copy link
Contributor

No description provided.

@caridy
Copy link
Collaborator

caridy commented Mar 10, 2014

hmm, can you elabore more on this @drewfish?

@redonkulus
Copy link
Member

@caridy the details are in the trello card "support numeric replaces like {0}"

@@ -200,6 +203,15 @@
return chunk;
}

for (key in params) {
if (params.hasOwnProperty(key)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm concern about the perf implications here. Ideally, we should have a flag or something to trigger this behavior. /cc @ericf

@ericf
Copy link
Collaborator

ericf commented Mar 11, 2014

Is this common for Dust helper libs to do with unnamed params?

If not, then this seems out of the scope of what this package should support. Unnamed params seem less ideal than named params because they would suffer from the same ambiguity as boolean params (e.g., foo('bar', true, true, false, true)).

I think if this translation of argument index to argument name needs to happen, it should be inside the app code base.

@redonkulus
Copy link
Member

@caridy @ericf what do we want do with this one? We have many developers that use this functionality in our own helper. Example:

"MAKE_YAHOO_YOUR_HP": "Make {0}Yahoo!{1} your homepage"

{@i18n_string _key="MAKE_YAHOO_YOUR_HP" v0="<i class='yhoo-logo Va-m img-sprite TextHidden D-ib'>" v1="</i>" /}

Final output would be:

Make <i class='yhoo-logo Va-m img-sprite TextHidden D-ib'>Yahoo!</i> your homepage

We need to pass this into the string so that translators can format it properly.

/cc @willthai

@drewfish
Copy link
Contributor Author

Last I heard (March 11th) from Rajiv:

I¹m going to see what I can do on our side to maybe pre process the
{0}-style placeholders and get back to you.

@drewfish
Copy link
Contributor Author

He was responding to an email where I suggested changing {0} into {v0} so that it is still called with {@i18n_string v0=...}.

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

Successfully merging this pull request may close these issues.

4 participants