Skip to content

Commit

Permalink
[BUGFIX] Ajouter une fallback sur la pagination.
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Mar 19, 2024
2 parents 8303610 + 3867a93 commit fbe3da9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addon/translations/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { createIntl } from '@formatjs/intl';
import en from './en';
import fr from './fr';
import nl from './nl';

export function formatMessage(locale, message, values) {
return locales[locale].formatMessage({ id: message }, values);
const intl = locales[locale] || locales.en;
return intl.formatMessage({ id: message }, values);
}

const locales = {
Expand All @@ -15,6 +17,10 @@ const locales = {
locale: 'en',
messages: flattenObject(en),
}),
nl: createIntl({
locale: 'nl',
messages: flattenObject(nl),
}),
};

export function flattenObject(object) {
Expand Down
12 changes: 12 additions & 0 deletions addon/translations/nl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
pagination: {
beforeResultsPerPage: 'Zie',
selectPageSizeLabel: 'Selecteer het aantal items per pagina',
pageResults: '{total, plural, =0 {0 items} =1 {1 item} other {{total, number} items}}',
pageInfo:
'{start, number}-{end, number} van {total, plural, =0 {0 items} =1 {1 item} other {{total, number} items}}',
previousPageLabel: 'Ga naar vorige pagina',
pageNumber: 'Pagina {current, number} / {total, number}',
nextPageLabel: 'Ga naar volgende pagina',
},
};

0 comments on commit fbe3da9

Please sign in to comment.