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

feat(DeleteResource): Add wording & i18n #1243

Merged
merged 20 commits into from
Apr 11, 2018
Merged

Conversation

romainseb
Copy link
Contributor

Yep, it's back !

What is the problem this PR is trying to solve?
There is just the label of the entity showned
What is the chosen solution to this problem?
Add a sentense ( and translate it )

Please check if the PR fulfills these requirements

  • The PR commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features) And non reg done before need review
  • Docs have been added / updated (for bug fixes / features)
  • Related design / discussions / pages (not in jira), if any, are all linked or available in the PR

[ ] This PR introduces a breaking change

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@jare-talend
Copy link

Could you add this command on the package.json as the other i18n packages.
https://github.com/Talend/ui/blob/master/packages/components/package.json#L21

We have a issue with the female context where the key is a variable so the parser can't find it.

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

1 similar comment
@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@@ -2,15 +2,18 @@ import React from 'react';
import PropTypes from 'prop-types';
import { componentState } from '@talend/react-cmf';
import { ConfirmDialog } from '@talend/react-components';
import { translate, Trans } from 'react-i18next'; // eslint-disable-line import/no-extraneous-dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

You should not disable this rule.
It highlight an issue in your dependencies. You have (react-)i18next as dev deps, but that's wrong. You should either add it as peer dependencies or move to to dependencies.

@@ -0,0 +1,5 @@
import { createInstance } from 'i18next'; // eslint-disable-line import/no-extraneous-dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

When you fix the dependencies, you can remove that

@@ -1,8 +1,19 @@
import i18n from 'i18next';
import React from 'react';
import i18n from 'i18next'; // eslint-disable-line import/no-extraneous-dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

When you fix the dependencies, you can remove that

return (
<ConfirmDialog
show
header={this.props.header}
cancelAction={cancelAction}
validateAction={validateAction}
>
<div>{resourceInfo.label}</div>
<div>
<Trans i18nKey={i18nKey}>
Copy link
Contributor

Choose a reason for hiding this comment

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

2 things on i18n :

  • add npm scripts to extract translation keys in root package.js
  • this trans is not compatible with i18next-parser, I won't block this PR for that since it is really needed and the solution is the good one I think, but we need a solution

Copy link

@jare-talend jare-talend Apr 4, 2018

Choose a reason for hiding this comment

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

@jsomsanith The next major version of i18next-parser will be compatible with Trans. I work on i18n on the next sprint so I like to update this package to manage it.

Copy link
Contributor Author

@romainseb romainseb Apr 5, 2018

Choose a reason for hiding this comment

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

  1. The npm script is on the container package.json
  2. Currently yes, there is some work here on this side -> Improved parsing of Trans component i18next/i18next-parser#85

For now, i think this is still the best way to get the translations with html markup.

There is another issue currently, as the Trans component manage to make it work the count attribute but the "context" attribute to declare male or female translation is not working as it is. I try to make a PR on this point in react-i18next ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. it should be added to the root package.json like the others, so that yarn extract-i18n extract all packages translations in a single folder. Take a look at root npm scripts

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

1 similar comment
@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

1 similar comment
@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@build-travis-ci
Copy link
Collaborator

:octocat: Demo is available here

@romainseb romainseb merged commit 52522ac into master Apr 11, 2018
@romainseb romainseb deleted the sromain/delete-resource-text branch April 11, 2018 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants