---
updatedAt: 2025-05-08T21:27:22.000Z
agentTools:
  projectIndex: https://learn.vtex.com/llms.txt
---

# Answersheet to  'Internationalization practices in VTEX IO'

<HTMLBlock>{`
<style>
      section#hub-content header h1, section#hub-content header h2 {
        color: #f71963
      }
    
      p {
        line-height: 1.5rem;
      }
    </style>
`}</HTMLBlock>

```typescript Countdown.tsx
// store-block/react/Countdown.tsx
import React, { useState } from 'react'
import { TimeSplit } from './typings/global'
import { tick, getTwoDaysFromNow } from './utils/time'
import { useCssHandles } from 'vtex.css-handles'
import { FormattedMessage } from 'react-intl'

interface CountdownProps {
  title: string
  targetDate: string
}

const DEFAULT_TARGET_DATE = getTwoDaysFromNow()

const CSS_HANDLES = ['container', 'countdown', 'title']

const Countdown: StorefrontFunctionComponent<CountdownProps> = ({
  title,
  targetDate = DEFAULT_TARGET_DATE,
}) => {
  const [timeRemaining, setTime] = useState<TimeSplit>({
    hours: '00',
    minutes: '00',
    seconds: '00',
  })

  const titleText = title || <FormattedMessage id="countdown.title" />

  const handles = useCssHandles(CSS_HANDLES)

  tick(targetDate, setTime)

  return (
    <div className={`${handles.container} t-heading-2 fw3 w-100 c-muted-1`}>
      <div className={`${handles.title} db tc`}>{titleText}</div>
      <div className={`${handles.countdown} db tc`}>
        {`${timeRemaining.hours}:${timeRemaining.minutes}:${timeRemaining.seconds}`}
      </div>
    </div>
  )
}

Countdown.schema = {
  title: 'editor.countdown.title',
  description: 'editor.countdown.description',
  type: 'object',
  properties: {
    title: {
      title: 'I am a title',
      type: 'string',
      default: null,
    },
    targetDate: {
      title: 'Final date',
      description: 'Final date used in the countdown',
      type: 'string',
      default: null,
    },
  },
}

export default Countdown
```
```json context.json
// store-block/messages/context.json
{
  "editor.countdown.title": "Countdown",
  "editor.countdown.description": "Countdown component",
  "countdown.title": "Countdown"
}
```
```json en.json
// store-block/messages/en.json
{
  "editor.countdown.title": "Countdown",
  "editor.countdown.description": "Countdown component",
  "countdown.title": "Countdown"
}
```
```json es.json
// store-block/messages/es.json
{
  "editor.countdown.title": "Cuenta regresiva",
  "editor.countdown.description": "Cuenta regresiva component",
  "countdown.title": "Cuenta Regresiva"
}
```
```json pt.json
// store-block/messages/pt.json
{
  "editor.countdown.title": "Contagem regressiva",
  "editor.countdown.description": "Componente de contagem regressiva",
  "countdown.title": "Contagem Regressiva"
}
```

<HTMLBlock>{`
<div id="back-button">
            <i class="fa fa-angle-left"></i>
            <a id="back-link" href="/docs/course-store-block-step06messages-lang-en">back</a>
          </div>
`}</HTMLBlock>

<hr />
<div id="contribute-container">
  <p id="contribute-title"> 
    Help us make this content better!
  </p>
  <p id="contribute-description">
    VTEX IO courses are open source. If you see something wrong, you can open a pull request!
  </p>

  <a id="contribute-button" href="https://github.com/vtex/vtex-courses/edit/master/courses/store-block/steps/06_messages/answersheet">
    Make a contribution
  </a>

  <p id="contribute-issue">
    or <a href="https://github.com/vtex/vtex-courses/issues/new/choose">open an issue</a>
  </p>

</div>