Skip to content

Commit

Permalink
add localize
Browse files Browse the repository at this point in the history
  • Loading branch information
thedaviddias committed Aug 13, 2022
1 parent 056a78d commit 9574240
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 68 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ SPOTIFY_REFRESH_TOKEN=
YOUTUBE_CHANNEL_ID=
GOOGLE_CLIENT_EMAIL=
GOOGLE_PRIVATE_KEY=

# Mailbox
MAILBOX_VALIDATOR_KEY=

# Simple Localize
SIMPLE_LOCALIZE_KEY=
11 changes: 11 additions & 0 deletions .github/workflows/production-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Production deployment

on:
push:
branches:
- main
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -36,6 +39,14 @@ jobs:
version: 7
run_install: false

- name: SimpleLocalize Download
uses: simplelocalize/download@2
with:
apiKey: ${{ secrets.SIMPLE_LOCALIZE_KEY }}
downloadPath: ./locales/{lang}/{ns}.json
downloadFormat: single-language-json
uploadOptions: 'WRITE_NESTED,ESCAPE_NEW_LINES'

- name: Vercel deployment
uses: amondnet/vercel-action@v20
with:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/staging-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Staging deployment

on:
# push:
# branches:
# - main
pull_request:
types: [opened, synchronize, reopened]
branches:
Expand Down Expand Up @@ -64,6 +61,13 @@ jobs:
path: ~/.cache/Cypress
key: cypress-binary-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Upload translations
uses: simplelocalize/upload@latest
with:
apiKey: ${{ secrets.SIMPLE_LOCALIZE_KEY }}
uploadPath: ./locales/{lang}/{ns}.json
uploadFormat: single-language-json

- name: Build Next.js project
run: pnpm build
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ public/sitemap-0.xml

# Sentry
.sentryclirc

# Simple Localize
simplelocalize.yml
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
strict-peer-dependencies=false
enable-pre-post-scripts=true
auto-install-peers=true
33 changes: 1 addition & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,5 @@
# David Dias's personal website

## Getting Started

First, run the development the server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
- Simple Localize: help with translations

## Design inspiration
4 changes: 3 additions & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ module.exports = {
},

// Format YAML, MarkDown, JSON
'**/*.(yml|md)': (filenames) => `prettier --write ${filenames.join(' ')}`,
'**/*.(yml|md|mdx)': (filenames) => `prettier --write ${filenames.join(' ')}`,

'public/images/**/*': 'imageoptim',

'locales/**/*.json': 'simplelocalize upload',

// Format the package.json
// 'package.json': 'npx sort-package-json',
}
46 changes: 16 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/rss/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>The David Dias | Front-End Developer, podcaster &amp; content creator</title>
<link>https://thedaviddias.dev</link>
<description>Hey, I'm David Dias! Front-End Developer based in Toronto/Canada. I love talking about code, technology, expatriation and life.</description>
<lastBuildDate>Sat, 13 Aug 2022 16:45:23 GMT</lastBuildDate>
<lastBuildDate>Sat, 13 Aug 2022 17:54:53 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/jpmonette/feed</generator>
<language>en</language>
Expand Down
2 changes: 1 addition & 1 deletion public/rss/fr/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>The David Dias | Développeur Front-End, podcasteur &amp; créateur de contenu</title>
<link>https://thedaviddias.dev</link>
<description>Salut toi! Je m'appele David Dias. Je suis développeur Front-End, podcasteur, créateur de contenu numérique passioné pour résoudre les problèmes digitaux et humains! J'aime rencontrer de nouvelles personnes, bâtir des communautées et parler de tech, d'expatriation et de web.</description>
<lastBuildDate>Sat, 13 Aug 2022 16:45:23 GMT</lastBuildDate>
<lastBuildDate>Sat, 13 Aug 2022 17:54:53 GMT</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator>https://github.com/jpmonette/feed</generator>
<language>fr</language>
Expand Down

1 comment on commit 9574240

@vercel
Copy link

@vercel vercel bot commented on 9574240 Aug 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.