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

Thellimist/pi 1060 add drawer to all cards #118

Merged
merged 8 commits into from
Apr 12, 2017
Merged

Conversation

thellimist
Copy link
Contributor

@thellimist thellimist commented Apr 11, 2017

Some texts don't use markdown. I'll double check that with Garreth

@thellimist thellimist changed the title Thellimist/pi 1060 Thellimist/pi 1060 add drawer to all cards Apr 11, 2017
var formattedMessage = formatMessage({
id: this.props.text + '.' + integrationName,
defaultMessage: formatMessage({ id: this.props.text })
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This approach is annoying in dev cause of console.errors's printed. But it is a viable solution to support translations for different integrations. We can use this approach for card.title.wordpress, card.title.magento and similar translations

Copy link
Contributor

Choose a reason for hiding this comment

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

So you're basically assuming one of these will fail? What about this?

let integrationKey = this.props.text + '.' + integrationName;
const stringExists = !!this.props.intl.messages[integrationKey];
var formattedMessage = formatMessage({id: stringExists ? integrationKey : this.props.text});

@thellimist
Copy link
Contributor Author

thellimist commented Apr 12, 2017

We needed different text for different plugins. In 6a8c08f and 9fdfe6a I changed the text of Apply Default Settings. I thought of using %{integrationName} as parameter in translation file but this seemed like a better approach. It gives more versatility.

@thellimist thellimist merged commit e388251 into master Apr 12, 2017
@@ -70,6 +70,7 @@
"intl": "^1.1.0",
"jest": "^19.0.2",
"lodash": "^3.10.1",
"marked": "^0.3.6",
Copy link
Contributor

@sejoker sejoker Apr 13, 2017

Choose a reason for hiding this comment

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

the package is abandoned. I would recommend using alternative.

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.

3 participants