2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"7rk+":function(e,t,n){"use strict";n.r(t),n.d(t,"_frontmatter",(function(){return l})),n.d(t,"default",(function(){return u}));n("5hJT"),n("W1QL"),n("K/PF"),n("t91x"),n("75LO"),n("PJhk"),n("mXGw");var a=n("/FXl"),i=n("TjRS");n("ZFoC"),n("aD51");function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var l={};void 0!==l&&l&&l===Object(l)&&Object.isExtensible(l)&&!l.hasOwnProperty("__filemeta")&&Object.defineProperty(l,"__filemeta",{configurable:!0,value:{name:"_frontmatter",filename:"screen/account/addNetwork.mdx"}});var o={_frontmatter:l},c=i.a;function u(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,["components"]);return Object(a.b)(c,r({},o,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h1",{id:"configurationscreen"},"ConfigurationScreen"),Object(a.b)("p",null,"La vue configuration fournit à l'utilisateur une interface permettant de configurer l'application. Dans notre cas\nles options disponibles pour la configuration de l'application sont uniquement le changement de langues."),Object(a.b)("hr",null),Object(a.b)("p",null,"NB: A l'avenir, d'autres options devront être rajoutés à l'application afin d'offrir plus d'options de personnalisations."),Object(a.b)("h2",{id:"la-bibliothèque-react-native-i18n"},"La bibliothèque react-native-i18n"),Object(a.b)("p",null,"⚠️ Cette bibliothèque est obsolète"),Object(a.b)("p",null,Object(a.b)("em",{parentName:"p"},"Il est conseillé d'utiliser à la place la bibliothèque ",Object(a.b)("a",r({parentName:"em"},{href:"https://github.com/react-native-community/react-native-localize"}),"react-native-localize"),". On peut utiliser le package react-native-localize avec ",Object(a.b)("a",r({parentName:"em"},{href:"https://github.com/fnando/i18n-js"}),"I18n-js")," (ou alors ",Object(a.b)("a",r({parentName:"em"},{href:"https://github.com/yahoo/react-intl"}),"react-intl"),", ",Object(a.b)("a",r({parentName:"em"},{href:"https://github.com/i18next/react-i18next"}),"react-i18next"),", etc. Les choix sont multiples!)")),Object(a.b)("img",{src:"https://cdn0.iconfinder.com/data/icons/material-design-ii-glyph/614/3010_-_Translate-512.png",width:"100",align:"left"}),Object(a.b)("h2",{id:"la-fonction-de-démarrage-initstate"},"La fonction de démarrage initState"),Object(a.b)("p",null,"Au tout début, une fonction init permet d'initialiser les différents fichiers de langues préalablement créer."),Object(a.b)("pre",null,Object(a.b)("code",r({parentName:"pre"},{className:"language-javascript"})," initState(){\n let language=[];\n language.push({name:I18n.t('langue.english'),value:'en'});\n language.push({name:I18n.t('langue.french'),value:'fr'});\n return{\n languages:language\n }\n }\n")),Object(a.b)("p",null,"A la suite un champ de texte listant les différentes langues disponibles, lui permettant ainsi de sélectionner la langue souhaitée."),Object(a.b)("pre",null,Object(a.b)("code",r({parentName:"pre"},{className:"language-javascript"}),'<Dropdown\n label="Changer la langue"\n data={this.state.languages}\n onChangeText={(value, index, data) => {\n I18n.locale = value;\n this.setState({ language: value });\n this.configuration.setCurrentLangue(data[index]);\n IlinkEmitter.emit("userconnect");\n }}\n valueExtractor={value => value.value}\n labelExtractor={value => value.name}\n/>\n')))}u&&u===Object(u)&&Object.isExtensible(u)&&!u.hasOwnProperty("__filemeta")&&Object.defineProperty(u,"__filemeta",{configurable:!0,value:{name:"MDXContent",filename:"screen/account/addNetwork.mdx"}}),u.isMDXComponent=!0}}]);
|
|
//# sourceMappingURL=component---screen-account-add-network-mdx-a05a491f6b110e195835.js.map
|