Skip to content
Snippets Groups Projects
Unverified Commit e98b4d5b authored by Maz Ameli's avatar Maz Ameli Committed by GitHub
Browse files

Merge pull request #6389 from metabase/entity-list-i18n

i18n for some of our list views
parents e67196ce e1f85eb3
Branches
Tags
No related merge requests found
......@@ -20,7 +20,7 @@ const PAGE_SIZE = 10
const SEARCH_GROUPINGS = [
{
id: "name",
name: "Name",
name: t`Name`,
icon: null,
// Name grouping is a no-op grouping so always put all results to same group with identifier `0`
groupBy: () => 0,
......@@ -29,21 +29,21 @@ const SEARCH_GROUPINGS = [
},
{
id: "table",
name: "Table",
name: t`Table`,
icon: "table2",
groupBy: (entity) => entity.table.id,
getGroupName: (entity) => entity.table.display_name
},
{
id: "database",
name: "Database",
name: t`Database`,
icon: "database",
groupBy: (entity) => entity.table.db.id,
getGroupName: (entity) => entity.table.db.name
},
{
id: "creator",
name: "Creator",
name: t`Creator`,
icon: "mine",
groupBy: (entity) => entity.creator.id,
getGroupName: (entity) => entity.creator.common_name
......@@ -209,9 +209,8 @@ export default class EntitySearch extends Component {
<EmptyState
message={
<div className="mt4">
<h3 className="text-grey-5">No results found</h3>
<p className="text-grey-4">Try adjusting your filter to find what you’re
looking for.</p>
<h3 className="text-grey-5">{t`No results found`}</h3>
<p className="text-grey-4">{t`Try adjusting your filter to find what you’re looking for.`}</p>
</div>
}
image="/app/img/empty_question"
......@@ -230,7 +229,7 @@ export default class EntitySearch extends Component {
export const SearchGroupingOptions = ({ currentGrouping, setGrouping }) =>
<div className="Entity-search-grouping-options">
<h3 className="mb3">View by</h3>
<h3 className="mb3">{t`View by`}</h3>
<ul>
{ SEARCH_GROUPINGS.map((groupingOption) =>
<SearchGroupingOption
......@@ -429,7 +428,7 @@ class SearchResultsList extends Component {
return (
<li className="py1 px3 flex justify-end align-center">
<span className="text-bold">{ currentEntitiesText }</span>&nbsp;of&nbsp;<span
<span className="text-bold">{ currentEntitiesText }</span>&nbsp;{t`of`}&nbsp;<span
className="text-bold">{entityCount}</span>
<span
className={cx(
......
......@@ -5,6 +5,7 @@ import {connect} from "react-redux";
import {Link} from "react-router";
import cx from "classnames";
import _ from "underscore"
import { t, jt } from "c-3po";
import type {Dashboard} from "metabase/meta/types/Dashboard";
......@@ -42,19 +43,19 @@ const SECTION_ID_FAVORITES = 'fav';
const SECTIONS: ListFilterWidgetItem[] = [
{
id: SECTION_ID_ALL,
name: 'All dashboards',
name: t`All dashboards`,
icon: 'dashboard',
// empty: 'No questions have been saved yet.',
},
{
id: SECTION_ID_FAVORITES,
name: 'Favorites',
name: t`Favorites`,
icon: 'star',
// empty: 'You haven\'t favorited any questions yet.',
},
{
id: SECTION_ID_MINE,
name: 'Saved by me',
name: t`Saved by me`,
icon: 'mine',
// empty: 'You haven\'t saved any questions yet.'
},
......@@ -150,20 +151,20 @@ export class Dashboards extends Component {
>
{ modalOpen ? this.renderCreateDashboardModal() : null }
<div className="flex align-center pt4 pb1">
<TitleAndDescription title="Dashboards"/>
<TitleAndDescription title={t`Dashboards`}/>
<div className="flex-align-right cursor-pointer text-grey-5">
<Link to="/dashboards/archive">
<Icon name="viewArchive"
className="mr2 text-brand-hover"
tooltip="View the archive"
tooltip={t`View the archive`}
size={20}/>
</Link>
{!noDashboardsCreated &&
<Icon name="add"
className="text-brand-hover"
tooltip="Add new dashboard"
tooltip={t`Add new dashboard`}
size={20}
onClick={this.showCreateDashboard}/>
}
......@@ -172,9 +173,9 @@ export class Dashboards extends Component {
{ noDashboardsCreated ?
<div className="mt2 flex-full flex align-center justify-center">
<EmptyState
message={<span>Put the charts and graphs you look at <br/>frequently in a single, handy place.</span>}
message={<span>{jt`Put the charts and graphs you look at ${<br/>}frequently in a single, handy place.`}</span>}
image="/app/img/dashboard_illustration"
action="Create a dashboard"
action={t`Create a dashboard`}
onActionClick={this.showCreateDashboard}
className="mt2"
imageClassName="mln2"
......@@ -199,14 +200,14 @@ export class Dashboards extends Component {
<EmptyState
message={
<div className="mt4">
<h3 className="text-grey-5">No results found</h3>
<p className="text-grey-4">Try adjusting your filter to find what you’re
looking for.</p>
<h3 className="text-grey-5">{t`No results found`}</h3>
<p className="text-grey-4">{t`Try adjusting your filter to find what you’re
looking for.`}</p>
</div>
}
image="/app/img/empty_dashboard"
imageHeight="210px"
action="Create a dashboard"
action={t`Create a dashboard`}
imageClassName="mln2"
smallDescription
/>
......
......@@ -4,6 +4,7 @@ import React, {Component} from 'react';
import {connect} from "react-redux";
import cx from "classnames";
import _ from "underscore"
import { t, jt } from "c-3po";
import type {Dashboard} from "metabase/meta/types/Dashboard";
......@@ -69,7 +70,7 @@ export class Dashboards extends Component {
const headerWithBackContainer =
<div className="flex align-center pt4 pb1">
<HeaderWithBack name="Archive"/>
<HeaderWithBack name={t`Archive`}/>
</div>
return (
......@@ -82,7 +83,7 @@ export class Dashboards extends Component {
{headerWithBackContainer}
<div className="full flex justify-center" style={{marginTop: "75px"}}>
<EmptyState
message={<span>No dashboards have been<br />archived yet</span>}
message={<span>{jt`No dashboards have been ${<br />} archived yet`}</span>}
icon="viewArchive"
/>
</div>
......@@ -100,9 +101,8 @@ export class Dashboards extends Component {
<EmptyState
message={
<div className="mt4">
<h3 className="text-grey-5">No results found</h3>
<p className="text-grey-4">Try adjusting your filter to find what you’re
looking for.</p>
<h3 className="text-grey-5">{t`No results found`}</h3>
<p className="text-grey-4">{t`Try adjusting your filter to find what you’re looking for.`}</p>
</div>
}
image="/app/img/empty_dashboard"
......
......@@ -15,6 +15,7 @@ import SearchHeader from "metabase/components/SearchHeader";
import ActionHeader from "../components/ActionHeader";
import _ from "underscore";
import { t } from 'c-3po';
import { loadEntities, setSearchText, setItemSelected, setAllSelected, setArchived } from "../questions";
import { loadLabels } from "../labels";
......@@ -57,45 +58,45 @@ const mapDispatchToProps = {
const SECTIONS = [
{
id: 'all',
name: 'All questions',
name: t`All questions`,
icon: 'all',
empty: 'No questions have been saved yet.',
empty: t`No questions have been saved yet.`,
},
{
id: 'fav',
name: 'Favorites',
name: t`Favorites`,
icon: 'star',
empty: 'You haven\'t favorited any questions yet.',
empty: t`You haven't favorited any questions yet.`,
},
{
id: 'recent',
name: 'Recently viewed',
name: t`Recently viewed`,
icon: 'recents',
empty: 'You haven\'t viewed any questions recently.',
empty: t`You haven't viewed any questions recently.`,
},
{
id: 'mine',
name: 'Saved by me',
name: t`Saved by me`,
icon: 'mine',
empty: 'You haven\'t saved any questions yet.'
empty: t`You haven't saved any questions yet.`
},
{
id: 'popular',
name: 'Most popular',
name: t`Most popular`,
icon: 'popular',
empty: 'The most viewed questions across your company will show up here.',
empty: t`The most-viewed questions across your company will show up here.`,
},
{
id: 'archived',
name: "Archive",
name: t`Archive`,
icon: 'archive',
empty: 'If you no longer need a question, you can archive it.'
empty: t`If you no longer need a question, you can archive it.`
}
];
const DEFAULT_SECTION = {
icon: 'all',
empty: 'There aren\'t any questions matching that criteria.'
empty: t`There aren't any questions matching that criteria.`
}
@connect(mapStateToProps, mapDispatchToProps)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment