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

Convert some capital letters to lowercase and capitalize months and days in Spanish(Final) #16627

Merged
merged 4 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/CalendarPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class CalendarPicker extends React.PureComponent {
constructor(props) {
super(props);

this.monthNames = moment.localeData(props.preferredLocale).months();
this.daysOfWeek = moment.localeData(props.preferredLocale).weekdays();
this.monthNames = _.map(moment.localeData(props.preferredLocale).months(), month => month.replace(/^\w/, c => c.toUpperCase()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: Just wondering why we didn't do something simpler like:

Suggested change
this.monthNames = _.map(moment.localeData(props.preferredLocale).months(), month => month.replace(/^\w/, c => c.toUpperCase()));
this.monthNames = _.map(moment.localeData(props.preferredLocale).months(), month => month.toUpperCase());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aldo-expensify The first line of code converts the month names to title case (where the first letter of each word is capitalized), while the second line of code converts the month names to all uppercase. We just need to convert first letter of the month to uppercase

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for explaining!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also confused by this. Could you please add a small comment explaining this for people in the future? Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that we want sentence case for these? If so, I believe that we can use Str.recapitalize for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayazhussain79, can you make this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thesahindia ok I'm going to change it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can check new change

this.daysOfWeek = _.map(moment.localeData(props.preferredLocale).weekdays(), day => day.toUpperCase());
luacmartins marked this conversation as resolved.
Show resolved Hide resolved

let currentDateView = props.value;
if (props.selectedYear) {
Expand Down
2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ export default {
},
},
reimbursementAccountLoadingAnimation: {
oneMoment: 'One Moment',
oneMoment: 'One moment',
explanationLine: 'We’re taking a look at your information. You will be able to continue with next steps shortly.',
},
session: {
Expand Down
8 changes: 4 additions & 4 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
invite: 'Invitar',
here: 'aquí',
date: 'Fecha',
dob: 'Fecha de Nacimiento',
dob: 'Fecha de nacimiento',
currentYear: 'Año actual',
currentMonth: 'Mes actual',
ssnLast4: 'Últimos 4 dígitos de su SSN',
Expand All @@ -69,7 +69,7 @@ export default {
stateOrProvince: 'Estado / Provincia',
country: 'País',
zip: 'Código postal',
zipPostCode: 'Código Postal',
zipPostCode: 'Código postal',
whatThis: '¿Qué es esto?',
iAcceptThe: 'Acepto los ',
remove: 'Eliminar',
Expand Down Expand Up @@ -143,7 +143,7 @@ export default {
notAllowedExtension: 'Los archivos adjuntos deben ser de uno de los siguientes tipos: ',
},
avatarCropModal: {
title: 'Editar Foto',
title: 'Editar foto',
description: 'Arrastra, haz zoom y rota tu imagen para que quede como te gusta.',
},
composer: {
Expand Down Expand Up @@ -906,7 +906,7 @@ export default {
},
},
reimbursementAccountLoadingAnimation: {
oneMoment: 'Un Momento',
oneMoment: 'Un momento',
explanationLine: 'Estamos verificando tu información y podrás continuar con los siguientes pasos en unos momentos.',
},
session: {
Expand Down