@intlayer/docs 5.8.1 → 6.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/ar/rag_powered_documentation_assistant.md +282 -0
- package/blog/de/rag_powered_documentation_assistant.md +282 -0
- package/blog/en/rag_powered_documentation_assistant.md +289 -0
- package/blog/en-GB/rag_powered_documentation_assistant.md +284 -0
- package/blog/es/rag_powered_documentation_assistant.md +308 -0
- package/blog/fr/rag_powered_documentation_assistant.md +308 -0
- package/blog/hi/rag_powered_documentation_assistant.md +284 -0
- package/blog/it/rag_powered_documentation_assistant.md +284 -0
- package/blog/ja/rag_powered_documentation_assistant.md +284 -0
- package/blog/ko/rag_powered_documentation_assistant.md +283 -0
- package/blog/pt/rag_powered_documentation_assistant.md +284 -0
- package/blog/ru/rag_powered_documentation_assistant.md +284 -0
- package/blog/tr/index.md +69 -0
- package/blog/tr/internationalization_and_SEO.md +273 -0
- package/blog/tr/intlayer_with_i18next.md +162 -0
- package/blog/tr/intlayer_with_next-i18next.md +367 -0
- package/blog/tr/intlayer_with_next-intl.md +392 -0
- package/blog/tr/intlayer_with_react-i18next.md +346 -0
- package/blog/tr/intlayer_with_react-intl.md +345 -0
- package/blog/tr/list_i18n_technologies/CMS/drupal.md +143 -0
- package/blog/tr/list_i18n_technologies/CMS/wix.md +167 -0
- package/blog/tr/list_i18n_technologies/CMS/wordpress.md +188 -0
- package/blog/tr/list_i18n_technologies/frameworks/angular.md +125 -0
- package/blog/tr/list_i18n_technologies/frameworks/flutter.md +150 -0
- package/blog/tr/list_i18n_technologies/frameworks/react-native.md +217 -0
- package/blog/tr/list_i18n_technologies/frameworks/react.md +155 -0
- package/blog/tr/list_i18n_technologies/frameworks/svelte.md +129 -0
- package/blog/tr/list_i18n_technologies/frameworks/vue.md +130 -0
- package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +170 -0
- package/blog/tr/rag_powered_documentation_assistant.md +284 -0
- package/blog/tr/react-i18next_vs_react-intl_vs_intlayer.md +162 -0
- package/blog/tr/vue-i18n_vs_intlayer.md +276 -0
- package/blog/tr/what_is_internationalization.md +166 -0
- package/blog/zh/rag_powered_documentation_assistant.md +284 -0
- package/dist/cjs/generated/blog.entry.cjs +212 -0
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +660 -132
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +84 -0
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +6 -0
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +212 -0
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +660 -132
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +84 -0
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +6 -0
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts +1 -0
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +5 -2
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
- package/dist/types/generated/legal.entry.d.ts.map +1 -1
- package/docs/ar/autoFill.md +41 -40
- package/docs/ar/configuration.md +202 -199
- package/docs/ar/dictionary/content_file.md +1059 -0
- package/docs/ar/intlayer_CMS.md +4 -4
- package/docs/ar/intlayer_with_nestjs.md +271 -0
- package/docs/ar/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/ar/intlayer_with_react_router_v7.md +533 -0
- package/docs/ar/intlayer_with_tanstack.md +465 -299
- package/docs/ar/intlayer_with_vite+preact.md +7 -7
- package/docs/ar/intlayer_with_vite+react.md +7 -7
- package/docs/ar/intlayer_with_vite+vue.md +9 -9
- package/docs/ar/packages/vite-intlayer/index.md +3 -3
- package/docs/ar/readme.md +261 -0
- package/docs/ar/testing.md +199 -0
- package/docs/de/autoFill.md +42 -19
- package/docs/de/configuration.md +155 -147
- package/docs/de/dictionary/content_file.md +1059 -0
- package/docs/de/intlayer_CMS.md +4 -5
- package/docs/de/intlayer_with_nestjs.md +270 -0
- package/docs/de/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/de/intlayer_with_react_router_v7.md +537 -0
- package/docs/de/intlayer_with_tanstack.md +469 -302
- package/docs/de/intlayer_with_vite+preact.md +7 -7
- package/docs/de/intlayer_with_vite+react.md +7 -7
- package/docs/de/intlayer_with_vite+vue.md +9 -9
- package/docs/de/packages/vite-intlayer/index.md +3 -3
- package/docs/de/readme.md +261 -0
- package/docs/de/testing.md +200 -0
- package/docs/en/CI_CD.md +4 -6
- package/docs/en/autoFill.md +25 -5
- package/docs/en/configuration.md +45 -54
- package/docs/en/dictionary/content_file.md +1054 -0
- package/docs/en/intlayer_CMS.md +8 -7
- package/docs/en/intlayer_cli.md +112 -5
- package/docs/en/intlayer_with_nestjs.md +268 -0
- package/docs/en/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/en/intlayer_with_react_router_v7.md +531 -0
- package/docs/en/intlayer_with_tanstack.md +463 -294
- package/docs/en/intlayer_with_vite+preact.md +8 -8
- package/docs/en/intlayer_with_vite+react.md +8 -8
- package/docs/en/intlayer_with_vite+vue.md +8 -8
- package/docs/en/packages/intlayer/getLocalizedUrl.md +102 -25
- package/docs/en/packages/vite-intlayer/index.md +3 -3
- package/docs/en/readme.md +261 -0
- package/docs/en/testing.md +200 -0
- package/docs/en-GB/autoFill.md +29 -6
- package/docs/en-GB/configuration.md +79 -71
- package/docs/en-GB/dictionary/content_file.md +1084 -0
- package/docs/en-GB/intlayer_CMS.md +4 -5
- package/docs/en-GB/intlayer_with_nestjs.md +268 -0
- package/docs/en-GB/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/en-GB/intlayer_with_react_router_v7.md +533 -0
- package/docs/en-GB/intlayer_with_tanstack.md +466 -299
- package/docs/en-GB/intlayer_with_vite+preact.md +7 -7
- package/docs/en-GB/intlayer_with_vite+react.md +7 -7
- package/docs/en-GB/intlayer_with_vite+vue.md +9 -9
- package/docs/en-GB/packages/vite-intlayer/index.md +3 -3
- package/docs/en-GB/readme.md +261 -0
- package/docs/en-GB/testing.md +200 -0
- package/docs/es/autoFill.md +45 -23
- package/docs/es/configuration.md +171 -167
- package/docs/es/dictionary/content_file.md +1088 -0
- package/docs/es/intlayer_CMS.md +4 -5
- package/docs/es/intlayer_with_nestjs.md +268 -0
- package/docs/es/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/es/intlayer_with_react_router_v7.md +533 -0
- package/docs/es/intlayer_with_tanstack.md +469 -280
- package/docs/es/intlayer_with_vite+preact.md +7 -7
- package/docs/es/intlayer_with_vite+react.md +7 -7
- package/docs/es/intlayer_with_vite+vue.md +9 -9
- package/docs/es/packages/vite-intlayer/index.md +3 -3
- package/docs/es/readme.md +261 -0
- package/docs/es/testing.md +200 -0
- package/docs/fr/autoFill.md +47 -24
- package/docs/fr/configuration.md +213 -198
- package/docs/fr/dictionary/content_file.md +1054 -0
- package/docs/fr/intlayer_CMS.md +4 -5
- package/docs/fr/intlayer_with_nestjs.md +268 -0
- package/docs/fr/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/fr/intlayer_with_react_router_v7.md +549 -0
- package/docs/fr/intlayer_with_tanstack.md +465 -279
- package/docs/fr/intlayer_with_vite+preact.md +7 -7
- package/docs/fr/intlayer_with_vite+react.md +7 -7
- package/docs/fr/intlayer_with_vite+vue.md +9 -9
- package/docs/fr/packages/vite-intlayer/index.md +3 -3
- package/docs/fr/readme.md +261 -0
- package/docs/fr/testing.md +200 -0
- package/docs/hi/autoFill.md +47 -25
- package/docs/hi/configuration.md +194 -189
- package/docs/hi/dictionary/content_file.md +1056 -0
- package/docs/hi/intlayer_CMS.md +4 -5
- package/docs/hi/intlayer_with_nestjs.md +269 -0
- package/docs/hi/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/hi/intlayer_with_react_router_v7.md +533 -0
- package/docs/hi/intlayer_with_tanstack.md +467 -282
- package/docs/hi/intlayer_with_vite+preact.md +7 -7
- package/docs/hi/intlayer_with_vite+react.md +7 -7
- package/docs/hi/intlayer_with_vite+vue.md +9 -9
- package/docs/hi/packages/vite-intlayer/index.md +3 -3
- package/docs/hi/readme.md +261 -0
- package/docs/hi/testing.md +200 -0
- package/docs/it/autoFill.md +46 -24
- package/docs/it/configuration.md +169 -161
- package/docs/it/dictionary/content_file.md +1061 -0
- package/docs/it/intlayer_CMS.md +4 -5
- package/docs/it/intlayer_with_nestjs.md +268 -0
- package/docs/it/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/it/intlayer_with_react_router_v7.md +535 -0
- package/docs/it/intlayer_with_tanstack.md +467 -301
- package/docs/it/intlayer_with_vite+preact.md +7 -7
- package/docs/it/intlayer_with_vite+react.md +7 -7
- package/docs/it/intlayer_with_vite+vue.md +9 -9
- package/docs/it/packages/vite-intlayer/index.md +3 -3
- package/docs/it/readme.md +261 -0
- package/docs/it/testing.md +200 -0
- package/docs/ja/autoFill.md +45 -23
- package/docs/ja/configuration.md +243 -204
- package/docs/ja/dictionary/content_file.md +1064 -0
- package/docs/ja/intlayer_CMS.md +4 -5
- package/docs/ja/intlayer_with_nestjs.md +268 -0
- package/docs/ja/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/ja/intlayer_with_react_router_v7.md +534 -0
- package/docs/ja/intlayer_with_tanstack.md +467 -303
- package/docs/ja/intlayer_with_vite+preact.md +7 -7
- package/docs/ja/intlayer_with_vite+react.md +7 -7
- package/docs/ja/intlayer_with_vite+vue.md +9 -9
- package/docs/ja/packages/vite-intlayer/index.md +3 -3
- package/docs/ja/readme.md +263 -0
- package/docs/ja/testing.md +200 -0
- package/docs/ko/autoFill.md +39 -16
- package/docs/ko/configuration.md +217 -197
- package/docs/ko/dictionary/content_file.md +1060 -0
- package/docs/ko/intlayer_CMS.md +4 -5
- package/docs/ko/intlayer_with_nestjs.md +268 -0
- package/docs/ko/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/ko/intlayer_with_react_router_v7.md +540 -0
- package/docs/ko/intlayer_with_tanstack.md +466 -302
- package/docs/ko/intlayer_with_vite+preact.md +7 -7
- package/docs/ko/intlayer_with_vite+react.md +7 -7
- package/docs/ko/intlayer_with_vite+vue.md +9 -9
- package/docs/ko/packages/vite-intlayer/index.md +3 -3
- package/docs/ko/readme.md +261 -0
- package/docs/ko/testing.md +200 -0
- package/docs/pt/autoFill.md +39 -15
- package/docs/pt/configuration.md +165 -147
- package/docs/pt/dictionary/content_file.md +1062 -0
- package/docs/pt/intlayer_CMS.md +4 -5
- package/docs/pt/intlayer_with_nestjs.md +271 -0
- package/docs/pt/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/pt/intlayer_with_react_router_v7.md +535 -0
- package/docs/pt/intlayer_with_tanstack.md +469 -300
- package/docs/pt/intlayer_with_vite+preact.md +7 -7
- package/docs/pt/intlayer_with_vite+react.md +7 -7
- package/docs/pt/intlayer_with_vite+vue.md +9 -9
- package/docs/pt/packages/vite-intlayer/index.md +3 -3
- package/docs/pt/readme.md +261 -0
- package/docs/pt/testing.md +200 -0
- package/docs/ru/autoFill.md +52 -30
- package/docs/ru/configuration.md +164 -117
- package/docs/ru/dictionary/content_file.md +1064 -0
- package/docs/ru/intlayer_CMS.md +4 -4
- package/docs/ru/intlayer_with_nestjs.md +270 -0
- package/docs/ru/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/ru/intlayer_with_react_router_v7.md +534 -0
- package/docs/ru/intlayer_with_tanstack.md +470 -305
- package/docs/ru/intlayer_with_vite+preact.md +7 -7
- package/docs/ru/intlayer_with_vite+react.md +7 -7
- package/docs/ru/intlayer_with_vite+vue.md +9 -9
- package/docs/ru/packages/vite-intlayer/index.md +3 -3
- package/docs/ru/readme.md +261 -0
- package/docs/ru/testing.md +202 -0
- package/docs/tr/CI_CD.md +198 -0
- package/docs/tr/autoFill.md +201 -0
- package/docs/tr/configuration.md +585 -0
- package/docs/tr/dictionary/condition.md +243 -0
- package/docs/tr/dictionary/content_file.md +1055 -0
- package/docs/tr/dictionary/enumeration.md +251 -0
- package/docs/tr/dictionary/file.md +228 -0
- package/docs/tr/dictionary/function_fetching.md +218 -0
- package/docs/tr/dictionary/gender.md +279 -0
- package/docs/tr/dictionary/insertion.md +191 -0
- package/docs/tr/dictionary/markdown.md +385 -0
- package/docs/tr/dictionary/nesting.md +279 -0
- package/docs/tr/dictionary/translation.md +315 -0
- package/docs/tr/formatters.md +618 -0
- package/docs/tr/how_works_intlayer.md +254 -0
- package/docs/tr/index.md +168 -0
- package/docs/tr/interest_of_intlayer.md +288 -0
- package/docs/tr/intlayer_CMS.md +347 -0
- package/docs/tr/intlayer_cli.md +570 -0
- package/docs/tr/intlayer_visual_editor.md +269 -0
- package/docs/tr/intlayer_with_angular.md +694 -0
- package/docs/tr/intlayer_with_create_react_app.md +1218 -0
- package/docs/tr/intlayer_with_express.md +415 -0
- package/docs/tr/intlayer_with_lynx+react.md +511 -0
- package/docs/tr/intlayer_with_nestjs.md +268 -0
- package/docs/tr/intlayer_with_nextjs_14.md +1029 -0
- package/docs/tr/intlayer_with_nextjs_15.md +1506 -0
- package/docs/tr/intlayer_with_nextjs_page_router.md +1484 -0
- package/docs/tr/intlayer_with_nuxt.md +773 -0
- package/docs/tr/intlayer_with_react_native+expo.md +660 -0
- package/docs/tr/intlayer_with_react_router_v7.md +531 -0
- package/docs/tr/intlayer_with_tanstack.md +452 -0
- package/docs/tr/intlayer_with_vite+preact.md +1673 -0
- package/docs/tr/intlayer_with_vite+react.md +1632 -0
- package/docs/tr/intlayer_with_vite+solid.md +288 -0
- package/docs/tr/intlayer_with_vite+svelte.md +288 -0
- package/docs/tr/intlayer_with_vite+vue.md +1042 -0
- package/docs/tr/introduction.md +209 -0
- package/docs/tr/locale_mapper.md +244 -0
- package/docs/tr/mcp_server.md +207 -0
- package/docs/tr/packages/@intlayer/api/index.md +58 -0
- package/docs/tr/packages/@intlayer/chokidar/index.md +57 -0
- package/docs/tr/packages/@intlayer/cli/index.md +47 -0
- package/docs/tr/packages/@intlayer/config/index.md +142 -0
- package/docs/tr/packages/@intlayer/core/index.md +51 -0
- package/docs/tr/packages/@intlayer/design-system/index.md +47 -0
- package/docs/tr/packages/@intlayer/dictionary-entry/index.md +53 -0
- package/docs/tr/packages/@intlayer/editor/index.md +47 -0
- package/docs/tr/packages/@intlayer/editor-react/index.md +47 -0
- package/docs/tr/packages/@intlayer/webpack/index.md +61 -0
- package/docs/tr/packages/angular-intlayer/index.md +59 -0
- package/docs/tr/packages/express-intlayer/index.md +258 -0
- package/docs/tr/packages/express-intlayer/t.md +459 -0
- package/docs/tr/packages/intlayer/getConfiguration.md +151 -0
- package/docs/tr/packages/intlayer/getEnumeration.md +165 -0
- package/docs/tr/packages/intlayer/getHTMLTextDir.md +127 -0
- package/docs/tr/packages/intlayer/getLocaleLang.md +87 -0
- package/docs/tr/packages/intlayer/getLocaleName.md +124 -0
- package/docs/tr/packages/intlayer/getLocalizedUrl.md +324 -0
- package/docs/tr/packages/intlayer/getMultilingualUrls.md +225 -0
- package/docs/tr/packages/intlayer/getPathWithoutLocale.md +81 -0
- package/docs/tr/packages/intlayer/getTranslation.md +196 -0
- package/docs/tr/packages/intlayer/getTranslationContent.md +195 -0
- package/docs/tr/packages/intlayer/index.md +505 -0
- package/docs/tr/packages/intlayer-cli/index.md +71 -0
- package/docs/tr/packages/intlayer-editor/index.md +139 -0
- package/docs/tr/packages/lynx-intlayer/index.md +85 -0
- package/docs/tr/packages/next-intlayer/index.md +154 -0
- package/docs/tr/packages/next-intlayer/t.md +354 -0
- package/docs/tr/packages/next-intlayer/useDictionary.md +270 -0
- package/docs/tr/packages/next-intlayer/useIntlayer.md +265 -0
- package/docs/tr/packages/next-intlayer/useLocale.md +133 -0
- package/docs/tr/packages/nuxt-intlayer/index.md +59 -0
- package/docs/tr/packages/preact-intlayer/index.md +55 -0
- package/docs/tr/packages/react-intlayer/index.md +148 -0
- package/docs/tr/packages/react-intlayer/t.md +304 -0
- package/docs/tr/packages/react-intlayer/useDictionary.md +554 -0
- package/docs/tr/packages/react-intlayer/useI18n.md +478 -0
- package/docs/tr/packages/react-intlayer/useIntlayer.md +253 -0
- package/docs/tr/packages/react-intlayer/useLocale.md +212 -0
- package/docs/tr/packages/react-native-intlayer/index.md +85 -0
- package/docs/tr/packages/react-scripts-intlayer/index.md +82 -0
- package/docs/tr/packages/solid-intlayer/index.md +56 -0
- package/docs/tr/packages/svelte-intlayer/index.md +55 -0
- package/docs/tr/packages/vite-intlayer/index.md +82 -0
- package/docs/tr/packages/vue-intlayer/index.md +59 -0
- package/docs/tr/per_locale_file.md +321 -0
- package/docs/tr/readme.md +261 -0
- package/docs/tr/roadmap.md +338 -0
- package/docs/tr/testing.md +200 -0
- package/docs/tr/vs_code_extension.md +154 -0
- package/docs/zh/autoFill.md +40 -18
- package/docs/zh/configuration.md +245 -226
- package/docs/zh/dictionary/content_file.md +1064 -0
- package/docs/zh/intlayer_CMS.md +4 -5
- package/docs/zh/intlayer_with_nestjs.md +268 -0
- package/docs/zh/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/zh/intlayer_with_react_router_v7.md +535 -0
- package/docs/zh/intlayer_with_tanstack.md +468 -278
- package/docs/zh/intlayer_with_vite+preact.md +7 -7
- package/docs/zh/intlayer_with_vite+react.md +7 -7
- package/docs/zh/intlayer_with_vite+vue.md +7 -7
- package/docs/zh/packages/vite-intlayer/index.md +3 -3
- package/docs/zh/readme.md +261 -0
- package/docs/zh/testing.md +198 -0
- package/frequent_questions/tr/SSR_Next_no_[locale].md +105 -0
- package/frequent_questions/tr/array_as_content_declaration.md +72 -0
- package/frequent_questions/tr/build_dictionaries.md +59 -0
- package/frequent_questions/tr/build_error_CI_CD.md +75 -0
- package/frequent_questions/tr/customized_locale_list.md +65 -0
- package/frequent_questions/tr/domain_routing.md +114 -0
- package/frequent_questions/tr/esbuild_error.md +30 -0
- package/frequent_questions/tr/get_locale_cookie.md +142 -0
- package/frequent_questions/tr/intlayer_command_undefined.md +156 -0
- package/frequent_questions/tr/locale_incorect_in_url.md +74 -0
- package/frequent_questions/tr/static_rendering.md +45 -0
- package/frequent_questions/tr/translated_path_url.md +56 -0
- package/frequent_questions/tr/unknown_command.md +98 -0
- package/legal/tr/privacy_notice.md +83 -0
- package/legal/tr/terms_of_service.md +55 -0
- package/package.json +12 -12
- package/src/generated/blog.entry.ts +212 -0
- package/src/generated/docs.entry.ts +663 -135
- package/src/generated/frequentQuestions.entry.ts +85 -1
- package/src/generated/legal.entry.ts +7 -1
- package/docs/ar/dictionary/content_extention_customization.md +0 -100
- package/docs/ar/dictionary/get_started.md +0 -527
- package/docs/de/dictionary/content_extention_customization.md +0 -100
- package/docs/de/dictionary/get_started.md +0 -531
- package/docs/en/dictionary/content_extention_customization.md +0 -102
- package/docs/en/dictionary/get_started.md +0 -529
- package/docs/en-GB/dictionary/content_extention_customization.md +0 -100
- package/docs/en-GB/dictionary/get_started.md +0 -591
- package/docs/es/dictionary/content_extention_customization.md +0 -100
- package/docs/es/dictionary/get_started.md +0 -527
- package/docs/fr/dictionary/content_extention_customization.md +0 -100
- package/docs/fr/dictionary/get_started.md +0 -527
- package/docs/hi/dictionary/content_extention_customization.md +0 -100
- package/docs/hi/dictionary/get_started.md +0 -527
- package/docs/it/dictionary/content_extention_customization.md +0 -113
- package/docs/it/dictionary/get_started.md +0 -573
- package/docs/ja/dictionary/content_extention_customization.md +0 -113
- package/docs/ja/dictionary/get_started.md +0 -576
- package/docs/ko/dictionary/content_extention_customization.md +0 -100
- package/docs/ko/dictionary/get_started.md +0 -530
- package/docs/pt/dictionary/content_extention_customization.md +0 -100
- package/docs/pt/dictionary/get_started.md +0 -532
- package/docs/ru/dictionary/content_extention_customization.md +0 -100
- package/docs/ru/dictionary/get_started.md +0 -575
- package/docs/zh/dictionary/content_extention_customization.md +0 -117
- package/docs/zh/dictionary/get_started.md +0 -533
|
@@ -0,0 +1,1062 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-02-07
|
|
3
|
+
updatedAt: 2025-09-20
|
|
4
|
+
title: Arquivo de Conteúdo
|
|
5
|
+
description: Aprenda como personalizar as extensões para seus arquivos de declaração de conteúdo. Siga esta documentação para implementar condições de forma eficiente em seu projeto.
|
|
6
|
+
keywords:
|
|
7
|
+
- Arquivo de Conteúdo
|
|
8
|
+
- Documentação
|
|
9
|
+
- Intlayer
|
|
10
|
+
slugs:
|
|
11
|
+
- doc
|
|
12
|
+
- concept
|
|
13
|
+
- content
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Arquivo de Conteúdo
|
|
17
|
+
|
|
18
|
+
<iframe title="i18n, Markdown, JSON… uma única solução para gerenciar tudo | Intlayer" class="m-auto aspect-[16/9] w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/1VHgSY_j9_I?autoplay=0&origin=http://intlayer.org&controls=0&rel=1"/>
|
|
19
|
+
|
|
20
|
+
## O que é um Arquivo de Conteúdo?
|
|
21
|
+
|
|
22
|
+
Um arquivo de conteúdo no Intlayer é um arquivo que contém definições de dicionário.
|
|
23
|
+
Esses arquivos declaram o conteúdo de texto da sua aplicação, traduções e recursos.
|
|
24
|
+
Os arquivos de conteúdo são processados pelo Intlayer para gerar dicionários.
|
|
25
|
+
|
|
26
|
+
Os dicionários serão o resultado final que sua aplicação importará usando o hook `useIntlayer`.
|
|
27
|
+
|
|
28
|
+
### Conceitos Chave
|
|
29
|
+
|
|
30
|
+
#### Dicionário
|
|
31
|
+
|
|
32
|
+
Um dicionário é uma coleção estruturada de conteúdo organizada por chaves. Cada dicionário contém:
|
|
33
|
+
|
|
34
|
+
- **Chave**: Um identificador único para o dicionário
|
|
35
|
+
- **Conteúdo**: Os valores reais do conteúdo (texto, números, objetos, etc.)
|
|
36
|
+
- **Metadados**: Informações adicionais como título, descrição, tags, etc.
|
|
37
|
+
|
|
38
|
+
#### Arquivo de Conteúdo
|
|
39
|
+
|
|
40
|
+
Exemplo de arquivo de conteúdo:
|
|
41
|
+
|
|
42
|
+
```tsx fileName="src/example.content.tsx" contentDeclarationFormat="typescript"
|
|
43
|
+
import { type ReactNode } from "react";
|
|
44
|
+
import {
|
|
45
|
+
t,
|
|
46
|
+
enu,
|
|
47
|
+
cond,
|
|
48
|
+
nest,
|
|
49
|
+
md,
|
|
50
|
+
insert,
|
|
51
|
+
file,
|
|
52
|
+
type Dictionary,
|
|
53
|
+
} from "intlayer";
|
|
54
|
+
|
|
55
|
+
interface Content {
|
|
56
|
+
imbricatedContent: {
|
|
57
|
+
imbricatedContent2: {
|
|
58
|
+
stringContent: string;
|
|
59
|
+
numberContent: number;
|
|
60
|
+
booleanContent: boolean;
|
|
61
|
+
javaScriptContent: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
multilingualContent: string;
|
|
65
|
+
quantityContent: string;
|
|
66
|
+
conditionalContent: string;
|
|
67
|
+
markdownContent: never;
|
|
68
|
+
externalContent: string;
|
|
69
|
+
insertionContent: string;
|
|
70
|
+
nestedContent: string;
|
|
71
|
+
fileContent: string;
|
|
72
|
+
jsxContent: ReactNode;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default {
|
|
76
|
+
key: "page",
|
|
77
|
+
content: {
|
|
78
|
+
imbricatedContent: {
|
|
79
|
+
imbricatedContent2: {
|
|
80
|
+
stringContent: "Olá Mundo",
|
|
81
|
+
numberContent: 123,
|
|
82
|
+
booleanContent: true,
|
|
83
|
+
javaScriptContent: `${process.env.NODE_ENV}`,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
multilingualContent: t({
|
|
87
|
+
pt: "Conteúdo em português",
|
|
88
|
+
en: "English content",
|
|
89
|
+
"en-GB": "English content (UK)",
|
|
90
|
+
fr: "French content",
|
|
91
|
+
es: "Spanish content",
|
|
92
|
+
}),
|
|
93
|
+
quantityContent: enu({
|
|
94
|
+
"<-1": "Menos de menos um carro",
|
|
95
|
+
"-1": "Menos um carro",
|
|
96
|
+
"0": "Nenhum carro",
|
|
97
|
+
"1": "Um carro",
|
|
98
|
+
">5": "Alguns carros",
|
|
99
|
+
">19": "Muitos carros",
|
|
100
|
+
}),
|
|
101
|
+
conditionalContent: cond({
|
|
102
|
+
true: "Validação está ativada",
|
|
103
|
+
false: "Validação está desativada",
|
|
104
|
+
}),
|
|
105
|
+
insertionContent: insert("Olá {{name}}!"),
|
|
106
|
+
nestedContent: nest(
|
|
107
|
+
"navbar", // A chave do dicionário para aninhar
|
|
108
|
+
"login.button" // [Opcional] O caminho para o conteúdo a ser aninhado
|
|
109
|
+
),
|
|
110
|
+
fileContent: file("./path/to/file.txt"),
|
|
111
|
+
externalContent: fetch("https://example.com").then((res) => res.json()),
|
|
112
|
+
markdownContent: md("# Exemplo de Markdown"),
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Disponível apenas usando `react-intlayer` ou `next-intlayer`
|
|
116
|
+
*/
|
|
117
|
+
jsxContent: <h1>Meu título</h1>,
|
|
118
|
+
},
|
|
119
|
+
} satisfies Dictionary<Content>; // [opcional] Dictionary é genérico e permite reforçar a formatação do seu dicionário
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```javascript fileName="src/example.content.mjx" contentDeclarationFormat="esm"
|
|
123
|
+
import { t, enu, cond, nest, md, insert, file } from "intlayer";
|
|
124
|
+
|
|
125
|
+
/** @type {import('intlayer').Dictionary} */
|
|
126
|
+
export default {
|
|
127
|
+
key: "page",
|
|
128
|
+
content: {
|
|
129
|
+
imbricatedContent: {
|
|
130
|
+
imbricatedContent2: {
|
|
131
|
+
stringContent: "Hello World",
|
|
132
|
+
numberContent: 123,
|
|
133
|
+
booleanContent: true,
|
|
134
|
+
javaScriptContent: `${process.env.NODE_ENV}`,
|
|
135
|
+
},
|
|
136
|
+
imbricatedArray: [1, 2, 3],
|
|
137
|
+
},
|
|
138
|
+
multilingualContent: t({
|
|
139
|
+
pt: "Conteúdo em português",
|
|
140
|
+
en: "English content",
|
|
141
|
+
"en-GB": "English content (UK)",
|
|
142
|
+
fr: "French content",
|
|
143
|
+
es: "Spanish content",
|
|
144
|
+
}),
|
|
145
|
+
quantityContent: enu({
|
|
146
|
+
"<-1": "Menos que menos um carro",
|
|
147
|
+
"-1": "Menos um carro",
|
|
148
|
+
"0": "Nenhum carro",
|
|
149
|
+
"1": "Um carro",
|
|
150
|
+
">5": "Alguns carros",
|
|
151
|
+
">19": "Muitos carros",
|
|
152
|
+
}),
|
|
153
|
+
conditionalContent: cond({
|
|
154
|
+
true: "Validação está ativada",
|
|
155
|
+
false: "Validação está desativada",
|
|
156
|
+
}),
|
|
157
|
+
insertionContent: insert("Olá {{name}}!"),
|
|
158
|
+
nestedContent: nest(
|
|
159
|
+
"navbar", // A chave do dicionário para aninhar
|
|
160
|
+
"login.button" // [Opcional] O caminho para o conteúdo a ser aninhado
|
|
161
|
+
),
|
|
162
|
+
markdownContent: md("# Exemplo de Markdown"),
|
|
163
|
+
fileContent: file("./path/to/file.txt"),
|
|
164
|
+
externalContent: fetch("https://example.com").then((res) => res.json())
|
|
165
|
+
|
|
166
|
+
// Disponível apenas usando `react-intlayer` ou `next-intlayer`
|
|
167
|
+
jsxContent: <h1>Meu título</h1>,
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```javascript fileName="src/example.content.cjx" contentDeclarationFormat="commonjs"
|
|
173
|
+
const { t, enu, cond, nest, md, insert, file } = require("intlayer");
|
|
174
|
+
|
|
175
|
+
/** @type {import('intlayer').Dictionary} */
|
|
176
|
+
module.exports = {
|
|
177
|
+
key: "page",
|
|
178
|
+
content: {
|
|
179
|
+
imbricatedContent: {
|
|
180
|
+
imbricatedContent2: {
|
|
181
|
+
stringContent: "Hello World",
|
|
182
|
+
numberContent: 123,
|
|
183
|
+
booleanContent: true,
|
|
184
|
+
javaScriptContent: `${process.env.NODE_ENV}`,
|
|
185
|
+
},
|
|
186
|
+
imbricatedArray: [1, 2, 3],
|
|
187
|
+
},
|
|
188
|
+
multilingualContent: t({
|
|
189
|
+
pt: "Conteúdo em português",
|
|
190
|
+
en: "English content",
|
|
191
|
+
"en-GB": "English content (UK)",
|
|
192
|
+
fr: "French content",
|
|
193
|
+
es: "Spanish content",
|
|
194
|
+
}),
|
|
195
|
+
quantityContent: enu({
|
|
196
|
+
"<-1": "Menos que menos um carro",
|
|
197
|
+
"-1": "Menos um carro",
|
|
198
|
+
"0": "Nenhum carro",
|
|
199
|
+
"1": "Um carro",
|
|
200
|
+
">5": "Alguns carros",
|
|
201
|
+
">19": "Muitos carros",
|
|
202
|
+
}),
|
|
203
|
+
conditionalContent: cond({
|
|
204
|
+
true: "Validação está ativada",
|
|
205
|
+
false: "Validação está desativada",
|
|
206
|
+
}),
|
|
207
|
+
insertionContent: insert("Olá {{name}}!"),
|
|
208
|
+
nestedContent: nest(
|
|
209
|
+
"navbar", // A chave do dicionário para aninhar
|
|
210
|
+
"login.button" // [Opcional] O caminho para o conteúdo a ser aninhado
|
|
211
|
+
),
|
|
212
|
+
markdownContent: md("# Exemplo de Markdown"),
|
|
213
|
+
fileContent: file("./path/to/file.txt"),
|
|
214
|
+
externalContent: fetch("https://example.com").then((res) => res.json())
|
|
215
|
+
|
|
216
|
+
// Disponível apenas usando `react-intlayer` ou `next-intlayer`
|
|
217
|
+
jsxContent: <h1>Meu título</h1>,
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
```json5 fileName="src/example.content.json" contentDeclarationFormat="json"
|
|
223
|
+
{
|
|
224
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
225
|
+
"key": "page",
|
|
226
|
+
"content": {
|
|
227
|
+
"imbricatedContent": {
|
|
228
|
+
"imbricatedContent2": {
|
|
229
|
+
"stringContent": "Olá Mundo",
|
|
230
|
+
"numberContent": 123,
|
|
231
|
+
"booleanContent": true,
|
|
232
|
+
},
|
|
233
|
+
"imbricatedArray": [1, 2, 3],
|
|
234
|
+
},
|
|
235
|
+
"multilingualContent": {
|
|
236
|
+
"nodeType": "translation",
|
|
237
|
+
"translation": {
|
|
238
|
+
"en": "English content",
|
|
239
|
+
"en-GB": "English content (UK)",
|
|
240
|
+
"fr": "French content",
|
|
241
|
+
"es": "Spanish content",
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
"quantityContent": {
|
|
245
|
+
"nodeType": "enumeration",
|
|
246
|
+
"enumeration": {
|
|
247
|
+
"0": "Sem carros",
|
|
248
|
+
"1": "Um carro",
|
|
249
|
+
"<-1": "Menos que menos um carro",
|
|
250
|
+
"-1": "Menos um carro",
|
|
251
|
+
">5": "Alguns carros",
|
|
252
|
+
">19": "Muitos carros",
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
"conditionalContent": {
|
|
256
|
+
"nodeType": "condition",
|
|
257
|
+
"condition": {
|
|
258
|
+
"true": "Validação está ativada",
|
|
259
|
+
"false": "Validação está desativada",
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
"insertionContent": {
|
|
263
|
+
"nodeType": "insertion",
|
|
264
|
+
"insertion": "Olá {{name}}!",
|
|
265
|
+
},
|
|
266
|
+
"nestedContent": {
|
|
267
|
+
"nodeType": "nested",
|
|
268
|
+
"nested": { "dictionaryKey": "app" },
|
|
269
|
+
},
|
|
270
|
+
"markdownContent": {
|
|
271
|
+
"nodeType": "markdown",
|
|
272
|
+
"markdown": "# Exemplo de Markdown",
|
|
273
|
+
},
|
|
274
|
+
"fileContent": {
|
|
275
|
+
"nodeType": "file",
|
|
276
|
+
"file": "./path/to/file.txt",
|
|
277
|
+
},
|
|
278
|
+
"jsxContent": {
|
|
279
|
+
"type": "h1",
|
|
280
|
+
"key": null,
|
|
281
|
+
"ref": null,
|
|
282
|
+
"props": {
|
|
283
|
+
"children": ["Meu título"],
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
#### Nós de Conteúdo
|
|
291
|
+
|
|
292
|
+
Nós de conteúdo são os blocos de construção do conteúdo do dicionário. Eles podem ser:
|
|
293
|
+
|
|
294
|
+
- **Valores primitivos**: strings, números, booleanos, null, undefined
|
|
295
|
+
- **Nós tipados**: Tipos especiais de conteúdo como traduções, condições, markdown, etc.
|
|
296
|
+
- **Funções**: Conteúdo dinâmico que pode ser avaliado em tempo de execução [veja Busca por Função](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/function_fetching.md)
|
|
297
|
+
- **Conteúdo aninhado**: Referências a outros dicionários
|
|
298
|
+
|
|
299
|
+
#### Tipos de Conteúdo
|
|
300
|
+
|
|
301
|
+
Intlayer suporta vários tipos de conteúdo através de nós tipados:
|
|
302
|
+
|
|
303
|
+
- **Conteúdo de Tradução**: Texto multilíngue com valores específicos por localidade [veja Conteúdo de Tradução](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/translation_content.md)
|
|
304
|
+
- **Conteúdo Condicional**: Conteúdo condicional baseado em expressões booleanas [veja Conteúdo Condicional](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/condition_content.md)
|
|
305
|
+
- **Conteúdo de Enumeração**: Conteúdo que varia com base em valores enumerados [veja Conteúdo de Enumeração](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/enumeration_content.md)
|
|
306
|
+
- **Conteúdo de Inserção**: Conteúdo que pode ser inserido em outro conteúdo [veja Conteúdo de Inserção](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/insertion_content.md)
|
|
307
|
+
- **Conteúdo Markdown**: Conteúdo de texto rico em formato Markdown [veja Conteúdo Markdown](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/markdown_content.md)
|
|
308
|
+
- **Conteúdo Aninhado**: Referências a outros dicionários [veja Conteúdo Aninhado](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/nested_content.md)
|
|
309
|
+
- **Conteúdo de Gênero**: Conteúdo que varia com base no gênero [veja Conteúdo de Gênero](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/gender_content.md)
|
|
310
|
+
- **Conteúdo de Arquivo**: Referências a arquivos externos [veja Conteúdo de Arquivo](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/dictionary/file_content.md)
|
|
311
|
+
|
|
312
|
+
## Estrutura do Dicionário
|
|
313
|
+
|
|
314
|
+
Um dicionário no Intlayer é definido pelo tipo `Dictionary` e contém várias propriedades que controlam seu comportamento:
|
|
315
|
+
|
|
316
|
+
### Propriedades Obrigatórias
|
|
317
|
+
|
|
318
|
+
#### `key` (string)
|
|
319
|
+
|
|
320
|
+
O identificador do dicionário. Se múltiplos dicionários tiverem a mesma chave, o Intlayer irá mesclá-los automaticamente.
|
|
321
|
+
|
|
322
|
+
> Use a convenção de nomenclatura kebab-case (por exemplo, `"about-page-meta"`).
|
|
323
|
+
|
|
324
|
+
#### Content (string | number | boolean | object | array | function)
|
|
325
|
+
|
|
326
|
+
A propriedade `content` contém os dados reais do dicionário e suporta:
|
|
327
|
+
|
|
328
|
+
- **Valores primitivos**: strings, números, booleanos, null, undefined
|
|
329
|
+
- **Nós tipados**: Tipos especiais de conteúdo usando as funções auxiliares do Intlayer
|
|
330
|
+
- **Objetos aninhados**: Estruturas de dados complexas
|
|
331
|
+
- **Arrays**: Coleções de conteúdo
|
|
332
|
+
- **Funções**: Avaliação dinâmica de conteúdo
|
|
333
|
+
|
|
334
|
+
### Propriedades Opcionais
|
|
335
|
+
|
|
336
|
+
#### `title` (string)
|
|
337
|
+
|
|
338
|
+
Título legível para humanos do dicionário que ajuda a identificá-lo em editores e sistemas CMS. Isso é particularmente útil ao gerenciar um grande número de dicionários ou ao trabalhar com interfaces de gerenciamento de conteúdo.
|
|
339
|
+
|
|
340
|
+
**Exemplo:**
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
{
|
|
344
|
+
key: "about-page-meta",
|
|
345
|
+
title: "Metadados da Página Sobre",
|
|
346
|
+
content: { /* ... */ }
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
#### `description` (string)
|
|
351
|
+
|
|
352
|
+
Descrição detalhada que explica o propósito do dicionário, diretrizes de uso e quaisquer considerações especiais. Essa descrição também é usada como contexto para a geração de traduções assistida por IA, tornando-se valiosa para manter a qualidade e consistência das traduções.
|
|
353
|
+
|
|
354
|
+
**Exemplo:**
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
{
|
|
358
|
+
key: "about-page-meta",
|
|
359
|
+
description: [
|
|
360
|
+
"Este dicionário gerencia os metadados da Página Sobre",
|
|
361
|
+
"Considere boas práticas para SEO:",
|
|
362
|
+
"- O título deve ter entre 50 e 60 caracteres",
|
|
363
|
+
"- A descrição deve ter entre 150 e 160 caracteres",
|
|
364
|
+
].join('\n'),
|
|
365
|
+
content: { /* ... */ }
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
#### `tags` (string[])
|
|
370
|
+
|
|
371
|
+
Array de strings para categorizar e organizar dicionários. As tags fornecem contexto adicional e podem ser usadas para filtrar, pesquisar ou organizar dicionários em editores e sistemas CMS.
|
|
372
|
+
|
|
373
|
+
**Exemplo:**
|
|
374
|
+
|
|
375
|
+
```typescript
|
|
376
|
+
{
|
|
377
|
+
key: "about-page-meta",
|
|
378
|
+
tags: ["metadata", "about-page", "seo"],
|
|
379
|
+
content: { /* ... */ }
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
#### `locale` (LocalesValues)
|
|
384
|
+
|
|
385
|
+
Transforma o dicionário em um dicionário por localidade onde cada campo declarado no conteúdo será automaticamente transformado em um nó de tradução. Quando essa propriedade é definida:
|
|
386
|
+
|
|
387
|
+
- O dicionário é tratado como um dicionário de um único idioma
|
|
388
|
+
- Cada campo se torna um nó de tradução para esse idioma específico
|
|
389
|
+
- Você NÃO deve usar nós de tradução (`t()`) no conteúdo ao usar essa propriedade
|
|
390
|
+
- Se estiver ausente, o dicionário será tratado como um dicionário multilíngue
|
|
391
|
+
|
|
392
|
+
> Veja [Declaração de Conteúdo por Idioma no Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/per_locale_file.md) para mais informações.
|
|
393
|
+
|
|
394
|
+
**Exemplo:**
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
// Dicionário por idioma
|
|
398
|
+
{
|
|
399
|
+
"key": "about-page",
|
|
400
|
+
"locale": "en",
|
|
401
|
+
"content": {
|
|
402
|
+
"title": "About Us", // Isto se torna um nó de tradução para 'en'
|
|
403
|
+
"description": "Learn more about our company"
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
#### `autoFill` (AutoFill)
|
|
409
|
+
|
|
410
|
+
Instruções para preenchimento automático do conteúdo do dicionário a partir de fontes externas. Isso pode ser configurado globalmente em `intlayer.config.ts` ou por dicionário. Suporta múltiplos formatos:
|
|
411
|
+
|
|
412
|
+
- **`true`**: Ativa o preenchimento automático para todas as localidades
|
|
413
|
+
- **`string`**: Caminho para um único arquivo ou modelo com variáveis
|
|
414
|
+
- **`object`**: Caminhos de arquivo por localidade
|
|
415
|
+
|
|
416
|
+
**Exemplos:**
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
// Ativa para todas as localidades
|
|
420
|
+
{
|
|
421
|
+
"autoFill": true
|
|
422
|
+
}
|
|
423
|
+
// Arquivo único
|
|
424
|
+
{
|
|
425
|
+
"autoFill": "./translations/aboutPage.content.json"
|
|
426
|
+
}
|
|
427
|
+
// Modelo com variáveis
|
|
428
|
+
{
|
|
429
|
+
"autoFill": "/messages/{{locale}}/{{key}}/{{fileName}}.content.json"
|
|
430
|
+
}
|
|
431
|
+
// Configuração detalhada por localidade
|
|
432
|
+
{
|
|
433
|
+
"autoFill": {
|
|
434
|
+
"en": "./translations/en/aboutPage.content.json",
|
|
435
|
+
"fr": "./translations/fr/aboutPage.content.json",
|
|
436
|
+
"es": "./translations/es/aboutPage.content.json"
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
**Variáveis disponíveis:**
|
|
442
|
+
|
|
443
|
+
- `{{locale}}` – Código do idioma (ex.: `fr`, `es`)
|
|
444
|
+
- `{{fileName}}` – Nome do arquivo (ex.: `example`)
|
|
445
|
+
- `{{key}}` – Chave do dicionário (ex.: `example`)
|
|
446
|
+
|
|
447
|
+
> Veja [Configuração de Preenchimento Automático no Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/autoFill.md) para mais informações.
|
|
448
|
+
|
|
449
|
+
##### `priority` (número)
|
|
450
|
+
|
|
451
|
+
Indica a prioridade do dicionário para resolução de conflitos. Quando múltiplos dicionários possuem a mesma chave, o dicionário com o maior número de prioridade irá sobrescrever os demais. Isso é útil para gerenciar hierarquias de conteúdo e substituições.
|
|
452
|
+
|
|
453
|
+
**Exemplo:**
|
|
454
|
+
|
|
455
|
+
```typescript
|
|
456
|
+
// Dicionário base
|
|
457
|
+
{
|
|
458
|
+
key: "welcome-message",
|
|
459
|
+
priority: 1,
|
|
460
|
+
content: { message: "Welcome!" }
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// Dicionário de substituição
|
|
464
|
+
{
|
|
465
|
+
key: "welcome-message",
|
|
466
|
+
priority: 10,
|
|
467
|
+
content: { message: "Bem-vindo ao nosso serviço premium!" }
|
|
468
|
+
}
|
|
469
|
+
// Isto irá sobrescrever o dicionário base
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Propriedades do CMS
|
|
473
|
+
|
|
474
|
+
##### `version` (string)
|
|
475
|
+
|
|
476
|
+
Identificador de versão para dicionários remotos. Ajuda a rastrear qual versão do dicionário está sendo usada atualmente, especialmente útil ao trabalhar com sistemas de gerenciamento de conteúdo remotos.
|
|
477
|
+
|
|
478
|
+
##### `live` (boolean)
|
|
479
|
+
|
|
480
|
+
Para dicionários remotos, indica se o dicionário deve ser buscado ao vivo em tempo de execução. Quando ativado:
|
|
481
|
+
|
|
482
|
+
- Requer que `importMode` esteja definido como "live" em `intlayer.config.ts`
|
|
483
|
+
- Requer que um servidor ao vivo esteja em execução
|
|
484
|
+
- O dicionário será buscado em tempo de execução usando a API de sincronização ao vivo
|
|
485
|
+
- Se estiver ao vivo, mas a busca falhar, recai para o valor dinâmico
|
|
486
|
+
- Se não estiver ao vivo, o dicionário é transformado em tempo de build para desempenho otimizado
|
|
487
|
+
|
|
488
|
+
### Propriedades do Sistema (Geradas automaticamente)
|
|
489
|
+
|
|
490
|
+
Estas propriedades são geradas automaticamente pelo Intlayer e não devem ser modificadas manualmente:
|
|
491
|
+
|
|
492
|
+
##### `$schema` (string)
|
|
493
|
+
|
|
494
|
+
Esquema JSON usado para validação da estrutura do dicionário. Adicionado automaticamente pelo Intlayer para garantir a integridade do dicionário.
|
|
495
|
+
|
|
496
|
+
##### `id` (string)
|
|
497
|
+
|
|
498
|
+
Para dicionários remotos, este é o identificador único do dicionário no servidor remoto. Usado para buscar e gerenciar conteúdo remoto.
|
|
499
|
+
|
|
500
|
+
##### `localId` (LocalDictionaryId)
|
|
501
|
+
|
|
502
|
+
Identificador único para dicionários locais. Gerado automaticamente pelo Intlayer para ajudar a identificar o dicionário e determinar se é local ou remoto, junto com sua localização.
|
|
503
|
+
|
|
504
|
+
##### `localIds` (LocalDictionaryId[])
|
|
505
|
+
|
|
506
|
+
Para dicionários mesclados, este array contém os IDs de todos os dicionários que foram mesclados juntos. Útil para rastrear a origem do conteúdo mesclado.
|
|
507
|
+
|
|
508
|
+
##### `filePath` (string)
|
|
509
|
+
|
|
510
|
+
O caminho do arquivo do dicionário local, indicando de qual arquivo `.content` o dicionário foi gerado. Ajuda na depuração e no rastreamento da origem.
|
|
511
|
+
|
|
512
|
+
##### `versions` (string[])
|
|
513
|
+
|
|
514
|
+
Para dicionários remotos, este array contém todas as versões disponíveis do dicionário. Ajuda a rastrear quais versões estão disponíveis para uso.
|
|
515
|
+
|
|
516
|
+
##### `autoFilled` (true)
|
|
517
|
+
|
|
518
|
+
Indica se o dicionário foi preenchido automaticamente a partir de fontes externas. Em caso de conflitos, os dicionários base substituirão os dicionários preenchidos automaticamente.
|
|
519
|
+
|
|
520
|
+
##### `location` ('distant' | 'locale')
|
|
521
|
+
|
|
522
|
+
Indica a localização do dicionário:
|
|
523
|
+
|
|
524
|
+
- `'locale'`: Dicionário local (a partir dos arquivos de conteúdo)
|
|
525
|
+
- `'distant'`: Dicionário remoto (a partir de fonte externa)
|
|
526
|
+
|
|
527
|
+
## Tipos de Nós de Conteúdo
|
|
528
|
+
|
|
529
|
+
O Intlayer fornece vários tipos especializados de nós de conteúdo que estendem valores primitivos básicos:
|
|
530
|
+
|
|
531
|
+
### Conteúdo de Tradução (`t`)
|
|
532
|
+
|
|
533
|
+
Conteúdo multilíngue que varia conforme o locale:
|
|
534
|
+
|
|
535
|
+
```typescript
|
|
536
|
+
import { t } from "intlayer";
|
|
537
|
+
|
|
538
|
+
// TypeScript/JavaScript
|
|
539
|
+
multilingualContent: t({
|
|
540
|
+
en: "Welcome to our website",
|
|
541
|
+
fr: "Bienvenue sur notre site web",
|
|
542
|
+
es: "Bienvenido a nuestro sitio web",
|
|
543
|
+
});
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### Conteúdo Condicional (`cond`)
|
|
547
|
+
|
|
548
|
+
Conteúdo que muda com base em condições booleanas:
|
|
549
|
+
|
|
550
|
+
```typescript
|
|
551
|
+
import { cond } from "intlayer";
|
|
552
|
+
|
|
553
|
+
conditionalContent: cond({
|
|
554
|
+
true: "User is logged in",
|
|
555
|
+
false: "Please log in to continue",
|
|
556
|
+
});
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
### Conteúdo de Enumeração (`enu`)
|
|
560
|
+
|
|
561
|
+
Conteúdo que varia com base em valores enumerados:
|
|
562
|
+
|
|
563
|
+
```typescript
|
|
564
|
+
import { enu } from "intlayer";
|
|
565
|
+
|
|
566
|
+
statusContent: enu({
|
|
567
|
+
pending: "Sua solicitação está pendente",
|
|
568
|
+
approved: "Sua solicitação foi aprovada",
|
|
569
|
+
rejected: "Sua solicitação foi rejeitada",
|
|
570
|
+
});
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
### Conteúdo de Inserção (`insert`)
|
|
574
|
+
|
|
575
|
+
Conteúdo que pode ser inserido em outros conteúdos:
|
|
576
|
+
|
|
577
|
+
```typescript
|
|
578
|
+
import { insert } from "intlayer";
|
|
579
|
+
|
|
580
|
+
insertionContent: insert("Este texto pode ser inserido em qualquer lugar");
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
### Conteúdo Aninhado (`nest`)
|
|
584
|
+
|
|
585
|
+
Referências a outros dicionários:
|
|
586
|
+
|
|
587
|
+
```typescript
|
|
588
|
+
import { nest } from "intlayer";
|
|
589
|
+
|
|
590
|
+
nestedContent: nest("about-page");
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### Conteúdo Markdown (`md`)
|
|
594
|
+
|
|
595
|
+
Conteúdo de texto rico em formato Markdown:
|
|
596
|
+
|
|
597
|
+
```typescript
|
|
598
|
+
import { md } from "intlayer";
|
|
599
|
+
|
|
600
|
+
markdownContent: md(
|
|
601
|
+
"# Bem-vindo\n\nEste é um texto em **negrito** com [links](https://example.com)"
|
|
602
|
+
);
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
### Conteúdo por Gênero (`gender`)
|
|
606
|
+
|
|
607
|
+
Conteúdo que varia com base no gênero:
|
|
608
|
+
|
|
609
|
+
```typescript
|
|
610
|
+
import { gender } from "intlayer";
|
|
611
|
+
|
|
612
|
+
genderContent: gender({
|
|
613
|
+
male: "Ele é um desenvolvedor",
|
|
614
|
+
female: "Ela é uma desenvolvedora",
|
|
615
|
+
other: "Eles são desenvolvedores",
|
|
616
|
+
});
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
### Conteúdo de Arquivo (`file`)
|
|
620
|
+
|
|
621
|
+
Referências a arquivos externos:
|
|
622
|
+
|
|
623
|
+
```typescript
|
|
624
|
+
import { file } from "intlayer";
|
|
625
|
+
|
|
626
|
+
fileContent: file("./path/to/content.txt");
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
## Criando Arquivos de Conteúdo
|
|
630
|
+
|
|
631
|
+
### Estrutura Básica de Arquivo de Conteúdo
|
|
632
|
+
|
|
633
|
+
Um arquivo de conteúdo exporta um objeto padrão que satisfaz o tipo `Dictionary`:
|
|
634
|
+
|
|
635
|
+
```typescript
|
|
636
|
+
// example.content.ts
|
|
637
|
+
import { t, cond, nest, md, insert, file } from "intlayer";
|
|
638
|
+
|
|
639
|
+
export default {
|
|
640
|
+
key: "welcome-page",
|
|
641
|
+
title: "Conteúdo da Página de Boas-Vindas",
|
|
642
|
+
description:
|
|
643
|
+
"Conteúdo para a página principal de boas-vindas, incluindo a seção principal e recursos",
|
|
644
|
+
tags: ["página", "boas-vindas", "página-inicial"],
|
|
645
|
+
content: {
|
|
646
|
+
hero: {
|
|
647
|
+
title: t({
|
|
648
|
+
pt: "Bem-vindo à Nossa Plataforma",
|
|
649
|
+
fr: "Bienvenue sur Notre Plateforme",
|
|
650
|
+
es: "Bienvenido a Nuestra Plataforma",
|
|
651
|
+
}),
|
|
652
|
+
subtitle: t({
|
|
653
|
+
pt: "Crie aplicações incríveis com facilidade",
|
|
654
|
+
fr: "Construisez des applications incroyables avec facilité",
|
|
655
|
+
es: "Construye aplicaciones increíbles con facilidad",
|
|
656
|
+
}),
|
|
657
|
+
cta: cond({
|
|
658
|
+
true: t({
|
|
659
|
+
pt: "Começar",
|
|
660
|
+
fr: "Commencer",
|
|
661
|
+
es: "Comenzar",
|
|
662
|
+
}),
|
|
663
|
+
false: t({
|
|
664
|
+
pt: "Registrar-se",
|
|
665
|
+
fr: "S'inscrire",
|
|
666
|
+
es: "Registrarse",
|
|
667
|
+
}),
|
|
668
|
+
}),
|
|
669
|
+
},
|
|
670
|
+
features: [
|
|
671
|
+
{
|
|
672
|
+
title: t({
|
|
673
|
+
pt: "Fácil de Usar",
|
|
674
|
+
en: "Easy to Use",
|
|
675
|
+
fr: "Facile à Utiliser",
|
|
676
|
+
es: "Fácil de Usar",
|
|
677
|
+
}),
|
|
678
|
+
description: t({
|
|
679
|
+
pt: "Interface intuitiva para todos os níveis de habilidade",
|
|
680
|
+
en: "Intuitive interface for all skill levels",
|
|
681
|
+
fr: "Interface intuitive pour tous les niveaux",
|
|
682
|
+
es: "Interfaz intuitiva para todos los niveles",
|
|
683
|
+
}),
|
|
684
|
+
},
|
|
685
|
+
],
|
|
686
|
+
documentation: nest("documentation"),
|
|
687
|
+
readme: file("./README.md"),
|
|
688
|
+
},
|
|
689
|
+
} satisfies Dictionary;
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
### Arquivo de Conteúdo JSON
|
|
693
|
+
|
|
694
|
+
Você também pode criar arquivos de conteúdo no formato JSON:
|
|
695
|
+
|
|
696
|
+
```json
|
|
697
|
+
{
|
|
698
|
+
"key": "welcome-page",
|
|
699
|
+
"title": "Conteúdo da Página de Boas-Vindas",
|
|
700
|
+
"description": "Conteúdo para a página principal de boas-vindas",
|
|
701
|
+
"tags": ["page", "welcome"],
|
|
702
|
+
"content": {
|
|
703
|
+
"hero": {
|
|
704
|
+
"title": {
|
|
705
|
+
"nodeType": "translation",
|
|
706
|
+
"translation": {
|
|
707
|
+
"en": "Welcome to Our Platform",
|
|
708
|
+
"fr": "Bienvenue sur Notre Plateforme"
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
"subtitle": {
|
|
712
|
+
"nodeType": "translation",
|
|
713
|
+
"translation": {
|
|
714
|
+
"en": "Build amazing applications with ease",
|
|
715
|
+
"fr": "Construisez des applications incroyables avec facilité"
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
### Ficheiros de Conteúdo por Localidade
|
|
724
|
+
|
|
725
|
+
Para dicionários por localidade, especifique a propriedade `locale`:
|
|
726
|
+
|
|
727
|
+
```typescript
|
|
728
|
+
// welcome-page.en.content.ts
|
|
729
|
+
export default {
|
|
730
|
+
key: "welcome-page",
|
|
731
|
+
locale: "en",
|
|
732
|
+
content: {
|
|
733
|
+
hero: {
|
|
734
|
+
title: "Welcome to Our Platform",
|
|
735
|
+
subtitle: "Build amazing applications with ease",
|
|
736
|
+
},
|
|
737
|
+
},
|
|
738
|
+
} satisfies Dictionary;
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
```typescript
|
|
742
|
+
// welcome-page.fr.content.ts
|
|
743
|
+
export default {
|
|
744
|
+
key: "welcome-page",
|
|
745
|
+
locale: "fr",
|
|
746
|
+
content: {
|
|
747
|
+
hero: {
|
|
748
|
+
title: "Bienvenue sur Notre Plateforme",
|
|
749
|
+
subtitle: "Construisez des applications incroyables avec facilité",
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
} satisfies Dictionary;
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
## Extensões de Arquivos de Conteúdo
|
|
756
|
+
|
|
757
|
+
O Intlayer permite que você personalize as extensões dos seus arquivos de declaração de conteúdo. Essa personalização oferece flexibilidade para gerenciar projetos em larga escala e ajuda a evitar conflitos com outros módulos.
|
|
758
|
+
|
|
759
|
+
### Extensões Padrão
|
|
760
|
+
|
|
761
|
+
Por padrão, o Intlayer monitora todos os arquivos com as seguintes extensões para declarações de conteúdo:
|
|
762
|
+
|
|
763
|
+
- `.content.json`
|
|
764
|
+
- `.content.ts`
|
|
765
|
+
- `.content.tsx`
|
|
766
|
+
- `.content.js`
|
|
767
|
+
- `.content.jsx`
|
|
768
|
+
- `.content.mjs`
|
|
769
|
+
- `.content.mjx`
|
|
770
|
+
- `.content.cjs`
|
|
771
|
+
- `.content.cjx`
|
|
772
|
+
|
|
773
|
+
Essas extensões padrão são adequadas para a maioria das aplicações. No entanto, quando você tem necessidades específicas, pode definir extensões personalizadas para otimizar o processo de build e reduzir o risco de conflitos com outros componentes.
|
|
774
|
+
|
|
775
|
+
> Para personalizar as extensões de arquivo que o Intlayer usa para identificar arquivos de declaração de conteúdo, você pode especificá-las no arquivo de configuração do Intlayer. Essa abordagem é benéfica para projetos em larga escala, onde limitar o escopo do processo de monitoramento melhora o desempenho do build.
|
|
776
|
+
|
|
777
|
+
## Conceitos Avançados
|
|
778
|
+
|
|
779
|
+
### Mesclagem de Dicionários
|
|
780
|
+
|
|
781
|
+
Quando múltiplos dicionários possuem a mesma chave, o Intlayer os mescla automaticamente. O comportamento da mesclagem depende de vários fatores:
|
|
782
|
+
|
|
783
|
+
- **Prioridade**: Dicionários com valores de `priority` mais altos substituem aqueles com valores mais baixos
|
|
784
|
+
- **Auto-preenchimento vs Base**: Dicionários base substituem dicionários auto-preenchidos
|
|
785
|
+
- **Localização**: Dicionários locais substituem dicionários remotos (quando as prioridades são iguais)
|
|
786
|
+
|
|
787
|
+
### Segurança de Tipos
|
|
788
|
+
|
|
789
|
+
O Intlayer oferece suporte completo ao TypeScript para arquivos de conteúdo:
|
|
790
|
+
|
|
791
|
+
```typescript
|
|
792
|
+
// Defina seu tipo de conteúdo
|
|
793
|
+
interface WelcomePageContent {
|
|
794
|
+
hero: {
|
|
795
|
+
title: string;
|
|
796
|
+
subtitle: string;
|
|
797
|
+
cta: string;
|
|
798
|
+
};
|
|
799
|
+
features: Array<{
|
|
800
|
+
title: string;
|
|
801
|
+
description: string;
|
|
802
|
+
}>;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
// Use-o no seu dicionário
|
|
806
|
+
export default {
|
|
807
|
+
key: "welcome-page",
|
|
808
|
+
content: {
|
|
809
|
+
// O TypeScript fornecerá autocompletar e verificação de tipos
|
|
810
|
+
hero: {
|
|
811
|
+
title: "Welcome",
|
|
812
|
+
subtitle: "Build amazing apps",
|
|
813
|
+
cta: "Get Started",
|
|
814
|
+
},
|
|
815
|
+
},
|
|
816
|
+
} satisfies Dictionary<WelcomePageContent>;
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
### Imbricação de Nós
|
|
820
|
+
|
|
821
|
+
Você pode, sem problema, imbricar funções dentro de outras.
|
|
822
|
+
|
|
823
|
+
Exemplo:
|
|
824
|
+
|
|
825
|
+
```javascript fileName="src/example.content.tsx" contentDeclarationFormat="typescript"
|
|
826
|
+
import { t, enu, cond, nest, md, type Dictionary } from "intlayer";
|
|
827
|
+
|
|
828
|
+
const getName = async () => "John Doe";
|
|
829
|
+
|
|
830
|
+
export default {
|
|
831
|
+
key: "page",
|
|
832
|
+
content: {
|
|
833
|
+
// `getIntlayer('page','en').hiMessage` retorna `['Hi', ' ', 'John Doe']`
|
|
834
|
+
hiMessage: [
|
|
835
|
+
t({
|
|
836
|
+
en: "Hi",
|
|
837
|
+
fr: "Salut",
|
|
838
|
+
es: "Hola",
|
|
839
|
+
}),
|
|
840
|
+
" ",
|
|
841
|
+
getName(),
|
|
842
|
+
],
|
|
843
|
+
// Conteúdo composto imbricando condição, enumeração e conteúdo multilíngue
|
|
844
|
+
// `getIntlayer('page','en').advancedContent(true)(10)` retorna 'Multiple items found'
|
|
845
|
+
advancedContent: cond({
|
|
846
|
+
true: enu({
|
|
847
|
+
"0": t({
|
|
848
|
+
en: "No items found",
|
|
849
|
+
fr: "Aucun article trouvé",
|
|
850
|
+
es: "Não foram encontrados artigos",
|
|
851
|
+
}),
|
|
852
|
+
"1": t({
|
|
853
|
+
en: "One item found",
|
|
854
|
+
fr: "Un article trouvé",
|
|
855
|
+
es: "Foi encontrado um artigo",
|
|
856
|
+
}),
|
|
857
|
+
">1": t({
|
|
858
|
+
en: "Multiple items found",
|
|
859
|
+
fr: "Plusieurs articles trouvés",
|
|
860
|
+
es: "Foram encontrados múltiplos artigos",
|
|
861
|
+
}),
|
|
862
|
+
}),
|
|
863
|
+
false: t({
|
|
864
|
+
en: "No valid data available",
|
|
865
|
+
fr: "Aucune donnée valide disponible",
|
|
866
|
+
es: "Não há dados válidos disponíveis",
|
|
867
|
+
}),
|
|
868
|
+
}),
|
|
869
|
+
},
|
|
870
|
+
} satisfies Dictionary;
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
```javascript fileName="src/example.content.mjx" contentDeclarationFormat="esm"
|
|
874
|
+
import { t, enu, cond, nest, md } from "intlayer";
|
|
875
|
+
|
|
876
|
+
const getName = async () => "John Doe";
|
|
877
|
+
|
|
878
|
+
/** @type {import('intlayer').Dictionary} */
|
|
879
|
+
export default {
|
|
880
|
+
key: "page",
|
|
881
|
+
content: {
|
|
882
|
+
// `getIntlayer('page','en').hiMessage` retorna `['Hi', ' ', 'John Doe']`
|
|
883
|
+
hiMessage: [
|
|
884
|
+
t({
|
|
885
|
+
en: "Hi",
|
|
886
|
+
fr: "Salut",
|
|
887
|
+
es: "Hola",
|
|
888
|
+
}),
|
|
889
|
+
" ",
|
|
890
|
+
getName(),
|
|
891
|
+
],
|
|
892
|
+
// Conteúdo composto imbricando condição, enumeração e conteúdo multilíngue
|
|
893
|
+
// `getIntlayer('page','en').advancedContent(true)(10)` retorna 'Multiple items found'
|
|
894
|
+
advancedContent: cond({
|
|
895
|
+
true: enu({
|
|
896
|
+
"0": t({
|
|
897
|
+
en: "No items found",
|
|
898
|
+
fr: "Aucun article trouvé",
|
|
899
|
+
es: "No se encontraron artículos",
|
|
900
|
+
}),
|
|
901
|
+
"1": t({
|
|
902
|
+
en: "One item found",
|
|
903
|
+
fr: "Un article trouvé",
|
|
904
|
+
es: "Se encontró un artículo",
|
|
905
|
+
}),
|
|
906
|
+
">1": t({
|
|
907
|
+
en: "Múltiplos itens encontrados",
|
|
908
|
+
fr: "Plusieurs articles trouvés",
|
|
909
|
+
es: "Se encontraron múltiples artículos",
|
|
910
|
+
}),
|
|
911
|
+
}),
|
|
912
|
+
false: t({
|
|
913
|
+
en: "Nenhum dado válido disponível",
|
|
914
|
+
fr: "Aucune donnée valide disponible",
|
|
915
|
+
es: "No hay datos válidos disponibles",
|
|
916
|
+
}),
|
|
917
|
+
}),
|
|
918
|
+
},
|
|
919
|
+
};
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
```javascript fileName="src/example.content.cjx" contentDeclarationFormat="commonjs"
|
|
923
|
+
const { t, enu, cond, nest, md } = require("intlayer");
|
|
924
|
+
|
|
925
|
+
const getName = async () => "John Doe";
|
|
926
|
+
|
|
927
|
+
/** @type {import('intlayer').Dictionary} */
|
|
928
|
+
module.exports = {
|
|
929
|
+
key: "page",
|
|
930
|
+
content: {
|
|
931
|
+
// `getIntlayer('page','en').hiMessage` retorna `['Hi', ' ', 'John Doe']`
|
|
932
|
+
hiMessage: [
|
|
933
|
+
t({
|
|
934
|
+
en: "Oi",
|
|
935
|
+
fr: "Salut",
|
|
936
|
+
es: "Hola",
|
|
937
|
+
}),
|
|
938
|
+
" ",
|
|
939
|
+
getName(),
|
|
940
|
+
],
|
|
941
|
+
// Conteúdo composto imbricando condição, enumeração e conteúdo multilíngue
|
|
942
|
+
// `getIntlayer('page','en').advancedContent(true)(10) retorna 'Múltiplos itens encontrados'`
|
|
943
|
+
advancedContent: cond({
|
|
944
|
+
true: enu({
|
|
945
|
+
"0": t({
|
|
946
|
+
en: "No items found",
|
|
947
|
+
fr: "Aucun article trouvé",
|
|
948
|
+
es: "No se encontraron artículos",
|
|
949
|
+
}),
|
|
950
|
+
"1": t({
|
|
951
|
+
en: "One item found",
|
|
952
|
+
fr: "Un article trouvé",
|
|
953
|
+
es: "Se encontró un artículo",
|
|
954
|
+
}),
|
|
955
|
+
">1": t({
|
|
956
|
+
en: "Multiple items found",
|
|
957
|
+
fr: "Plusieurs articles trouvés",
|
|
958
|
+
es: "Se encontraron múltiples artículos",
|
|
959
|
+
}),
|
|
960
|
+
}),
|
|
961
|
+
false: t({
|
|
962
|
+
en: "No valid data available",
|
|
963
|
+
fr: "Aucune donnée valide disponible",
|
|
964
|
+
es: "No hay datos válidos disponibles",
|
|
965
|
+
}),
|
|
966
|
+
}),
|
|
967
|
+
},
|
|
968
|
+
};
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
```json5 fileName="src/example.content.json" contentDeclarationFormat="json"
|
|
972
|
+
{
|
|
973
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
974
|
+
"key": "page",
|
|
975
|
+
"content": {
|
|
976
|
+
"hiMessage": {
|
|
977
|
+
"nodeType": "composite",
|
|
978
|
+
"composite": [
|
|
979
|
+
{
|
|
980
|
+
"nodeType": "translation",
|
|
981
|
+
"translation": {
|
|
982
|
+
en: "Olá",
|
|
983
|
+
fr: "Salut",
|
|
984
|
+
es: "Hola",
|
|
985
|
+
},
|
|
986
|
+
},
|
|
987
|
+
" ",
|
|
988
|
+
"John Doe",
|
|
989
|
+
],
|
|
990
|
+
},
|
|
991
|
+
"advancedContent": {
|
|
992
|
+
"nodeType": "condition",
|
|
993
|
+
"condition": {
|
|
994
|
+
"true": {
|
|
995
|
+
"nodeType": "enumeration",
|
|
996
|
+
"enumeration": {
|
|
997
|
+
"0": {
|
|
998
|
+
"nodeType": "translation",
|
|
999
|
+
"translation": {
|
|
1000
|
+
"en": "No items found",
|
|
1001
|
+
"fr": "Aucun article trouvé",
|
|
1002
|
+
"es": "No se encontraron artículos",
|
|
1003
|
+
"pt": "Nenhum item encontrado",
|
|
1004
|
+
},
|
|
1005
|
+
},
|
|
1006
|
+
"1": {
|
|
1007
|
+
"nodeType": "translation",
|
|
1008
|
+
"translation": {
|
|
1009
|
+
"en": "One item found",
|
|
1010
|
+
"fr": "Un article trouvé",
|
|
1011
|
+
"es": "Se encontró un artículo",
|
|
1012
|
+
"pt": "Um item encontrado",
|
|
1013
|
+
},
|
|
1014
|
+
},
|
|
1015
|
+
">1": {
|
|
1016
|
+
"nodeType": "translation",
|
|
1017
|
+
"translation": {
|
|
1018
|
+
"en": "Multiple items found",
|
|
1019
|
+
"fr": "Plusieurs articles trouvés",
|
|
1020
|
+
"es": "Se encontraron múltiples artículos",
|
|
1021
|
+
"pt": "Vários itens encontrados",
|
|
1022
|
+
},
|
|
1023
|
+
},
|
|
1024
|
+
},
|
|
1025
|
+
},
|
|
1026
|
+
"false": {
|
|
1027
|
+
"nodeType": "translation",
|
|
1028
|
+
"translation": {
|
|
1029
|
+
"en": "No valid data available",
|
|
1030
|
+
"fr": "Aucune donnée valide disponible",
|
|
1031
|
+
"es": "No hay datos válidos disponibles",
|
|
1032
|
+
},
|
|
1033
|
+
},
|
|
1034
|
+
},
|
|
1035
|
+
},
|
|
1036
|
+
},
|
|
1037
|
+
}
|
|
1038
|
+
```
|
|
1039
|
+
|
|
1040
|
+
### Melhores Práticas
|
|
1041
|
+
|
|
1042
|
+
1. **Convenções de Nomenclatura**:
|
|
1043
|
+
- Use kebab-case para as chaves do dicionário (`"about-page-meta"`)
|
|
1044
|
+
- Agrupe conteúdos relacionados sob o mesmo prefixo de chave
|
|
1045
|
+
|
|
1046
|
+
2. **Organização do Conteúdo**:
|
|
1047
|
+
- Mantenha conteúdos relacionados juntos no mesmo dicionário
|
|
1048
|
+
- Use objetos aninhados para organizar estruturas de conteúdo complexas
|
|
1049
|
+
- Aproveite as tags para categorização
|
|
1050
|
+
- Use o `autoFill` para preencher automaticamente as traduções faltantes
|
|
1051
|
+
|
|
1052
|
+
3. **Desempenho**:
|
|
1053
|
+
- Ajuste a configuração de conteúdo para limitar o escopo dos arquivos monitorados
|
|
1054
|
+
- Use dicionários ao vivo apenas quando atualizações em tempo real forem necessárias (por exemplo, testes A/B, etc.)
|
|
1055
|
+
- Garanta que o plugin de transformação de build (`@intlayer/swc` ou `@intlayer/babel`) esteja habilitado para otimizar o dicionário durante o build
|
|
1056
|
+
|
|
1057
|
+
## Histórico da Documentação
|
|
1058
|
+
|
|
1059
|
+
| Versão | Data | Alterações |
|
|
1060
|
+
| ------ | ---------- | --------------------------------- |
|
|
1061
|
+
| 6.0.0 | 2025-09-20 | Adição da documentação dos campos |
|
|
1062
|
+
| 5.5.10 | 2025-06-29 | Histórico inicial |
|