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

Feature/like button code conventions #14

Merged
merged 15 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"projectName": "nyxo-website",
"projectOwner": "hello-nyxo",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "none",
"contributors": [
{
"login": "turq84",
"name": "Kayla Gordon",
"avatar_url": "https://avatars3.githubusercontent.com/u/13418428?v=4",
"profile": "https://www.kayla-gordon.com/",
"contributions": [
"code"
]
},
{
"login": "plahteenlahti",
"name": "Perttu",
"avatar_url": "https://avatars0.githubusercontent.com/u/7436554?v=4",
"profile": "https://github.com/plahteenlahti",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"projectName": "nyxo-website",
"projectOwner": "hello-nyxo",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug Report 🐞
about: Something isn't working as expected? Here is the right place to report.
labels: "type: bug"
---

<!--
Please fill out each section below, otherwise, your issue will be closed.
Before opening a new issue, please search existing issues: https://github.com/hello-nyxo/nyxo-website/issues
-->

## Description

Describe the issue that you're seeing.

### Steps to reproduce

Clear steps describing how to reproduce the issue. Please please please link to a demo project if possible, this makes your issue _much_ easier to diagnose (seriously).

### Expected result

What should happen?

### Actual result

What happened.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Documentation 📝
about: Suggest better docs coverage for a particular tool or process.
labels: "type: documentation"
---

<!--
To make it easier for us to help you, please include as much useful information as possible.
-->

## Summary

What problem(s) did you run into that caused you to request additional documentation? What questions do you think we should answer? What, if any, existing documentation relates to this proposal?

Some recommended topics to cover:

- List the topics you think should be here.
- This list does not need to be exhaustive!

### Motivation

Why should we document this and who will benefit from it?

## Steps to resolve this issue

<!-- Your suggestion may require additional steps. Remember to add any relevant labels. Note that you'll need to fill in the link to a similar article as well as the correct section. Don't worry if you're not yet sure about these, especially if this is a brand new topic! -->

### Draft the doc

- [ ] Write the doc
- [ ] Add the doc to documentation folder

### Open a pull request

- [ ] Open a pull request with your work including the words "closes #[this issue's number]" in the pull request description
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature Request 💡
about: Suggest a new idea for the project.
labels: "type: feature or enhancement"
---

<!--
Please fill out each section below, otherwise, your issue will be closed.

-->

## Summary

Brief explanation of the feature.

### Basic example

If the proposal involves a new or changed API, include a basic code example. Omit this section if it's not applicable.

### Motivation

Why are we doing this? What use cases does it support? What is the expected outcome?
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Question 🤔
about: Usage question or discussion about Nyxo.
labels: "type: question or discussion"
---

<!--
To make it easier for us to help you, please include as much useful information as possible.

-->

## Summary

## Relevant information

<!-- Provide as much useful information as you can -->
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B


# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
3 changes: 3 additions & 0 deletions .graphqlconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ projects:
region: eu-central-1
apiId: null
maxDepth: 2
extensions:
amplify:
version: 3
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Nyxo Website
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

![Build, test, and release](https://github.com/hello-nyxo/nyxo-website/workflows/Build,%20test,%20and%20release/badge.svg)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
Expand Down Expand Up @@ -46,3 +49,23 @@ This project welcomes all contributions. This includes but is not limited to:
- Visualizing data (if you want to build a new chart to display your own data in the details page for example)
- New features (this means everything that makes Nyxo Sleep Coaching / Sleep Data easier to understand / use)


## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/plahteenlahti"><img src="https://avatars0.githubusercontent.com/u/7436554?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Perttu</b></sub></a><br /><a href="https://github.com/hello-nyxo/nyxo-website/commits?author=plahteenlahti" title="Code">💻</a></td>
<td align="center"><a href="https://www.kayla-gordon.com/"><img src="https://avatars3.githubusercontent.com/u/13418428?v=4" width="100px;" alt=""/><br /><sub><b>Kayla Gordon</b></sub></a><br /><a href="https://github.com/hello-nyxo/nyxo-website/commits?author=turq84" title="Code">💻</a></td>
</tr>
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions content/blog/supporting-localizations-at-nyxo/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
slug: "supporting-localizations-at-nyxo"
date: "2020-08-13"
title: Nyxo.app Now Available in Both Finnish and English
authorSlug: "perttu-lahteenlahti"
author: Perttu Lähteenlahti
tags: ["Company", "Open Source", "JAM Stack"]
thumbnailBlog: "./cover.jpeg"
---

Starting today, all of the materials we've produced about sleep, such as the lesson and exercises, are available in Finnish and English. We've supported both of the two aforementioned languages in the Nyxo mobile app since the beginning. Still, our website has mostly been in English. However, starting from today, you can easily change the language in the top navigation. In addition to this, we are now capable of supporting additional languages as well, and you can contribute to the translation in our repository.

There are a few things we hope to accomplish with this:

1. Better support for our Finnish customers. Our biggest market is still Finland; for a reason, we see that it is crucial to provide support and coaching materials in that language.
2. Better SEO performance. We hope that finally, supporting two languages throughout the site will boost our search engine position.
3. Open the way for more translations. Now that our source is open, everyone is welcome to provide additional languages, and we can also commission new languages if a certain market it requires. One example of this is supporting Swedish, the second official language here in Finland.

Before going into details on how the additional languages where implemented, I want to thank Pietari Nurmi and Kayla Gordon for translating and fixing the existing translations.

## Technical Aspects When Converting to a Multi-language Page

The nyxo.app site has been built using [GatsbyJS](http://gatsbyjs.org/), a static site generator. We've written previously about using Gatsby in our blog, and overall find it a very exciting piece of technology to work with. However, localization with Gatsby is not the easiest thing to achieve, and we have tried to do it previously, but the amount of work has just been too much for the benefit.

This time we decided to try it again after coming across [gatsby-plugin-react-i18next](https://github.com/microapps/gatsby-plugin-react-i18next). Using it made the whole localization project almost painless (we did have some problems with getting it to play nicely with the pages created using our content management service). What makes this plugin different from other Gatsby plugins is that it uses react-i18next, which is most likely one of the best options for handling localization.

Our site uses this plugin, with JSON translation files to translate all the UI texts, such as the ones appearing inside buttons, and on most pages which are coaching lessons or exercises. Our sleep coaching materials are fetched from Contentful, and then using the custom page creation function, we create individual pages for all languages. Currently, this means that Gatsby generates close to 500 pages, 250 in each of the currently supported languages. Adding for example, two more languages will massively increase the amount of generates pages. However, as long as the amount of generated pages stays under 10k, all should be good. Over that, we will most likely need to start considering an alternative solution.

We will most likely write a more detailed guide on how you can do this yourself, but in the meantime, you can peek at the code in our repository.

### Still to come

There are still some things missing as well. For example, blog posts are currently only available in one language and don't even support multiple versions of the content. There might also be some missing translation around the site, due to the number of unique pages we have. If you notice something, you can open a ticket in our repository.
Loading