Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested feature: Translations and "closure" post in Spanish #375

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nikosantis
Copy link

I love this project.
As I am interested that more people can read this and continue learning, I would like to make the contribution of adding different translations.

I have added first a copy of the get-posts.js function called get-posts-multilang.js, which receives a "lang" argument, which is a string that would be the ISO code of each language. In this case, as the first translation language I have used "es" (Spanish).
Example: getPostsMultilang('es')

Second, I have added a new route: /pages/[slug]/es.js
At the same time, I've created a folder inside the posts folder called/es, where I've added the post closure in Spanish.
In the /pages/[slug]/es.js path in the getStaticProps function i added more props lang and langList, which will be used in a component similar to "overreacted.io" from the available translations.

Something similar on the original route /pages/[slug].js for the same reason mentioned above.

Finally, I want to mention that I didn't want to add the language path to the beginning of the "concept" (.is/es/[slug]), why?
Because it would break the beauty of the Domain used and the concept of the blog. (whatthefuck.is/[slug])..... (whatthefuck.is/es/[slug]) ... (whatthefuck.is/pt/[slug])
No!
(whatthefuck.is/[slug]/es)... (whatthefuck.is/[slug]/pt) etc.

That would be my contribution.
I hope it is useful.
I intend to continue translating the other posts, if this PR is approved.

@vercel
Copy link

vercel bot commented Aug 6, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/gaearon/whatthefuckis/1tfc98oum
✅ Preview: https://whatthefuckis-git-fork-nikosantis-main.gaearon.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant