Skip to content

Commit 4b0d058

Browse files
authored
Merge pull request #9400 from marmelab/fix-i18next-translation-provider-fails-to-use-smart-count
Fix i18next translation provider fails to use smart count in BulkActionsToolbar
2 parents 6046025 + 8f2e377 commit 4b0d058

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

packages/ra-i18n-i18next/src/stories-en.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import raMessages from 'ra-language-english';
2-
import { convertRaTranslationsToI18next } from './convertRaTranslationsToI18next';
32

43
export default {
5-
...convertRaTranslationsToI18next(raMessages),
4+
...raMessages,
65
resources: {
76
posts: {
87
name_one: 'Post',

packages/ra-i18n-i18next/src/stories-fr.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import raMessages from 'ra-language-french';
2-
import { convertRaTranslationsToI18next } from './convertRaTranslationsToI18next';
32

43
export default {
5-
...convertRaTranslationsToI18next(raMessages),
4+
...raMessages,
65
resources: {
76
posts: {
87
name_one: 'Article',

packages/ra-i18n-i18next/src/useI18nextProvider.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,10 @@ export const getI18nProvider = async (
106106

107107
return {
108108
translate: (key: string, options: any = {}) => {
109-
const { _: defaultValue, smart_count: count, ...otherOptions } =
110-
options || {};
109+
const { _: defaultValue, ...otherOptions } = options || {};
111110
return translate(key, {
112111
defaultValue,
113-
count,
112+
count: options.smart_count,
114113
...otherOptions,
115114
}).toString();
116115
},

0 commit comments

Comments
 (0)