I've built a react app with react-i18next for localization. But when I use it as a micro-frontend in another app, it's not translating the text and returning json keys. Do I need to use i18next localization for parent/host app also or is there any other way to solve this?
Probably your file with the translation keys is in the orchestrated one.
You probably need to do domething like this: https://github.com/i18next/react-i18next/blob/master/example/react-component-lib/src/i18n.js
use the provider: https://react.i18next.com/latest/i18nextprovider#when-to-use
Related
I am developing VUE PWA (with VUE-CLI) and I need to fetch different data depending on provided params. Let me explain what I need, I have http://localhost:8080/proconnect/ (I changed publicPath: '/proconnect/' in my vue.config.js and it works fine, but I need to grab different data from API depending on param. I try to use simple GET params like this http://localhost:8080/proconnect/?code=123, this works fine in a browser, but when I install PWA on my computer as an app it loads without GET param.
I use PHP for the backend. The app works fine when it built on the server.
I need to pass param somehow to my app to fetch different data. I don't mind to use different subdomains or another way to solve this issue. I will appreciate any suggestions.
Thanks!
If you are using vue-router, a simple way to get the params is by using the useRoute hook. https://router.vuejs.org/guide/advanced/composition-api.html#accessing-the-router-and-current-route-inside-setup
I want to create a public facing API to fetch product, category etc. using strapi v4 graphql plugin.
I can disable some crud queries in the src/index.js file using the example here.
However I don't know how to disable the queries and mutations of things that are not part of shadowCRUD such as uploadFile, uploadFolder, i18Nlocale, usersPermissions, register, login etc.
How can I achieve this in strapi v4 (v4.3.4 as of right now)
extensionService.shadowCRUD('plugin::users-permissions.role').disableQueries();
extensionService.shadowCRUD('plugin::i18n.locale').disableQueries();
extensionService.shadowCRUD('plugin::upload.folder').disableQueries();
extensionService.shadowCRUD('plugin::upload.folder').disableMutations();
extensionService.shadowCRUD('plugin::upload.file').disableMutations();
extensionService.shadowCRUD('plugin::upload.file').disableQueries();
Adding these lines did help but still some of the non-content specific mutations are there (userPermissionsUser, userPermissionsRole). Still, I think there's a much cleaner way to do this somewhere.
I`m trying to create Automated Testing for an App that is developed in Vue.Js.
Is there a way for Vue.js to generate a static identifier (id, name, etc..) ?
You could set cssLoaders in webpack config to 'extract' css in dev/test/production build and that way it will not hashing your classes
Your tests should be run before building process. More here
Or you are going to use selenium/something like that?
I am developing a front end mobile application with react-native and redux implementation. I had successfully pulled all the necessary real APIs. Now I want to create a function that can update the student's info. Fyi, I'm developing a student information system, so there's info like address and email that need to be updated if changes occur. I don't know how to do it, I heard people uses "lodash" which I dunno what it is for. And how do I save the updated changes?
To update state of redux, it is good idea to use helper like react-addons-update or immutability-helper. update() provides simple syntactic pattern to make writing state update code easier. Eg:
import update from 'immutability-helper';
function handleUpdateMydata(state, action){
return update(state,{
myData:{
$set:action.payload
}
})
}
To ensure your state is permanent store, you may use redux-persist
lodash is a library that is used for dealing with the arrays and objects. if you wanna know more about its content see the documentation here
Documentation
Now coming on to your real problem,since you are using redux I think you should create an action that would update your student details in the database
I'd like to create a userguide for the application I'm building using the Kohana framework, and I'm wondering if there's a way I can use the Kohana userguide module for this purpose.
I understand how to add userguide info for new modules that I create, and how to include my classes in the API, but I want to build a second, separate userguide for the actual application user, as opposed to the app developers.
At first, I thought I'd just try adding app help pages to the main userguide at APPPATH/guide. I tried adding a "application/guide" directory, and put a file in there called menu.md, but that just ended up replacing the Kohana menu in the userguide. After renaming the file to menu.myapp.md, it doesn't show up at all.
So then it occurs to me that I could simple edit modules/userguide/guide/menu.md to add sections for my app, and likewise add markdown files for each app component. But really it would be much better to have a completely separate userguide for app users since the Kohana documentation isn't relevant for them.
What's the best way to go about this? Should I create a duplicate of the entire userguide module and modify the routing, &c.? Or is there some way to set up both userguides using the one version of the module? Or am I barking up the wrong tree altogether? Is there some other module/approach that would be better for building "Help" pages for the app?
Thanks in advance for your help!
Yes, you can make docs for your application with the userguide. If you want examples, check out these links:
https://github.com/zombor/Auto-Modeler/blob/master/config/userguide.php
https://github.com/zombor/Auto-Modeler/tree/master/guide/auto-modeler
Note that you'll still get "api docs" and everything else, unless you change the config to hide them.