-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: adding missing translation function #21479
Conversation
@@ -62,7 +62,7 @@ function DateRangeFilter( | |||
|
|||
return ( | |||
<RangeFilterContainer> | |||
<FormLabel>{Header}</FormLabel> | |||
<FormLabel>{t(Header as string)}</FormLabel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the "as string" need here? If this is a dynamic value, it might not be wise to use the t() here.
Header: column, | ||
? tableColumns.map((column: string[] | string) => ({ | ||
accessor: column[0], | ||
Header: column[1], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this bycatch? Might need a little explanation of why this is tackled in this PR.
@@ -318,7 +318,7 @@ export default function DateFilterLabel(props: DateFilterControlProps) { | |||
{!validTimeRange && ( | |||
<IconWrapper className="warning"> | |||
<Icons.ErrorSolidSmall iconColor={theme.colors.error.base} /> | |||
<span className="text error">{evalResponse}</span> | |||
<span className="text error">{t(evalResponse)}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what strings would be expected here, but this sounds highly dynamic and unlikely to be in the translation files. Correct me if I'm mistaken.
@@ -373,7 +373,7 @@ export default function DateFilterLabel(props: DateFilterControlProps) { | |||
> | |||
<Tooltip placement="top" title={tooltipTitle}> | |||
<Label className="pointer" data-test="time-range-trigger"> | |||
{actualTimeRange} | |||
{t(`${actualTimeRange}`)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what strings would be expected here, but this sounds highly dynamic and unlikely to be in the translation files. Correct me if I'm mistaken.
@@ -53,7 +56,7 @@ class CreatedContent extends React.PureComponent<CreatedContentProps> { | |||
const search = [{ col: 'created_by', opr: 'created_by_me', value: 'me' }]; | |||
const query = rison.encode({ | |||
keys: ['none'], | |||
columns: ['created_on_delta_humanized', 'dashboard_title', 'url'], | |||
columns: ['changed_on_utc', 'dashboard_title', 'url'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add context on this change... doesn't seem related to the general translation theme of the PR.
@@ -63,8 +66,8 @@ class CreatedContent extends React.PureComponent<CreatedContentProps> { | |||
const mutator = (data: DashboardResponse) => | |||
data.result.map(dash => ({ | |||
dashboard: <a href={dash.url}>{dash.dashboard_title}</a>, | |||
created: dash.created_on_delta_humanized, | |||
_created: dash.created_on_delta_humanized, | |||
created: moment.utc(dash.changed_on_utc).fromNow(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, more context here would be helpful.
@@ -64,16 +68,19 @@ export default class Favorites extends React.PureComponent<FavoritesProps> { | |||
const mutator = (data: DashboardResponse) => | |||
data.result.map(dash => ({ | |||
dashboard: <a href={dash.url}>{dash.dashboard_title}</a>, | |||
created: dash.created_on_delta_humanized, | |||
_created: dash.created_on_delta_humanized, | |||
created: moment.utc(dash.changed_on_utc).fromNow(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context for this change also welcomed, thanks!
@@ -76,7 +76,7 @@ export default function LanguagePicker(props: LanguagePickerProps) { | |||
> | |||
<StyledLabel className="f16"> | |||
<i className={`flag ${languages[langKey].flag}`} /> | |||
<a href={languages[langKey].url}>{languages[langKey].name}</a> | |||
<a href={languages[langKey].url}>{t(languages[langKey].name)}</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure, I hope having these translated doesn't cause an issue with people having a harder time switching to their preferred language!
Most of this seems a-ok! Thanks for the contribution! The vast majority of the There is, however, a fair amount of change in this PR involving Moment and utc timestamps. A description of how that fits in here (and any PR description at all, for that matter) would be helpful. There are also a couple of translated strings in there that look like they might be fairly dynamic in terms of content. We shouldn't use the t() wrapper unless the translated string is static/stable. Also noting that this should close out #21200 and this can be done automatically by adding "Fixes: #21200" in your PR description. |
Hi @AndVK :) I haven't forgotten about this... any chance this can get a rebase and we can push it through? It's so close |
@AndVK if this is getting to painful to rebase until CI passes and so forth, I'm also fine with splitting it up into smaller PRs that require less strenuous reviews ;) Either way, I still appreciate all this great/hard work! |
Hi, @rusackas! I will split this PR into smaller ones. |
Fantastic, looking forward to it! Ping me/us here and/or on Slack to make sure we pay attention to them! :D |
Hi @AndVK! Thanks for the great work! Do you think you'll be able to split this PR in the next days? If not, I could give a helping hand, if you'd like to... |
Would you mind reviewing #23402 before? |
I went through the suggested changes and most of them were already handled and merged via @AndVK's #21816 (thanks again!). For the very few missing translations I spotted, I'll submit a PR. Besides this, two changes suggested by @AndVK are still open and require some code changes:
Another category of missing translations are error messages. Not sure, which of the are really end user facing, but a couple of them them will be (e.g. in controls.ts or TTestTable.jsx). |
Thanks @hbruch. Closing this PR for now, and appreciate the follow-up! |
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION