Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 117 additions & 23 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,42 @@ module.exports = {
sidebarDepth: 2,
lastUpdated: true,
footerCopyright: 'Apache 2.0 Licensed | Copyright © 2020 - 2024 Mojaloop Foundation',
// PR Preview configuration
isPrPreview: isPrPreview,
prNumber: process.env.VUEPRESS_PR_NUMBER || '',
nav: [
{
text: 'Adoption',
link: '/adoption/',
},
{
text: 'Community',
link: '/community/'
},
{
text: 'Technical',
link: '/technical/'
locales: {
'/': {
selectText: 'Languages',
label: 'English',
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated',
nav: [
{ text: 'Adoption', link: '/adoption/' },
{ text: 'Community', link: '/community/' },
{ text: 'Technical', link: '/technical/' },
{ text: 'Product', link: '/product/' },
{ text: 'Training Program', link: 'https://mojaloop.io/mojaloop-training-program/' }
],
},
{
text: 'Product',
link: '/product/'
},

{
text: 'Training Program',
link: 'https://mojaloop.io/mojaloop-training-program/'
'/fr/': {
selectText: 'Langues',
label: 'Français',
editLinkText: 'Modifier cette page sur GitHub',
lastUpdated: 'Dernière mise à jour',
nav: [
{ text: 'Adoption', link: '/fr/adoption/' },
{ text: 'Communauté', link: '/fr/community/' },
{ text: 'Technique', link: '/fr/technical/' },
{ text: 'Produit', link: '/fr/product/' },
{ text: 'Programme de formation', link: 'https://mojaloop.io/mojaloop-training-program/' }
],
}
},
nav: [
{ text: 'Adoption', link: '/adoption/' },
{ text: 'Community', link: '/community/' },
{ text: 'Technical', link: '/technical/' },
{ text: 'Product', link: '/product/' },
{ text: 'Training Program', link: 'https://mojaloop.io/mojaloop-training-program/' }
],
// Ref: https://vuepress.vuejs.org/theme/default-theme-config.html#sidebar
sidebar: {
Expand Down Expand Up @@ -1162,6 +1173,89 @@ module.exports = {
['features/invariants', 'Invariants'],
['features/development', 'Continuous Development']]
}
],
'/fr/adoption/': [
{
title: 'Guide du Schéma',
collapsable: false,
sidebarDepth: 2,
children: [
['Scheme/platform-operating-guideline', 'Modèle de Directive Opérationnelle de la Plateforme'],
['Scheme/scheme-business-rules', 'Modèle de Règles Commerciales du Schéma'],
['Scheme/scheme-key-choices', 'Choix Clés du Schéma'],
['Scheme/scheme-participation-agreement', 'Modèle d\'Accord de Participation au Schéma'],
['Scheme/scheme-uniform-glossary', 'Modèle de Glossaire Uniforme'],
]
},
{
title: 'Guide des Opérations du Hub',
collapsable: false,
sidebarDepth: 1,
children: [
{
title: 'Guide des Opérations Techniques',
collapsable: true,
sidebarDepth: 2,
children: [
'HubOperations/TechOps/tech-ops-introduction',
'HubOperations/TechOps/incident-management',
'HubOperations/TechOps/problem-management',
'HubOperations/TechOps/change-management',
'HubOperations/TechOps/release-management',
'HubOperations/TechOps/defect-triage',
'HubOperations/TechOps/key-terms-kpis',
'HubOperations/TechOps/incident-management-escalation-matrix',
'HubOperations/TechOps/service-level-agreements'
]
},
{
title: 'Guide de Gestion des Règlements',
collapsable: true,
sidebarDepth: 2,
children: [
'HubOperations/Settlement/settlement-management-introduction',
'HubOperations/Settlement/settlement-basic-concepts',
'HubOperations/Settlement/ledgers-in-the-hub',
]
},
{
title: 'Guide du Portail Finance v2',
collapsable: true,
sidebarDepth: 2,
children: [
'HubOperations/Portalv2/busops-portal-introduction',
'HubOperations/Portalv2/settlement-business-process',
'HubOperations/Portalv2/accessing-the-portal',
'HubOperations/Portalv2/managing-windows',
'HubOperations/Portalv2/settling',
'HubOperations/Portalv2/checking-settlement-details',
'HubOperations/Portalv2/monitoring-dfsp-financial-details',
'HubOperations/Portalv2/enabling-disabling-transactions',
'HubOperations/Portalv2/recording-funds-in-out',
'HubOperations/Portalv2/updating-ndc',
'HubOperations/Portalv2/searching-for-transfer-data'
]
},
{
title: 'Contrôle d\'Accès Basé sur les Rôles',
collapsable: true,
sidebarDepth: 2,
children: [
'HubOperations/RBAC/Role-based-access-control'
]
},
{
title: 'Guide d\'Intégration pour l\'Opérateur du Hub',
collapsable: true,
sidebarDepth: 2,
children: [
'HubOperations/Onboarding/onboarding-introduction',
'HubOperations/Onboarding/business-onboarding',
'HubOperations/Onboarding/technical-onboarding',
]
}
]
}
]
}
},
Expand All @@ -1183,8 +1277,8 @@ module.exports = {
},
'/fr/': {
lang: 'fr-FR',
title: 'Mojaloop Documentation',
description: '',
title: 'Documentation Mojaloop',
description: 'Documentation officielle du projet Mojaloop',
},
},
};
Expand Down
33 changes: 28 additions & 5 deletions docs/.vuepress/enhanceApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,34 @@
* https://v1.vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements
*/

const LOCALE_STORAGE_KEY = 'mojaloop-docs-locale-redirected'

function getBrowserLang () {
if (typeof navigator === 'undefined') return 'en'
const lang = navigator.language || navigator.userLanguage || ''
return lang.toLowerCase().split('-')[0]
}

export default ({
Vue, // the version of Vue being used in the VuePress app
options, // the options for the root Vue instance
router, // the router instance for the app
siteData // site metadata
Vue,
options,
router,
siteData,
isServer
}) => {
// ...apply enhancements for the site.
if (isServer) return

router.afterEach((to) => {
const alreadyRedirected = sessionStorage.getItem(LOCALE_STORAGE_KEY)
if (alreadyRedirected) return

sessionStorage.setItem(LOCALE_STORAGE_KEY, '1')

const browserLang = getBrowserLang()
const isOnFrenchPage = to.path.startsWith('/fr/')

if (browserLang === 'fr' && !isOnFrenchPage) {
return router.replace('/fr' + to.path)
}
})
}
48 changes: 40 additions & 8 deletions docs/.vuepress/theme/layouts/404.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,55 @@
<div class="content">
<h1>404</h1>
<blockquote>{{ getMsg() }}</blockquote>
<router-link to="/">Take me home.</router-link>
<router-link :to="active.homeLink">{{ active.homeLinkText }}</router-link>
</div>
</div>
</template>

<script>
const msgs = [
`There's nothing here.`,
`How did we get here?`,
`That's a Four-Oh-Four.`,
`Looks like we've got some broken links.`
]
const DEFAULT = 'en'

// Add a locale: new key + `prefix` (URL path, e.g. /de/) + copy fields.
const LOCALES = {
en: {
homeLink: '/',
homeLinkText: 'Take me home.',
messages: [
`There's nothing here.`,
`How did we get here?`,
`That's a Four-Oh-Four.`,
`Looks like we've got some broken links.`
]
},
fr: {
prefix: '/fr/',
homeLink: '/fr/',
homeLinkText: 'Retourner à l\'accueil.',
messages: [
`Il n'y a rien ici.`,
`Comment sommes-nous arrivés ici ?`,
`C'est une erreur 404.`,
`On dirait que nous avons des liens cassés.`
]
}
}

export default {
computed: {
active () {
const path = this.$route.path
for (const id of Object.keys(LOCALES)) {
if (id === DEFAULT) continue
const { prefix } = LOCALES[id]
if (prefix && path.startsWith(prefix)) return LOCALES[id]
}
return LOCALES[DEFAULT]
}
},
methods: {
getMsg () {
return msgs[Math.floor(Math.random() * msgs.length)]
const pool = this.active.messages
return pool[Math.floor(Math.random() * pool.length)]
}
}
}
Expand Down
Loading