Remembering Hacktoberfest...
Published: 2022-02-28 06:01:16

A while back I wrote a [blog post about the troubles contributors had when maintainers fell short of their responsibilities](https://dev.to/amasianalbandian/hacktoberfest-dear-maintainers-5do7). Unfortunately, I've had the pleasure to witness déjà vu - yes, all the way back from October. 

This week I was excited to look into using i18n for localization in the Telescope web app. I think this was a great idea, and even if we only translate the about page, we would be able to welcome and educate others from around the globe about what Telescope is. 

As I began my search into next-i18next, I was so excited because the [npm page for the package](https://www.npmjs.com/package/next-i18next) was very clear and instructive - everything I would have said was necessary in my maintainer guideline blog. 

I went through the steps, and tried along the way to see if everything was working and able to run. I got a few different errors from silly mistakes: 
**Didn't understand how to get the translations from the `common.json`**
![translate from common.js error](https://i.imgur.com/L3LkFvM.png)

**My favourite: you need to implement the serverside rendering too!**
![serverside rendering fail](https://i.imgur.com/dfU5uPI.png)


I did all the steps listed and put up a [PR](https://github.com/Seneca-CDOT/telescope/pull/3053). Although I was able to get the translation working, even through browser locale, the PR never succeeded in deployment or build. 
![failed deployment](https://i.imgur.com/9vmWT7K.png)

I had a feeling this was going to happen. I wasn't able to build it locally either. I explored the error, and I came across an [issue filed in October 2020 for next.js](https://github.com/vercel/next.js/issues/18318). I don't know what happened, and I don't know what to say... but when you see an issue with 114 thumbs up - **A LOT** of people have clearly ran into it. 
![114 thumbs up](https://i.imgur.com/9cKLYjE.png)

The best part? The response provided received 100 thumbs down as there was clearly never going to be any support for next export in next.js

![100 thumbs down](https://i.imgur.com/Vf34m1l.png)

There were many attempts for a workaround provided by many different people, but none seemed to be stable as I approached all of them. Some seemed like it was promising, but really unnecessary workaround for something that should have been simple. Basically most of it was trying to get localization to not work statically - to avoid the next export all together. 

So as you can tell, the PR was closed. What I ended up doing was instead used i18n - without next.js and instead with React. This allowed us to put in localized routing. This means that we can create a select list with the various language options and allow users to select from there. 

I believe the idea works better because: 
1) We are only translating **some** pages - why put a "language dropdown" for all the pages and then not have it translate?
2) It might be easier to maintain down the line... It was extremely easy to use i18n as opposed to next-i18n. The logic of it is very simple too, which allows us to select which keys to use when selecting an option from the select. 
3) It works... 

#### So - what did I learn?
First of all I learned that programmers are gritty - and not just me. You tell a programmer something doesn't work and if they can't fix it they'll find another way - we simply hate the word "quit", and the issue was a great example of this. There were SO. MANY. ALTERNATIVE. ATTEMPTS. 

Next, what worst than poor maintenance? A lack of understanding for the requirements and limitations of your product. There were clearly **many** people running into this issue, and **many** left disappointed. At one point, someone said that they didn't support `next export` because none of *their* stakeholders required it...

The icing on the cake was that many people complained that the documentations stated that it is supported, and eventually they put in a note that explained hybrid apps do not support next export. The only solution from that issue was that they moved up the note so that it was ahead of all the instructions (basically don't waste your time setting it up, it doesn't work vs. I spent 3 hours trying to make it work and it still doesn't work). 

Although I sound really disappointed, I really am not. I was able to get the translations working with i18-next and react-i18next, and have put forth a [PR for the functionality](https://github.com/Seneca-CDOT/telescope/pull/3062).

#### Managing my 6 hour goal:
As for my goal of working 6 hours a week - I feel very productive and accomplished. I spent about 4 hours with the translations, and another 2 making more progress on the search bar - I even put up a [draft PR]](https://github.com/Seneca-CDOT/telescope/pull/3055) as I continue to work on it. 

I would say this strategy is very helpful in feeling productive and continuing to work. I look forward to continuing this mindset as I make more contributions in the upcoming weeks!