Repository navigation
Add i18n library to Linkerd dashboard #4803
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ dev() { | |
|
|
||
| build() { | ||
| cd "$ROOT"/web/app | ||
| yarn webpack | ||
| yarn lingui compile && yarn webpack | ||
| } | ||
|
|
||
| get-pod() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "localeDir": "js/locales/", | ||
| "srcPathDirs": ["js/"], | ||
| "format": "minimal" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import Card from '@material-ui/core/Card'; | ||
| import CardContent from '@material-ui/core/CardContent'; | ||
| import PropTypes from 'prop-types'; | ||
| import React from 'react'; | ||
| import { Trans } from '@lingui/macro'; | ||
| import Typography from '@material-ui/core/Typography'; | ||
| import { withStyles } from '@material-ui/core/styles'; | ||
|
|
||
|
|
@@ -12,24 +12,16 @@ const styles = () => ({ | |
| }, | ||
| }); | ||
|
|
||
| const EmptyCard = ({ content, classes }) => { | ||
| const EmptyCard = ({ classes }) => { | ||
| return ( | ||
| <Card className={classes.card} elevation={3}> | ||
| <CardContent> | ||
| <Typography> | ||
| {content} | ||
| <Trans>No data to display</Trans> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an example of translating a static text string. Also, we were never passing in a prop |
||
| </Typography> | ||
| </CardContent> | ||
| </Card> | ||
| ); | ||
| }; | ||
|
|
||
| EmptyCard.propTypes = { | ||
| content: PropTypes.string, | ||
| }; | ||
|
|
||
| EmptyCard.defaultProps = { | ||
| content: 'No data to display', | ||
| }; | ||
|
|
||
| export default withStyles(styles)(EmptyCard); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,20 @@ | ||
| import React from 'react'; | ||
| import { Trans } from '@lingui/macro'; | ||
| import Typography from '@material-ui/core/Typography'; | ||
|
|
||
| /* | ||
| * Instructions for adding resources to service mesh | ||
| */ | ||
| export const incompleteMeshMessage = name => { | ||
| if (name) { | ||
| return ( | ||
| <Typography variant="body2"> | ||
| Add {name} to the k8s.yml file<br /><br /> | ||
| Then run <code>linkerd inject k8s.yml | kubectl apply -f -</code> to add it to the service mesh | ||
| </Typography> | ||
| ); | ||
| } else { | ||
| return ( | ||
| <Typography variant="body2"> | ||
| Add one or more resources to the k8s.yml file<br /><br /> | ||
| Then run <code>linkerd inject k8s.yml | kubectl apply -f -</code> to add them to the service mesh | ||
| </Typography> | ||
| ); | ||
| } | ||
| const unspecifiedResources = <Trans>one or more resources</Trans>; | ||
| const inject = <code>linkerd inject k8s.yml | kubectl apply -f -</code>; | ||
|
|
||
| return ( | ||
| <Typography variant="body2"> | ||
| <Trans> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an example of translating a block of text containing a dynamic text value. |
||
| Add {name || unspecifiedResources } to the k8s.yml file<br /><br /> | ||
| Then run {inject} to add it to the service mesh | ||
| </Trans> | ||
| </Typography> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "Add {0} to the k8s.yml file<0/><1/>Then run {inject} to add it to the service mesh": "Add {0} to the k8s.yml file<0/><1/>Then run {inject} to add it to the service mesh", | ||
| "No data to display": "No data to display", | ||
| "one or more resources": "one or more resources" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "Add {0} to the k8s.yml file<0/><1/>Then run {inject} to add it to the service mesh": "Agregue {0} a la k8s.yml file<0/><1/>Luego ejecuta {inject} para inyectarla en la malla de servicios", | ||
| "No data to display": "No hay datos que mostrar", | ||
| "one or more resources": "uno más recursos más" | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.