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

BEM.i18n callback for wrapping Components #40

Open
Yeti-or opened this issue Jul 7, 2017 · 0 comments
Open

BEM.i18n callback for wrapping Components #40

Yeti-or opened this issue Jul 7, 2017 · 0 comments
Labels

Comments

@Yeti-or
Copy link
Member

Yeti-or commented Jul 7, 2017

Right now we have <i18n:param> for better localization.

and we use it like this:

{
 "myKey": "Some text <i18n:param>someParam</i18n:param>"
}

an in code:

import i18n from 'b:awesomeB t:i18n';

<input value={ i18n('mykey',  { someParam: 'wow' }) } >;

And it's cool
but what to do if we want to localize string with Component inside, or .

like:

import i18n from 'b:awesomeB t:i18n';

const button = (text) => (<button>{ text }</button>);

<span>{ i18n('myKeyInsideButton', { someParam: button }) }</span>

What syntax in keysets should we use?

my proposal:

{
"myKey": "... and then button: <i18n:wrap name='someParam'>Localized Btn-text</i18n:wrap>"
}

@veged any suggestions?

@Yeti-or Yeti-or added the i18n label Dec 21, 2017
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