%PDF- %PDF-
Direktori : /home/opti/public_html/ezone-accounting.optisoft.com.ng/static/js/ |
Current File : /home/opti/public_html/ezone-accounting.optisoft.com.ng/static/js/128.7d6edd1b.chunk.js |
(this["webpackJsonpfuse-react-app"]=this["webpackJsonpfuse-react-app"]||[]).push([[128],{2500:function(e,n,a){"use strict";a.r(n),n.default="const locale = {\n APP_TITLE: 'Mailbox',\n COMPOSE: 'Compose',\n FOLDERS: 'Folders',\n FILTERS: 'Filters',\n LABELS: 'Labels',\n NO_MESSAGES: 'There are no messages!',\n SEARCH_PLACEHOLDER: 'Search for an e-mail or contact',\n INBOX: 'Inbox',\n SENT: 'Sent',\n DRAFTS: 'Drafts',\n SPAM: 'Spam',\n TRASH: 'Trash',\n STARRED: 'Starred',\n IMPORTANT: 'Important',\n};\n\nexport default locale;\n"},2501:function(e,n,a){"use strict";a.r(n),n.default="import i18next from 'i18next';\nimport { lazy } from 'react';\nimport { Redirect } from 'react-router-dom';\nimport ar from './i18n/ar';\nimport en from './i18n/en';\nimport tr from './i18n/tr';\n\ni18next.addResourceBundle('en', 'mailApp', en);\ni18next.addResourceBundle('tr', 'mailApp', tr);\ni18next.addResourceBundle('ar', 'mailApp', ar);\n\nconst MailAppConfig = {\n settings: {\n layout: {},\n },\n routes: [\n {\n path: [\n '/apps/mail/label/:labelHandle/:mailId?',\n '/apps/mail/filter/:filterHandle/:mailId?',\n '/apps/mail/:folderHandle/:mailId?',\n ],\n component: lazy(() => import('./MailApp')),\n },\n {\n path: '/apps/mail',\n component: () => <Redirect to=\"/apps/mail/inbox\" />,\n },\n ],\n};\n\nexport default MailAppConfig;\n"},2644:function(e,n,a){"use strict";a.r(n);var t=a(118),s=a(194),o=a(1);n.default=function(){return Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)(s.a,{variant:"h4",className:"mb-24",children:"Multi Language"}),Object(o.jsxs)(s.a,{className:"mb-16",component:"p",children:["Fuse React uses"," ",Object(o.jsx)("a",{href:"https://react.i18next.com/",target:"_blank",rel:"noopener noreferrer",children:Object(o.jsx)("code",{children:"react-i18next"})})," ","for to support multiple languages."]}),Object(o.jsx)(s.a,{className:"mb-16 p-16 border-1 bg-yellow-50 rounded-16 text-gray-800",component:"p",children:"Since not everybody need multi-language setup for their apps, we decided NOT to put translations everywhere. If you want to see the translations in action, visit the Mail app, and then change the language from the Toolbar. Mail app is the only app that has translations for demonstration purposes. You can look at its source code to see the usage."}),Object(o.jsx)(s.a,{className:"mb-8",variant:"h5",children:"Usage"}),Object(o.jsxs)(s.a,{className:"mb-16",component:"p",children:["In order to use the translations, create your translation file within the folder you want to use the translations. For example, for the Mail app, create ",Object(o.jsx)("code",{children:"i18n/en.js"})," file inside the",Object(o.jsx)("code",{children:"apps/mail"})," folder."]}),Object(o.jsx)(t.a,{component:"pre",className:"language-jsx mb-24",children:a(2500)}),Object(o.jsxs)(s.a,{className:"mb-16",component:"p",children:["And register the language file with ",Object(o.jsx)("code",{children:"i18next.addResourceBundle()"})," at",Object(o.jsx)("code",{children:"src/app/main/apps/mail/MailAppConfig.js"})]}),Object(o.jsx)(t.a,{component:"pre",className:"language-jsx mb-24",children:a(2501)}),Object(o.jsxs)(s.a,{className:"mb-16",component:"p",children:["And use in a component with ",Object(o.jsx)("code",{children:"useTranslation"})," hook as below:"]}),Object(o.jsx)(t.a,{component:"pre",className:"language-jsx mb-24",children:'\n import {useTranslation} from \'react-i18next\';\n\n const {t} = useTranslation(\'mailApp\');\n \n return (\n <div className="p-24">\n <Button\n variant="contained"\n color="primary"\n className="w-full"\n onClick={handleOpenDialog}\n >\n {t(\'COMPOSE\')}\n </Button>\n '}),Object(o.jsx)(s.a,{className:"mb-8",variant:"h5",children:"Changing Language"}),Object(o.jsxs)(s.a,{className:"mb-16",component:"p",children:["You should use ",Object(o.jsx)("code",{children:"changeLanguage"})," redux action to change language:"]}),Object(o.jsx)(t.a,{component:"pre",className:"language-jsx mb-24",children:"\n import { changeLanguage } from 'app/store/i18nSlice';\n\n .\n .\n\n dispatch(changeLanguage(lng.id));\n "}),Object(o.jsxs)(s.a,{className:"mb-16",component:"p",children:["Checkout example usage at",Object(o.jsx)("code",{children:"src/app/fuse-layouts/shared-components/LanguageSwitcher.js"})]})]})}}}]);