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

Extract parameter type translations #59

Merged
merged 3 commits into from Apr 5, 2019
Merged

Conversation

katilius
Copy link
Collaborator

Will add resources extraction into same PR and improve overall quality, but see if you like the overall approach

@katilius katilius requested a review from sibelius March 25, 2019 08:25
JSXAttribute(path) {
const { node } = path;

if (hasStringLiteralJSXAttribute(path) && !isSvgElementAttribute(path)) {
addPhrase(node.value.value);
}
},
JSXElement(path) {
const { node } = path;
Copy link
Owner

Choose a reason for hiding this comment

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

better extract this logic to a function to make it clear

textWithoutArgs += element.value;
}
if (element.type === 'JSXExpressionContainer') {
textWithArgs += `{arg${argIndex}}`;
Copy link
Owner

Choose a reason for hiding this comment

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

we can try to improve naming of args

const jsxContentNodes = n.value.children;
let text = '';
let translateArgs = [];
let newChildren = [];
Copy link
Owner

Choose a reason for hiding this comment

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

better move to a separate function

@sibelius
Copy link
Owner

there are some tests failing

Test Suites: 3 failed, 3 passed, 6 total
Tests: 25 failed, 39 passed, 64 total

we should setup CI for this as well

@sibelius sibelius merged commit 9948579 into master Apr 5, 2019
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.

None yet

2 participants