Change the language
niyazaki opened this issue · 5 comments
Hello,
I find this project amazing. I would love to contribute and give a ton of inspirational messages.
I think there's two options to resolve this :
- add language option in the API
- add the option to use a CSV/JSON/... File to get the messages
Thank you !
Hey @niyazaki Pull Requests are most welcome 😄
I'll appreciate having that CSV option as well. I gifted an inkyshot to my parents and I'd love the inkyshot to rotate pre-selected quotes (family anecdotes).
Agreed, the CSV is the more versatile answer to this problem. Gonna have a look at your code.
For the language part, I searched a bit and found maybe an API for French citations: https://citations.ouest-france.fr/
But it seems like nobody ever used their API or not for a long time because it's kinda broken. I've sent them an e-mail, I'll keep you in touch and make a Pull Request with this whenever I have time and if they respond/I find another API.
For the CSV part there are two options again :
- Add a CSV in the web part of the Balena Cloud thingy (never worked with Balena services so I don't think I'll go this away even if it seems better for the end-user)
- Update the display message-based a local CSV file (simply override the message as done in https://github.com/balenalabs/inkyshot/blob/aff265f8be1d50554f70cb26134d2f3ca9644b33/inkyshot/update-display.py#L348)
As I said, I never integrated anything with Balena, so my Pull Request may be a little bit buggy. Plus I don't have any Raspberry Pi to test it. So if you give me a hand @gelbal and correct it, it may be a quick win for everyone.
Pull request is coming. Also, as the CSV file may be of variable length, I plan something based on a randomized variable put in Balena parameter thing. You may have to double-check this (my guess is that I have to announce/declare the variable somewhere in the deploy part but I have no idea or time to look further for this issue).
Here is the pull request :).
Based on https://forums.balena.io/t/maximum-length-of-application-environmental-variables/243168/18 variables may be up to 1MB so I created a CSV_MESSAGE variable.
As already said I'm new to this whole Balena universe and I've read a bit of documentation in order to simplify the work of testing this because I cannot do it myself for technical reasons.
Hope this gets added to the main project in order to help people.
@gelbal thank you in advance for the review.
For the CSV part there are two options again :
- Add a CSV in the web part of the Balena Cloud thingy (never worked with Balena services so I don't think I'll go this away even if it seems better for the end-user)
- Update the display message-based a local CSV file (simply override the message as done in https://github.com/balenalabs/inkyshot/blob/aff265f8be1d50554f70cb26134d2f3ca9644b33/inkyshot/update-display.py#L348
)
PS : Finaly, I did (or at least tried) both