nestjs-i18n
Advanced tools
Comparing version 9.1.10 to 9.2.0
@@ -5,3 +5,3 @@ { | ||
"title": "Plurals", | ||
"description": "You can use plurals inside your translations as followed. You need to provide a one, other and zero translation for the pluralization to work.", | ||
"description": "You can use plurals inside your translations as followed. You need to provide some of the listed categories required by your language rules Language Plural Rules. After finding your language in the table, check out the Type column. The cardinal type includes all plural categories you must implement. The next Example column will help you find out the correct form for each category.", | ||
"source": "@site/docs/guides/plurals.md", | ||
@@ -8,0 +8,0 @@ "sourceDirName": "guides", |
@@ -253,3 +253,3 @@ { | ||
"title": "Plurals", | ||
"description": "You can use plurals inside your translations as followed. You need to provide a one, other and zero translation for the pluralization to work.", | ||
"description": "You can use plurals inside your translations as followed. You need to provide some of the listed categories required by your language rules Language Plural Rules. After finding your language in the table, check out the Type column. The cardinal type includes all plural categories you must implement. The next Example column will help you find out the correct form for each category.", | ||
"sidebar": "tutorialSidebar" | ||
@@ -256,0 +256,0 @@ }, |
export default { | ||
'__comp---theme-debug-config-23-a-2ff': [() => import(/* webpackChunkName: '__comp---theme-debug-config-23-a-2ff' */ '@theme/DebugConfig'), '@theme/DebugConfig', require.resolveWeak('@theme/DebugConfig')], | ||
'__comp---theme-debug-contentba-8-ce7': [() => import(/* webpackChunkName: '__comp---theme-debug-contentba-8-ce7' */ '@theme/DebugContent'), '@theme/DebugContent', require.resolveWeak('@theme/DebugContent')], | ||
'__comp---theme-debug-global-dataede-0fa': [() => import(/* webpackChunkName: '__comp---theme-debug-global-dataede-0fa' */ '@theme/DebugGlobalData'), '@theme/DebugGlobalData', require.resolveWeak('@theme/DebugGlobalData')], | ||
'__comp---theme-debug-registry-679-501': [() => import(/* webpackChunkName: '__comp---theme-debug-registry-679-501' */ '@theme/DebugRegistry'), '@theme/DebugRegistry', require.resolveWeak('@theme/DebugRegistry')], | ||
'__comp---theme-debug-routes-946-699': [() => import(/* webpackChunkName: '__comp---theme-debug-routes-946-699' */ '@theme/DebugRoutes'), '@theme/DebugRoutes', require.resolveWeak('@theme/DebugRoutes')], | ||
'__comp---theme-debug-site-metadata-68-e-3d4': [() => import(/* webpackChunkName: '__comp---theme-debug-site-metadata-68-e-3d4' */ '@theme/DebugSiteMetadata'), '@theme/DebugSiteMetadata', require.resolveWeak('@theme/DebugSiteMetadata')], | ||
'__comp---theme-doc-item-178-a40': [() => import(/* webpackChunkName: '__comp---theme-doc-item-178-a40' */ '@theme/DocItem'), '@theme/DocItem', require.resolveWeak('@theme/DocItem')], | ||
'__comp---theme-doc-page-1-be-9be': [() => import(/* webpackChunkName: '__comp---theme-doc-page-1-be-9be' */ '@theme/DocPage'), '@theme/DocPage', require.resolveWeak('@theme/DocPage')], | ||
'__comp---theme-search-page-1-a-4-d6f': [() => import(/* webpackChunkName: '__comp---theme-search-page-1-a-4-d6f' */ '@theme/SearchPage'), '@theme/SearchPage', require.resolveWeak('@theme/SearchPage')], | ||
'allContent---docusaurus-debug-content-246-9aa': [() => import(/* webpackChunkName: 'allContent---docusaurus-debug-content-246-9aa' */ '~debug/default/docusaurus-debug-all-content-673.json'), '~debug/default/docusaurus-debug-all-content-673.json', require.resolveWeak('~debug/default/docusaurus-debug-all-content-673.json')], | ||
'content---c-37-d02': [() => import(/* webpackChunkName: 'content---c-37-d02' */ '@site/docs/index.md'), '@site/docs/index.md', require.resolveWeak('@site/docs/index.md')], | ||
'content---concepts-i-18-n-context-5-da-a93': [() => import(/* webpackChunkName: 'content---concepts-i-18-n-context-5-da-a93' */ '@site/docs/concepts/i18n-context.md'), '@site/docs/concepts/i18n-context.md', require.resolveWeak('@site/docs/concepts/i18n-context.md')], | ||
'content---concepts-loadere-7-e-9f1': [() => import(/* webpackChunkName: 'content---concepts-loadere-7-e-9f1' */ '@site/docs/concepts/loader.md'), '@site/docs/concepts/loader.md', require.resolveWeak('@site/docs/concepts/loader.md')], | ||
'content---concepts-resolver-8-e-1-15a': [() => import(/* webpackChunkName: 'content---concepts-resolver-8-e-1-15a' */ '@site/docs/concepts/resolver.md'), '@site/docs/concepts/resolver.md', require.resolveWeak('@site/docs/concepts/resolver.md')], | ||
'content---guides-debuggingf-3-f-234': [() => import(/* webpackChunkName: 'content---guides-debuggingf-3-f-234' */ '@site/docs/guides/debugging.md'), '@site/docs/guides/debugging.md', require.resolveWeak('@site/docs/guides/debugging.md')], | ||
'content---guides-dto-validation-global-validation-706-aa0': [() => import(/* webpackChunkName: 'content---guides-dto-validation-global-validation-706-aa0' */ '@site/docs/guides/dto_validation/global-validation.md'), '@site/docs/guides/dto_validation/global-validation.md', require.resolveWeak('@site/docs/guides/dto_validation/global-validation.md')], | ||
'content---guides-dto-validation-manual-validation-921-532': [() => import(/* webpackChunkName: 'content---guides-dto-validation-manual-validation-921-532' */ '@site/docs/guides/dto_validation/manual-validation.md'), '@site/docs/guides/dto_validation/manual-validation.md', require.resolveWeak('@site/docs/guides/dto_validation/manual-validation.md')], | ||
'content---guides-exception-filters-0-ae-0c5': [() => import(/* webpackChunkName: 'content---guides-exception-filters-0-ae-0c5' */ '@site/docs/guides/exception-filters.md'), '@site/docs/guides/exception-filters.md', require.resolveWeak('@site/docs/guides/exception-filters.md')], | ||
'content---guides-fallback-languages-736-756': [() => import(/* webpackChunkName: 'content---guides-fallback-languages-736-756' */ '@site/docs/guides/fallback-languages.md'), '@site/docs/guides/fallback-languages.md', require.resolveWeak('@site/docs/guides/fallback-languages.md')], | ||
'content---guides-formattingecd-263': [() => import(/* webpackChunkName: 'content---guides-formattingecd-263' */ '@site/docs/guides/formatting.md'), '@site/docs/guides/formatting.md', require.resolveWeak('@site/docs/guides/formatting.md')], | ||
'content---guides-graphql-994-ba8': [() => import(/* webpackChunkName: 'content---guides-graphql-994-ba8' */ '@site/docs/guides/graphql.md'), '@site/docs/guides/graphql.md', require.resolveWeak('@site/docs/guides/graphql.md')], | ||
'content---guides-grpcf-8-b-fe4': [() => import(/* webpackChunkName: 'content---guides-grpcf-8-b-fe4' */ '@site/docs/guides/grpc.md'), '@site/docs/guides/grpc.md', require.resolveWeak('@site/docs/guides/grpc.md')], | ||
'content---guides-guard-995-9b3': [() => import(/* webpackChunkName: 'content---guides-guard-995-9b3' */ '@site/docs/guides/guard.md'), '@site/docs/guides/guard.md', require.resolveWeak('@site/docs/guides/guard.md')], | ||
'content---guides-mailer-527-95d': [() => import(/* webpackChunkName: 'content---guides-mailer-527-95d' */ '@site/docs/guides/mailer.md'), '@site/docs/guides/mailer.md', require.resolveWeak('@site/docs/guides/mailer.md')], | ||
'content---guides-nested-872-165': [() => import(/* webpackChunkName: 'content---guides-nested-872-165' */ '@site/docs/guides/nested.md'), '@site/docs/guides/nested.md', require.resolveWeak('@site/docs/guides/nested.md')], | ||
'content---guides-plurals-1-a-8-4a0': [() => import(/* webpackChunkName: 'content---guides-plurals-1-a-8-4a0' */ '@site/docs/guides/plurals.md'), '@site/docs/guides/plurals.md', require.resolveWeak('@site/docs/guides/plurals.md')], | ||
'content---guides-view-engines-ejs-779-f1b': [() => import(/* webpackChunkName: 'content---guides-view-engines-ejs-779-f1b' */ '@site/docs/guides/view_engines/ejs.md'), '@site/docs/guides/view_engines/ejs.md', require.resolveWeak('@site/docs/guides/view_engines/ejs.md')], | ||
'content---guides-view-engines-handlebars-2-fc-70b': [() => import(/* webpackChunkName: 'content---guides-view-engines-handlebars-2-fc-70b' */ '@site/docs/guides/view_engines/handlebars.md'), '@site/docs/guides/view_engines/handlebars.md', require.resolveWeak('@site/docs/guides/view_engines/handlebars.md')], | ||
'content---guides-view-engines-pugd-3-a-7ad': [() => import(/* webpackChunkName: 'content---guides-view-engines-pugd-3-a-7ad' */ '@site/docs/guides/view_engines/pug.md'), '@site/docs/guides/view_engines/pug.md', require.resolveWeak('@site/docs/guides/view_engines/pug.md')], | ||
'content---quick-startc-17-374': [() => import(/* webpackChunkName: 'content---quick-startc-17-374' */ '@site/docs/quick-start.mdx'), '@site/docs/quick-start.mdx', require.resolveWeak('@site/docs/quick-start.mdx')], | ||
'plugin---ab-6-0dd': [() => import(/* webpackChunkName: 'plugin---ab-6-0dd' */ '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json'), '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json', require.resolveWeak('/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json')], | ||
'plugin---docusaurus-debug-906-84d': [() => import(/* webpackChunkName: 'plugin---docusaurus-debug-906-84d' */ '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-debug/default/plugin-route-context-module-100.json'), '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-debug/default/plugin-route-context-module-100.json', require.resolveWeak('/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-debug/default/plugin-route-context-module-100.json')], | ||
'plugin---search-2-a-7-ef1': [() => import(/* webpackChunkName: 'plugin---search-2-a-7-ef1' */ '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json'), '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json', require.resolveWeak('/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json')], | ||
'versionMetadata---935-fcf': [() => import(/* webpackChunkName: 'versionMetadata---935-fcf' */ '~docs/default/version-current-metadata-prop-751.json'), '~docs/default/version-current-metadata-prop-751.json', require.resolveWeak('~docs/default/version-current-metadata-prop-751.json')],}; | ||
'0aee77ca': [() => import(/* webpackChunkName: '0aee77ca' */ '@site/docs/guides/exception-filters.md'), '@site/docs/guides/exception-filters.md', require.resolveWeak('@site/docs/guides/exception-filters.md')], | ||
'17896441': [() => import(/* webpackChunkName: '17896441' */ '@theme/DocItem'), '@theme/DocItem', require.resolveWeak('@theme/DocItem')], | ||
'1a4e3797': [() => import(/* webpackChunkName: '1a4e3797' */ '@theme/SearchPage'), '@theme/SearchPage', require.resolveWeak('@theme/SearchPage')], | ||
'1a8e8d0d': [() => import(/* webpackChunkName: '1a8e8d0d' */ '@site/docs/guides/plurals.md'), '@site/docs/guides/plurals.md', require.resolveWeak('@site/docs/guides/plurals.md')], | ||
'1be78505': [() => import(/* webpackChunkName: '1be78505' */ '@theme/DocPage'), '@theme/DocPage', require.resolveWeak('@theme/DocPage')], | ||
'2a7d3a0b': [() => import(/* webpackChunkName: '2a7d3a0b' */ '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json'), '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json', require.resolveWeak('/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json')], | ||
'2fc50a32': [() => import(/* webpackChunkName: '2fc50a32' */ '@site/docs/guides/view_engines/handlebars.md'), '@site/docs/guides/view_engines/handlebars.md', require.resolveWeak('@site/docs/guides/view_engines/handlebars.md')], | ||
'527e1ee2': [() => import(/* webpackChunkName: '527e1ee2' */ '@site/docs/guides/mailer.md'), '@site/docs/guides/mailer.md', require.resolveWeak('@site/docs/guides/mailer.md')], | ||
'5dae8aa9': [() => import(/* webpackChunkName: '5dae8aa9' */ '@site/docs/concepts/i18n-context.md'), '@site/docs/concepts/i18n-context.md', require.resolveWeak('@site/docs/concepts/i18n-context.md')], | ||
'70655cbc': [() => import(/* webpackChunkName: '70655cbc' */ '@site/docs/guides/dto_validation/global-validation.md'), '@site/docs/guides/dto_validation/global-validation.md', require.resolveWeak('@site/docs/guides/dto_validation/global-validation.md')], | ||
'736098be': [() => import(/* webpackChunkName: '736098be' */ '@site/docs/guides/fallback-languages.md'), '@site/docs/guides/fallback-languages.md', require.resolveWeak('@site/docs/guides/fallback-languages.md')], | ||
'779045f9': [() => import(/* webpackChunkName: '779045f9' */ '@site/docs/guides/view_engines/ejs.md'), '@site/docs/guides/view_engines/ejs.md', require.resolveWeak('@site/docs/guides/view_engines/ejs.md')], | ||
'87244312': [() => import(/* webpackChunkName: '87244312' */ '@site/docs/guides/nested.md'), '@site/docs/guides/nested.md', require.resolveWeak('@site/docs/guides/nested.md')], | ||
'8e1c0555': [() => import(/* webpackChunkName: '8e1c0555' */ '@site/docs/concepts/resolver.md'), '@site/docs/concepts/resolver.md', require.resolveWeak('@site/docs/concepts/resolver.md')], | ||
'921cd9c8': [() => import(/* webpackChunkName: '921cd9c8' */ '@site/docs/guides/dto_validation/manual-validation.md'), '@site/docs/guides/dto_validation/manual-validation.md', require.resolveWeak('@site/docs/guides/dto_validation/manual-validation.md')], | ||
'935f2afb': [() => import(/* webpackChunkName: '935f2afb' */ '~docs/default/version-current-metadata-prop-751.json'), '~docs/default/version-current-metadata-prop-751.json', require.resolveWeak('~docs/default/version-current-metadata-prop-751.json')], | ||
'994a679b': [() => import(/* webpackChunkName: '994a679b' */ '@site/docs/guides/graphql.md'), '@site/docs/guides/graphql.md', require.resolveWeak('@site/docs/guides/graphql.md')], | ||
'99524416': [() => import(/* webpackChunkName: '99524416' */ '@site/docs/guides/guard.md'), '@site/docs/guides/guard.md', require.resolveWeak('@site/docs/guides/guard.md')], | ||
'ab65c8f9': [() => import(/* webpackChunkName: 'ab65c8f9' */ '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json'), '/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json', require.resolveWeak('/Users/toonvanstrijp/Projects/nestjs-i18n/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json')], | ||
'c179f821': [() => import(/* webpackChunkName: 'c179f821' */ '@site/docs/quick-start.mdx'), '@site/docs/quick-start.mdx', require.resolveWeak('@site/docs/quick-start.mdx')], | ||
'c377a04b': [() => import(/* webpackChunkName: 'c377a04b' */ '@site/docs/index.md'), '@site/docs/index.md', require.resolveWeak('@site/docs/index.md')], | ||
'd3a665d3': [() => import(/* webpackChunkName: 'd3a665d3' */ '@site/docs/guides/view_engines/pug.md'), '@site/docs/guides/view_engines/pug.md', require.resolveWeak('@site/docs/guides/view_engines/pug.md')], | ||
'e7e70b0d': [() => import(/* webpackChunkName: 'e7e70b0d' */ '@site/docs/concepts/loader.md'), '@site/docs/concepts/loader.md', require.resolveWeak('@site/docs/concepts/loader.md')], | ||
'ecdd7942': [() => import(/* webpackChunkName: 'ecdd7942' */ '@site/docs/guides/formatting.md'), '@site/docs/guides/formatting.md', require.resolveWeak('@site/docs/guides/formatting.md')], | ||
'f3f9be1d': [() => import(/* webpackChunkName: 'f3f9be1d' */ '@site/docs/guides/debugging.md'), '@site/docs/guides/debugging.md', require.resolveWeak('@site/docs/guides/debugging.md')], | ||
'f8b82846': [() => import(/* webpackChunkName: 'f8b82846' */ '@site/docs/guides/grpc.md'), '@site/docs/guides/grpc.md', require.resolveWeak('@site/docs/guides/grpc.md')],}; |
@@ -6,37 +6,2 @@ import React from 'react'; | ||
{ | ||
path: '/__docusaurus/debug', | ||
component: ComponentCreator('/__docusaurus/debug', 'ae4'), | ||
exact: true | ||
}, | ||
{ | ||
path: '/__docusaurus/debug/config', | ||
component: ComponentCreator('/__docusaurus/debug/config', 'fa2'), | ||
exact: true | ||
}, | ||
{ | ||
path: '/__docusaurus/debug/content', | ||
component: ComponentCreator('/__docusaurus/debug/content', '9c2'), | ||
exact: true | ||
}, | ||
{ | ||
path: '/__docusaurus/debug/globalData', | ||
component: ComponentCreator('/__docusaurus/debug/globalData', '965'), | ||
exact: true | ||
}, | ||
{ | ||
path: '/__docusaurus/debug/metadata', | ||
component: ComponentCreator('/__docusaurus/debug/metadata', '725'), | ||
exact: true | ||
}, | ||
{ | ||
path: '/__docusaurus/debug/registry', | ||
component: ComponentCreator('/__docusaurus/debug/registry', 'ef6'), | ||
exact: true | ||
}, | ||
{ | ||
path: '/__docusaurus/debug/routes', | ||
component: ComponentCreator('/__docusaurus/debug/routes', '411'), | ||
exact: true | ||
}, | ||
{ | ||
path: '/search', | ||
@@ -43,0 +8,0 @@ component: ComponentCreator('/search', 'c0c'), |
{ | ||
"/__docusaurus/debug-ae4": { | ||
"__comp": "__comp---theme-debug-config-23-a-2ff", | ||
"__context": { | ||
"plugin": "plugin---docusaurus-debug-906-84d" | ||
} | ||
}, | ||
"/__docusaurus/debug/config-fa2": { | ||
"__comp": "__comp---theme-debug-config-23-a-2ff", | ||
"__context": { | ||
"plugin": "plugin---docusaurus-debug-906-84d" | ||
} | ||
}, | ||
"/__docusaurus/debug/content-9c2": { | ||
"__comp": "__comp---theme-debug-contentba-8-ce7", | ||
"__context": { | ||
"plugin": "plugin---docusaurus-debug-906-84d" | ||
}, | ||
"allContent": "allContent---docusaurus-debug-content-246-9aa" | ||
}, | ||
"/__docusaurus/debug/globalData-965": { | ||
"__comp": "__comp---theme-debug-global-dataede-0fa", | ||
"__context": { | ||
"plugin": "plugin---docusaurus-debug-906-84d" | ||
} | ||
}, | ||
"/__docusaurus/debug/metadata-725": { | ||
"__comp": "__comp---theme-debug-site-metadata-68-e-3d4", | ||
"__context": { | ||
"plugin": "plugin---docusaurus-debug-906-84d" | ||
} | ||
}, | ||
"/__docusaurus/debug/registry-ef6": { | ||
"__comp": "__comp---theme-debug-registry-679-501", | ||
"__context": { | ||
"plugin": "plugin---docusaurus-debug-906-84d" | ||
} | ||
}, | ||
"/__docusaurus/debug/routes-411": { | ||
"__comp": "__comp---theme-debug-routes-946-699", | ||
"__context": { | ||
"plugin": "plugin---docusaurus-debug-906-84d" | ||
} | ||
}, | ||
"/search-c0c": { | ||
"__comp": "__comp---theme-search-page-1-a-4-d6f", | ||
"__comp": "1a4e3797", | ||
"__context": { | ||
"plugin": "plugin---search-2-a-7-ef1" | ||
"plugin": "2a7d3a0b" | ||
} | ||
}, | ||
"/-b2b": { | ||
"__comp": "__comp---theme-doc-page-1-be-9be", | ||
"__comp": "1be78505", | ||
"__context": { | ||
"plugin": "plugin---ab-6-0dd" | ||
"plugin": "ab65c8f9" | ||
}, | ||
"versionMetadata": "versionMetadata---935-fcf" | ||
"versionMetadata": "935f2afb" | ||
}, | ||
"/-98e": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---c-37-d02" | ||
"__comp": "17896441", | ||
"content": "c377a04b" | ||
}, | ||
"/concepts/i18n-context-6e2": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---concepts-i-18-n-context-5-da-a93" | ||
"__comp": "17896441", | ||
"content": "5dae8aa9" | ||
}, | ||
"/concepts/loader-54b": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---concepts-loadere-7-e-9f1" | ||
"__comp": "17896441", | ||
"content": "e7e70b0d" | ||
}, | ||
"/concepts/resolver-f41": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---concepts-resolver-8-e-1-15a" | ||
"__comp": "17896441", | ||
"content": "8e1c0555" | ||
}, | ||
"/guides/debugging-22d": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-debuggingf-3-f-234" | ||
"__comp": "17896441", | ||
"content": "f3f9be1d" | ||
}, | ||
"/guides/dto_validation/global-validation-120": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-dto-validation-global-validation-706-aa0" | ||
"__comp": "17896441", | ||
"content": "70655cbc" | ||
}, | ||
"/guides/dto_validation/manual-validation-5c5": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-dto-validation-manual-validation-921-532" | ||
"__comp": "17896441", | ||
"content": "921cd9c8" | ||
}, | ||
"/guides/exception-filters-7db": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-exception-filters-0-ae-0c5" | ||
"__comp": "17896441", | ||
"content": "0aee77ca" | ||
}, | ||
"/guides/fallback-languages-351": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-fallback-languages-736-756" | ||
"__comp": "17896441", | ||
"content": "736098be" | ||
}, | ||
"/guides/formatting-2ee": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-formattingecd-263" | ||
"__comp": "17896441", | ||
"content": "ecdd7942" | ||
}, | ||
"/guides/graphql-2d4": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-graphql-994-ba8" | ||
"__comp": "17896441", | ||
"content": "994a679b" | ||
}, | ||
"/guides/grpc-b00": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-grpcf-8-b-fe4" | ||
"__comp": "17896441", | ||
"content": "f8b82846" | ||
}, | ||
"/guides/guard-05a": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-guard-995-9b3" | ||
"__comp": "17896441", | ||
"content": "99524416" | ||
}, | ||
"/guides/mailer-0ea": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-mailer-527-95d" | ||
"__comp": "17896441", | ||
"content": "527e1ee2" | ||
}, | ||
"/guides/nested-8e9": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-nested-872-165" | ||
"__comp": "17896441", | ||
"content": "87244312" | ||
}, | ||
"/guides/plurals-3ba": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-plurals-1-a-8-4a0" | ||
"__comp": "17896441", | ||
"content": "1a8e8d0d" | ||
}, | ||
"/guides/view_engines/ejs-d98": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-view-engines-ejs-779-f1b" | ||
"__comp": "17896441", | ||
"content": "779045f9" | ||
}, | ||
"/guides/view_engines/handlebars-666": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-view-engines-handlebars-2-fc-70b" | ||
"__comp": "17896441", | ||
"content": "2fc50a32" | ||
}, | ||
"/guides/view_engines/pug-047": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---guides-view-engines-pugd-3-a-7ad" | ||
"__comp": "17896441", | ||
"content": "d3a665d3" | ||
}, | ||
"/quick-start-2a3": { | ||
"__comp": "__comp---theme-doc-item-178-a40", | ||
"content": "content---quick-startc-17-374" | ||
"__comp": "17896441", | ||
"content": "c179f821" | ||
} | ||
} |
{ | ||
"docusaurusVersion": "2.0.1", | ||
"siteVersion": "9.1.9", | ||
"siteVersion": "9.1.10", | ||
"pluginVersions": { | ||
@@ -15,5 +15,5 @@ "docusaurus-plugin-content-docs": { | ||
}, | ||
"docusaurus-plugin-debug": { | ||
"docusaurus-plugin-sitemap": { | ||
"type": "package", | ||
"name": "@docusaurus/plugin-debug", | ||
"name": "@docusaurus/plugin-sitemap", | ||
"version": "2.0.1" | ||
@@ -20,0 +20,0 @@ }, |
@@ -308,4 +308,3 @@ "use strict"; | ||
provide: resolver, | ||
useClass: resolver, | ||
inject: [optionsToken], | ||
useClass: resolver | ||
}); | ||
@@ -312,0 +311,0 @@ if (options) { |
export interface I18nPluralObject { | ||
zero?: string; | ||
one?: string; | ||
two?: string; | ||
few?: string; | ||
many?: string; | ||
other?: string; | ||
zero?: string; | ||
} |
@@ -24,2 +24,3 @@ import { Logger, OnModuleDestroy } from '@nestjs/common'; | ||
private translations; | ||
private pluralRules; | ||
private unsubscribe; | ||
@@ -26,0 +27,0 @@ constructor(i18nOptions: I18nOptions, translations: Observable<I18nTranslation>, supportedLanguages: Observable<string[]>, logger: Logger, loader: I18nLoader, languagesSubject: BehaviorSubject<string[]>, translationsSubject: BehaviorSubject<I18nTranslation>); |
@@ -23,2 +23,3 @@ "use strict"; | ||
const util_1 = require("../utils/util"); | ||
const pluralKeys = ['zero', 'one', 'two', 'few', 'many', 'other']; | ||
let I18nService = class I18nService { | ||
@@ -31,2 +32,3 @@ constructor(i18nOptions, translations, supportedLanguages, logger, loader, languagesSubject, translationsSubject) { | ||
this.translationsSubject = translationsSubject; | ||
this.pluralRules = new Map(); | ||
this.unsubscribe = new rxjs_1.Subject(); | ||
@@ -66,3 +68,3 @@ this.hbsHelper = (key, args, options) => { | ||
const translationsByLanguage = this.translations[lang]; | ||
const translation = this.translateObject(key, translationsByLanguage ? translationsByLanguage : key, options, translationsByLanguage ? translationsByLanguage : undefined); | ||
const translation = this.translateObject(key, translationsByLanguage ? translationsByLanguage : key, lang, options, translationsByLanguage ? translationsByLanguage : undefined); | ||
if (translationsByLanguage === undefined || | ||
@@ -110,3 +112,3 @@ translationsByLanguage === null || | ||
} | ||
translateObject(key, translations, options, rootTranslations) { | ||
translateObject(key, translations, lang, options, rootTranslations) { | ||
var _a, _b; | ||
@@ -119,3 +121,3 @@ const keys = key.split('.'); | ||
return translations && translations[firstKey] | ||
? this.translateObject(newKey, translations[firstKey], options, rootTranslations) | ||
? this.translateObject(newKey, translations[firstKey], lang, options, rootTranslations) | ||
: undefined; | ||
@@ -128,10 +130,12 @@ } | ||
const count = Number(args['count']); | ||
if (count == 0 && !!pluralObject.zero) { | ||
translation = pluralObject.zero; | ||
if (!this.pluralRules.has(lang)) { | ||
this.pluralRules.set(lang, new Intl.PluralRules(lang)); | ||
} | ||
else if (count == 1 && !!pluralObject.one) { | ||
translation = pluralObject.one; | ||
const pluralRules = this.pluralRules.get(lang); | ||
const pluralCategory = pluralRules.select(count); | ||
if (count === 0 && pluralObject['zero']) { | ||
translation = pluralObject['zero']; | ||
} | ||
else if (pluralObject.other) { | ||
translation = pluralObject.other; | ||
else if (pluralObject[pluralCategory]) { | ||
translation = pluralObject[pluralCategory]; | ||
} | ||
@@ -141,3 +145,3 @@ } | ||
const result = Object.keys(translation).reduce((obj, nestedKey) => { | ||
return Object.assign(Object.assign({}, obj), { [nestedKey]: this.translateObject(nestedKey, translation, options, rootTranslations) }); | ||
return Object.assign(Object.assign({}, obj), { [nestedKey]: this.translateObject(nestedKey, translation, lang, options, rootTranslations) }); | ||
}, {}); | ||
@@ -154,3 +158,3 @@ if (translation instanceof Array) { | ||
for (const nestedTranslation of nestedTranslations) { | ||
const result = (_b = this.translateObject(nestedTranslation.key, rootTranslations, Object.assign(Object.assign({}, options), { args: Object.assign({ parent: options.args }, nestedTranslation.args) }))) !== null && _b !== void 0 ? _b : ''; | ||
const result = (_b = this.translateObject(nestedTranslation.key, rootTranslations, lang, Object.assign(Object.assign({}, options), { args: Object.assign({ parent: options.args }, nestedTranslation.args) }))) !== null && _b !== void 0 ? _b : ''; | ||
translation = | ||
@@ -181,4 +185,6 @@ translation.substring(0, nestedTranslation.index - offset) + | ||
getPluralObject(translation) { | ||
if (translation['one'] || translation['zero'] || translation['other']) { | ||
return translation; | ||
for (const k of pluralKeys) { | ||
if (translation[k]) { | ||
return translation; | ||
} | ||
} | ||
@@ -185,0 +191,0 @@ return undefined; |
@@ -40,3 +40,3 @@ --- | ||
app.use(I18nMiddleware); | ||
await app.listen(3001); | ||
await app.listen(3000); | ||
} | ||
@@ -46,2 +46,19 @@ bootstrap(); | ||
or | ||
```typescript title="src/app.module.ts" | ||
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; | ||
import { I18nMiddleware } from 'nestjs-i18n'; | ||
@Module({ | ||
... | ||
}) | ||
export class AppModule implements NestModule { | ||
configure(consumer: MiddlewareConsumer) { | ||
consumer.apply(I18nMiddleware, MyMiddleware).forRoutes('*'); | ||
} | ||
} | ||
``` | ||
::: |
@@ -6,15 +6,16 @@ --- | ||
# Plurals | ||
You can use plurals inside your translations as followed. You need to provide a `one`, `other` and `zero` translation for the pluralization to work. | ||
You can use plurals inside your translations as followed. You need to provide some of the listed categories required by your language rules: `zero`, `one`, `two`, `few`, `many`, and `other`. To check which categories you need to specify for your language, you can use this reference: [Language Plural Rules](https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_plural_rules.html). After finding your language in the table, check out the **Type** column. The **cardinal** type includes all plural categories you must implement. The next **Example** column will help you find out the correct form for each category. | ||
```json title="src/i18n/en/test.json" | ||
{ | ||
"day_interval": { | ||
"one": "Every day", | ||
"other": "Every {count} days", | ||
"zero": "Never" | ||
"one": "Every day", | ||
"other": "Every {count} days", | ||
"zero": "Never" | ||
}, | ||
"cat": { | ||
"one": "cat", | ||
"other": "cats", | ||
"zero": "cats" | ||
"one": "cat", | ||
"other": "cats", | ||
"zero": "cats" | ||
} | ||
@@ -24,3 +25,3 @@ } | ||
For i18n to pick the right plural you need to provide a count argument within the translation function. | ||
For i18n to pick the right plural you need to provide a `count` argument within the translation function. | ||
@@ -31,2 +32,22 @@ ```typescript title="src/app.controller.ts" | ||
}); | ||
``` | ||
``` | ||
> Note: English plural rules does not require `zero` category. This behavior has been kept for backwards compatibility and will work for any language. | ||
```json title="src/i18n/uk/test.json" | ||
{ | ||
"day_interval": { | ||
"one": "{count} день", | ||
"few": "{count} дні", | ||
"many": "{count} днів", | ||
"other": "{count} дня" | ||
} | ||
} | ||
``` | ||
```typescript title="src/app.controller.ts" | ||
await i18n.t('test.day_interval', { args: { count: 1 } }); // => 1 день | ||
await i18n.t('test.day_interval', { args: { count: 2 } }); // => 2 дні | ||
await i18n.t('test.day_interval', { args: { count: 5 } }); // => 5 днів | ||
await i18n.t('test.day_interval', { args: { count: 1.5 } }); // => 1.5 дня | ||
``` |
{ | ||
"name": "nestjs-i18n", | ||
"version": "9.1.10", | ||
"version": "9.2.0", | ||
"homepage": "https://nestjs-i18n.com", | ||
@@ -15,3 +15,3 @@ "description": "The i18n module for Nest.", | ||
"scripts": { | ||
"prepare":"npm run build", | ||
"prepare": "npm run build", | ||
"build": "npm run build:lib", | ||
@@ -48,10 +48,10 @@ "build:lib": "npx rimraf dist && tsc -p tsconfig.build.json", | ||
"@mdx-js/react": "^1.6.22", | ||
"@nestjs/apollo": "^10.0.16", | ||
"@nestjs/common": "^8.4.7", | ||
"@nestjs/core": "^8.4.7", | ||
"@nestjs/graphql": "^10.0.16", | ||
"@nestjs/microservices": "^8.4.7", | ||
"@nestjs/platform-express": "^8.4.7", | ||
"@nestjs/platform-fastify": "^8.4.7", | ||
"@nestjs/testing": "^8.4.7", | ||
"@nestjs/apollo": "^10.1.0", | ||
"@nestjs/common": "^9.0.11", | ||
"@nestjs/core": "^9.0.11", | ||
"@nestjs/graphql": "^10.1.1", | ||
"@nestjs/microservices": "^9.0.11", | ||
"@nestjs/platform-express": "^9.0.11", | ||
"@nestjs/platform-fastify": "^9.0.11", | ||
"@nestjs/testing": "^9.0.11", | ||
"@tsconfig/docusaurus": "^1.0.6", | ||
@@ -86,6 +86,8 @@ "@types/accept-language-parser": "^1.5.3", | ||
"pug": "^3.0.2", | ||
"reflect-metadata": "^0.1.13", | ||
"subscriptions-transport-ws": "^0.9.0", | ||
"supertest": "^6.2.3", | ||
"ts-jest": "^28.0.5", | ||
"ts-morph": "^15.1.0" | ||
"ts-morph": "^15.1.0", | ||
"typescript": "^4.8.3" | ||
}, | ||
@@ -92,0 +94,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2166907
299
7104
50
2
80