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

[I10n] Add Finnish (fi-FI) locale to pickers #6219

Merged
merged 6 commits into from
Sep 21, 2022

Conversation

PetroSilenius
Copy link
Contributor

@PetroSilenius PetroSilenius commented Sep 19, 2022

I noticed that the DataGrid had support for Finnish locale but datepicker was lacking it

  • Adds Finnish locale to Datepicker
  • Adds missing Finnish translations to DataGrid

Translations were formed by myself a native Finnish speaker with the assist of Microsoft language portal and Google Translate

Couldn't find where to change the default placeholder for the datepicker. It should be pp.kk.vvvv in Finnish instead of dd.mm.yyyy

@mui-bot
Copy link

mui-bot commented Sep 19, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 526 1,072.7 614.3 775.26 197.122
Sort 100k rows ms 628.3 1,089.4 628.3 913.54 157.416
Select 100k rows ms 209.8 289.6 221 242.06 33.512
Deselect 100k rows ms 142.3 222.2 217.5 201.44 30.025

Generated by 🚫 dangerJS against 3b77235

@PetroSilenius PetroSilenius marked this pull request as ready for review September 20, 2022 05:19
@flaviendelangle
Copy link
Member

flaviendelangle commented Sep 20, 2022

Couldn't find where to change the default placeholder for the datepicker. It should be pp.kk.vvvv in Finnish instead of dd.mm.yyyy

For now the placeholder is not customizable with the locale.
That's something we are discussing for the next field component.

You can manually override the placeholder passed to your input like so:

<DatePicker
    label="Basic example"
    value={value}
    onChange={(newValue) => {
        setValue(newValue);
    }}
    renderInput={(params) => 
      <TextField 
        {...params} 
        inputProps={{ ...params.inputProps, placeholder: 'pp.kk.vvvv' }} 
      />
    }
/>

Note that it won't react to any change in the format and you have to manually take care of it.
For instance if you have a picker with only a year view, you will have to manually write vvvv

@PetroSilenius
Copy link
Contributor Author

For now the placeholder is not customizable with the locale. That's something we are discussing for the next field component.

You can manually override the placeholder passed to your input like so:

Right, I assumed so since I wasn't able to find anything related to it. Sounds like a good addition as other translations are handled by mui that the placeholder would be handled also👍🏻

@PetroSilenius
Copy link
Contributor Author

Would you be able to review this @flaviendelangle or how should I proceed with the PR?

Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution !

It currently targets the next branch which is for the v6 alpha releases.
I will port this PR to the master branch to have it available on the v5 release as well.

@flaviendelangle flaviendelangle merged commit d94c20e into mui:next Sep 21, 2022
flaviendelangle pushed a commit to flaviendelangle/mui-x that referenced this pull request Sep 21, 2022
flaviendelangle added a commit that referenced this pull request Sep 21, 2022
@flaviendelangle flaviendelangle added l10n localization component: pickers This is the name of the generic UI component, not the React module! labels Sep 22, 2022
@flaviendelangle flaviendelangle changed the title [I10n] Add Finnish (fi-FI) locale to Datepicker [I10n] Add Finnish (fi-FI) locale to pickers Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! l10n localization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants