Comments (14)
Or we can also implement it with MongoDB and Node.
from geeksay.
To solve the problem of big file size, implement a database would probaly be the best option, it will help to maintain the quotes/words more organized.
To solve the problem of the conflicts, could be created another site where the people could post their new translations/quotes directly on the database. Removing the need to change the main project that is causing the conflicts
from geeksay.
Thinking of that, to add new translations/quotes it wouldnt be necessary to create another site, just add a page inside de geeksay where people could add new translations. This way, even people who dont code can contribute.
from geeksay.
@marilia-borgo Agreed but If we implement a database then the process of fetching and translating the strings at runtime would be very complex or difficult. Do you have anything in mind to achieve that?
from geeksay.
i don't think it will very complex, it would be simple using a back-end with django for example.
from geeksay.
So can you do that or explain rough logic regarding how to do it.
from geeksay.
ok, i will start making a rought database to show my idea.
from geeksay.
So can you do that or explain rough logic regarding how to do it.
All new folks start from here..
from geeksay.
Basically it's like writing a backend for this site. We can create a NodeJs file which will have different routes, among them will be the one in which we can enter a new quote/translation which should be inserted in the database. We just need to do some changes in the main/home page in such a way that the required data is retrieved from the database.
from geeksay.
This will probably not be the best overall solution since it will increase the initial load time, or if possible use a webworker to execute that side of the code. Anyways this is what I am proposing to mimic a constant time operation instead of making requests to the database server each time a user needs to translate a quote, why not during the initial load, fetch all the quotes and store them in a session storage or local storage so that all requests will be made to that storage instead of the server and will only make requests at specific interval to the server to refresh the local storage or session storage
from geeksay.
@glorious-elijah your idea is exactly the thing I was thinking about but the issue is it will take high initial load times while fetching the translation array.
from geeksay.
@dk3775, high initial load times during the fetch process will be a little tricky to deal with, but what if we made that request through a web worker? I did a little research and it seems that it is possible to fetch data with a web worker, this is the link. After the web worker is done fetching the data in the background we then make it available to the main thread, this will only reduce the initial load time but I think the request should be fast enough in the background for the user not to realise there is such a thing going on behind the scenes.
from geeksay.
what if we keep complete dictionary on some json file or csv may be, that way it would be more user friendly too, anyone will be able to contribute later and can make changes according to user's need. and it won't require any extra cost to keep on running this project. when someones installs the package can directly use what he has or can make changes too
from geeksay.
@dk3775 Are you still looking for a solution to this issue?
In my view, @ravipathak3001 suggestion seems like the most straightforward way to fix this. You only need to implement a database if you're trying to build a system where you will be adding, updating and deleting constantly and from what I gathered (and correct me if I'm wrong), this application doesn't have that many quotes to require a database.
I'd suggest creating a JSON file key value pairs for different translations. I could work on it.
PS: I'm not from hacktoberfest, just looking to contribute to open source projects.
from geeksay.
Related Issues (20)
- Chrome extension, that will translate page to geek HOT 9
- Some experience with the project HOT 1
- Text overflows HOT 1
- Ferl HOT 1
- Two word translations not working HOT 5
- No copy to clipboard button HOT 1
- No copy to clipboard button HOT 8
- Create a copy button HOT 16
- Improve the Mobile Responsive Version HOT 21
- BUTTON RANDOM QUOTE AND COPY QUOTE NOT WORKING HOT 3
- Translation issue while reading numeric values HOT 5
- Update Readme.md for better styling. HOT 6
- Typo preventing buttons to function HOT 1
- I want to update the regular function with the arrow functions. HOT 3
- UI enhancement HOT 7
- 'node_modules' is not recognized as an internal or external command, HOT 1
- gallery addition HOT 2
- feat(Hactober Fest 2023) - Added a cool quote and a translation used in it
- Share button not displaying. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geeksay.