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

[l10n] Document how far Material-UI should go #20737

Merged
merged 3 commits into from
Apr 25, 2020
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
5 changes: 4 additions & 1 deletion docs/src/pages/guides/localization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ const theme = createMuiTheme({

You can [find the source](https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/locale/index.js) in the GitHub repository.

To create your own translation, or to customise the English text, copy this file to your project, make any changes needed and import the locale from there. (Please do consider contributing new translations back to Material-UI by opening a pull request.)
To create your own translation, or to customise the English text, copy this file to your project, make any changes needed and import the locale from there.

Please do consider contributing new translations back to Material-UI by opening a pull request.
However, Material-UI aims to support the [100 most popular locales](https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers), we might not accept contributions for locales that are not frequently used, for instance `gl-ES` that has "only" 2.5 million native speakers.

### Example

Expand Down
49 changes: 49 additions & 0 deletions packages/material-ui/src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,55 @@ export const frFR: Localization = {
},
};

export const glES: Localization = {
props: {
MuiBreadcrumbs: {
expandText: 'Mostrar camiño',
},
MuiTablePagination: {
backIconButtonText: 'Páxina anterior',
labelRowsPerPage: 'Filas por páxina:',
labelDisplayedRows: ({ from, to, count }) => `${from}-${to === -1 ? count : to} de ${count}`,
nextIconButtonText: 'Seguinte páxina',
},
MuiRating: {
getLabelText: (value) => `${value} Estrela${value !== 1 ? 's' : ''}`,
emptyLabelText: 'Baleira',
},
MuiAutocomplete: {
clearText: 'Limpar',
closeText: 'Pechar',
loadingText: 'Cargando…',
noOptionsText: 'Sen opcións',
openText: 'Aberto',
},
MuiAlert: {
closeText: 'Pechar',
},
MuiPagination: {
'aria-label': 'Paxinador',
getItemAriaLabel: (type, page, selected) => {
if (type === 'page') {
return `${selected ? '' : 'Ir á '}páxina ${page}`;
}
if (type === 'first') {
return 'Ir á primeira páxina';
}
if (type === 'last') {
return 'Ir á última páxina';
}
if (type === 'next') {
return 'Ir á páxina seguinte';
}
if (type === 'previous') {
return 'Ir á páxina anterior';
}
return undefined;
},
},
},
};

export const heIL: Localization = {
props: {
// MuiBreadcrumbs: {
Expand Down