Skip to content

Commit 62a344d

Browse files
ianhiclaude
andauthored
Fix a misc i18n issues (#828)
* Fix typos in translated strings - Fix MetPy description: `tCollection...` -> t`Collection...` (stray t inside backticks) - Fix footer copyright: "Apache 2.0Licensed." -> "Apache 2.0 Licensed." (missing space) - Wrap remaining unwrapped project descriptions and domains for translation (hvPlot, Pangeo, cf-xarray, omfit, sgkit, xmip) - Also fix double space in cf-xarray description Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Wrap missing strings for translation - features.js: Wrap "Arbitrary metadata tracking" text - repl.js: Wrap "Try Xarray" heading - donate.js: Wrap "501(c)(3) nonprofit charity" link text - timeline-plot-container.js: Wrap "Issues" tab and include end date inside translation string Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Remove useMemo that caches stale translations The useMemo with empty deps ([]) caches data from the first render and never updates. When the locale changes, the data functions return new translated strings but useMemo returns the stale cached values. Since these data functions are cheap to call, just remove useMemo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add loadCatalog to dashboard and team pages These pages use translated strings but had no getStaticProps calling loadCatalog, so translations wouldn't load on direct page access or SSR in non-English locales. Also wraps the team page title for translation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Use single tagged templates instead of string concatenation Concatenating translated fragments with regular strings (e.g. value + t\`hours\`) prevents translators from reordering the full phrase. Use single t\`...\` tagged templates with interpolations so translators see the complete string. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Remove unused loadCatalog imports These pages intentionally don't load translations (blog content is not translated), so the import is dead code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update message catalogs after adding new translated strings Run lingui extract + compile to add catalog entries for newly wrapped strings. Without this, Lingui shows internal message ID hashes instead of the actual text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 315c487 commit 62a344d

17 files changed

Lines changed: 370 additions & 123 deletions

src/components/array-libraries.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ const Library = ({ name, description, repo, url, logo }) => {
4343

4444
export const ArrayLibraries = () => {
4545
const { t } = useLingui()
46-
let data = getLibraries()
47-
const libraries = React.useMemo(() => data, [])
46+
const libraries = getLibraries()
4847
return (
4948
<Box my={8}>
5049
<Text fontSize={'lg'}>

src/components/dashboard/timeline-plot-container.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export const TimelinePlotContainer = () => {
3838
return (
3939
<Box my={8}>
4040
<Text fontSize={'md'} align={'center'}>
41-
{t`This is a timeline of how many open issues and pull requests Xarray has on Github over time from ${new Date(start).toLocaleDateString()} to `}
42-
{new Date(end).toLocaleDateString()}.
41+
{t`This is a timeline of how many open issues and pull requests Xarray has on Github over time from ${new Date(start).toLocaleDateString()} to ${new Date(end).toLocaleDateString()}.`}
4342
</Text>
4443
<br />
4544
<br />
@@ -48,7 +47,7 @@ export const TimelinePlotContainer = () => {
4847
<Tab _selected={{ color: 'white', bg: 'teal.500' }}>
4948
{t`Pull Requests`}
5049
</Tab>
51-
<Tab _selected={{ color: 'white', bg: 'teal.500' }}>Issues</Tab>
50+
<Tab _selected={{ color: 'white', bg: 'teal.500' }}>{t`Issues`}</Tab>
5251
</TabList>
5352
<TabPanels>
5453
<TabPanel>

src/components/dashboard/timeseries-agg-stats-card.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,16 @@ export const TimeseriesAggStatsCard = ({ query, title, icon }) => {
4545

4646
const change = {
4747
type: diffPercentage < 0 ? 'increase' : 'decrease',
48-
value:
49-
`${d3.format('.2f')(Math.abs(diffPercentage))}% ` + t`since last month`,
48+
value: t`${d3.format('.2f')(Math.abs(diffPercentage))}% since last month`,
5049
}
5150
return (
5251
<StatisticsCard
5352
title={title}
5453
icon={icon}
5554
stat={
5655
result <= 2
57-
? `${d3.format('.1f')(result * 24)} ` + t`hours`
58-
: `${d3.format('.1f')(result)} ` + t`days`
56+
? t`${d3.format('.1f')(result * 24)} hours`
57+
: t`${d3.format('.1f')(result)} days`
5958
}
6059
diff={change}
6160
/>

src/components/donate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const Donate = () => {
4242
color={'blue.400'}
4343
useExternalIcon
4444
>
45-
501(c)(3) nonprofit charity
45+
{t`501(c)(3) nonprofit charity`}
4646
</Text>{' '}
4747
{t`in the United States. NumFOCUS provides Xarray with fiscal, legal,
4848
and administrative support to help ensure the health and

src/components/features.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import { useLingui } from '@lingui/react/macro'
1616

1717
export const Features = () => {
1818
const { t } = useLingui()
19-
let data = getFeatures()
20-
const features = React.useMemo(() => data, [])
19+
const features = getFeatures()
2120
return (
2221
<Box id={'features'} as='section'>
2322
<Container maxW='container.lg' centerContent>

src/components/footer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const Footer = () => {
7676
</Box>
7777

7878
<Text fontSize={'sm'}>
79-
{t${currentYear}, Xarray core developers. Apache 2.0Licensed.`}
79+
{t${currentYear}, Xarray core developers. Apache 2.0 Licensed.`}
8080
</Text>
8181
<GitSHA />
8282

src/components/repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const Repl = () => {
6868
<Box id={'repl'} as='section'>
6969
<Container maxW='container.lg' centerContent>
7070
<Heading as='h1' size='2xl'>
71-
Try Xarray
71+
{t`Try Xarray`}
7272
</Heading>
7373
<Text fontSize={'lg'}>
7474
{t`Try Xarray in a REPL directly in your browser (no installation needed)!`}

src/components/scientific-domains.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { useLingui } from '@lingui/react/macro'
99

1010
export const ScientificDomains = () => {
1111
const { t } = useLingui()
12-
const Projects = getProjects()
13-
const projects = React.useMemo(() => Projects, [])
12+
const projects = getProjects()
1413
return (
1514
<Box my={8}>
1615
<Text fontSize={'lg'}>

src/data/features.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const getFeatures = () => {
2929
},
3030
{
3131
title: t`Arbitrary metadata tracking`,
32-
text: 'Keep track of arbitrary metadata in the form of a Python dictionary.',
32+
text: t`Keep track of arbitrary metadata in the form of a Python dictionary.`,
3333
},
3434
{
3535
title: t`Flexible and Extensible I/O backend API`,

src/data/projects.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function getProjects() {
2929
},
3030
{
3131
name: 'MetPy',
32-
description: `tCollection of tools for reading, visualizing and performing calculations with weather data`,
32+
description: t`Collection of tools for reading, visualizing and performing calculations with weather data`,
3333
domains: [t`🌪🌡 Meteorology`],
3434
repo: 'https://github.com/Unidata/MetPy',
3535
homepage: 'https://unidata.github.io/MetPy',
@@ -62,50 +62,47 @@ export function getProjects() {
6262
{
6363
name: 'hvPlot',
6464
description: t`A high-level plotting API for the PyData ecosystem built on HoloViews`,
65-
domains: ['📊 Visualization'],
65+
domains: [t`📊 Visualization`],
6666
repo: 'https://github.com/holoviz/hvplot',
6767
homepage: 'https://hvplot.holoviz.org/',
6868
logo: '/projects/hvplot-logo_horizontal.svg',
6969
},
7070
{
7171
name: 'Pangeo',
72-
description: 'A community platform for Big Data geoscience',
73-
domains: ['🌎 Geoscience'],
72+
description: t`A community platform for Big Data geoscience`,
73+
domains: [t`🌎 Geoscience`],
7474
homepage: 'https://pangeo.io/',
7575
repo: 'https://github.com/pangeo-data',
7676
logo: '/projects/pangeo_simple_logo.svg',
7777
},
7878
{
7979
name: 'cf-xarray',
80-
description:
81-
'An accessor for Xarray objects that interprets Climate and Forecast (CF) metadata convention attributes',
82-
domains: ['🌎 Geoscience'],
80+
description: t`An accessor for Xarray objects that interprets Climate and Forecast (CF) metadata convention attributes`,
81+
domains: [t`🌎 Geoscience`],
8382
homepage: 'https://cf-xarray.readthedocs.io',
8483
repo: 'https://github.com/xarray-contrib/cf-xarray',
8584
logo: '/projects/cf-xarray-logo.svg',
8685
},
8786
{
8887
name: 'omfit',
89-
description:
90-
'Integrated modeling and experimental data analysis software for magnetically confined thermonuclear fusion experiments',
91-
domains: ['💥 plasma physics'],
88+
description: t`Integrated modeling and experimental data analysis software for magnetically confined thermonuclear fusion experiments`,
89+
domains: [t`💥 plasma physics`],
9290
homepage: 'https://omfit.io',
9391
repo: 'https://omfit.io/install.html#get-access-to-the-omfit-source-code',
9492
logo: '/projects/OMFIT_logo.png',
9593
},
9694
{
9795
name: 'sgkit',
98-
description: 'Scalable statistical genetic data analysis in Python',
99-
domains: ['🧬 genomics'],
96+
description: t`Scalable statistical genetic data analysis in Python`,
97+
domains: [t`🧬 genomics`],
10098
homepage: 'https://sgkit-dev.github.io/sgkit/latest/',
10199
repo: 'https://github.com/sgkit-dev/sgkit',
102100
logo: '/projects/sgkit_trnsprnt.png',
103101
},
104102
{
105103
name: 'xmip',
106-
description:
107-
'Analysis ready CMIP6 data in Python the easy way with pangeo tools.',
108-
domains: ['🌎 Geoscience'],
104+
description: t`Analysis ready CMIP6 data in Python the easy way with pangeo tools.`,
105+
domains: [t`🌎 Geoscience`],
109106
homepage: 'https://cmip6-preprocessing.readthedocs.io/',
110107
repo: 'https://github.com/jbusecke/xmip',
111108
logo: '/projects/xmip.png',

0 commit comments

Comments
 (0)