Skip to content
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

Wrong capitalization in months in Spanish #5181

Closed
1 task done
BertaLarre opened this issue May 27, 2022 · 3 comments · Fixed by #5194
Closed
1 task done

Wrong capitalization in months in Spanish #5181

BertaLarre opened this issue May 27, 2022 · 3 comments · Fixed by #5194

Comments

@BertaLarre
Copy link

Desired behaviour

The following date component used in the Spanish version of Sage Intacct Manufacturing should have the initial letters of the months capitalized.

Current behaviour

Currently, the months start with lowercase:
Wrong initial capitalization in Spanish

Suggested Solution

In Spanish we should say “Abril 2022” but “3 de abril de 2022” (depending on the use case).

Where is the content in Spanish coming from? This component should be updated so that months start with capital letters in Spanish.

Please reach out to me if you need further clarification: berta.larre@sage.com.

CodeSandbox or Storybook URL

No response

Anything else we should know?

No response

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.
@BertaLarre BertaLarre added Enhancement triage Triage Required labels May 27, 2022
@edleeks87
Copy link
Contributor

This comes from the built in locales supplied by date-fns so it's weird that some are capitalised whilst others aren't.

I don't think they're likely to fix this anytime soon but we can fix it by either updating the function or via CSS:

  • CSS:
.DayPicker-Caption {
    display: table-caption;
    height: 1.5rem;
    text-align: center;

    > div::first-letter {
      text-transform: capitalize;
    }
  }
  • JS:
const monthsLong = Array.from({ length: 12 }).map((_, i) => {
      const month = localize.month(i);

      return month[0].toUpperCase() + month.slice(1);
    });

image

@Parsium
Copy link
Contributor

Parsium commented May 31, 2022

FE-5197

@Parsium Parsium added On Backlog and removed triage Triage Required labels May 31, 2022
edleeks87 added a commit that referenced this issue Jun 1, 2022
…ctly for all locales

Ensures that months are a capitalised for all locales and that day strings are all 3 characters long
in `DatePicker`. Introduces small optimisation by adding `useMemo` to arrays of days and months so
they only regenerate values when locale changes.

fix #5181
carbonci pushed a commit that referenced this issue Jun 10, 2022
### [106.6.10](v106.6.9...v106.6.10) (2022-06-10)

### Bug Fixes

* **date:** ensure months and days are capitalised and formatted correctly for all locales ([b759d45](b759d45)), closes [#5181](#5181)
@carbonci
Copy link
Collaborator

🎉 This issue has been resolved in version 106.6.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants