Skip to content

Commit

Permalink
updates: added an article about next-translate
Browse files Browse the repository at this point in the history
  • Loading branch information
janakhpon committed Dec 7, 2021
1 parent b9ac0e0 commit 80e4294
Show file tree
Hide file tree
Showing 40 changed files with 14,596 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## VLOG

A collection of mono repos from my personal blog posts.

<br />
Expand Down Expand Up @@ -32,3 +33,5 @@ A collection of mono repos from my personal blog posts.
[React Graphql Subscriptions](https://janakhpon.gitlab.io/posts/react-graphql-subscriptions)

[React Query](https://janakhpon.gitlab.io/posts/react-query)

[Next Translate](https://janakhpon.gitlab.io/posts/next-translate)
3 changes: 3 additions & 0 deletions next-translate/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
34 changes: 34 additions & 0 deletions next-translate/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel
34 changes: 34 additions & 0 deletions next-translate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development 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.
8 changes: 8 additions & 0 deletions next-translate/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"locales": ["en", "mm"],
"defaultLocale": "en",
"pages": {
"*": ["common"],
"/about": ["common", "about"]
}
}
3 changes: 3 additions & 0 deletions next-translate/locales/en/about.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "About"
}
5 changes: 5 additions & 0 deletions next-translate/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"change-locale": "Change Localization",
"title": "Hello",
"withValue": "Today - {{date}}"
}
3 changes: 3 additions & 0 deletions next-translate/locales/mm/about.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "အကြောင်း"
}
5 changes: 5 additions & 0 deletions next-translate/locales/mm/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"change-locale": "ဘာသာစကားပြောင်း",
"title": "မင်္ဂလာပါ",
"withValue": "ဒီနေ့ - {{date}}"
}
6 changes: 6 additions & 0 deletions next-translate/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
17 changes: 17 additions & 0 deletions next-translate/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const withPWA = require('next-pwa')
const nextTranslate = require('next-translate');
const withPlugins = require("next-compose-plugins");

module.exports = withPlugins([
[nextTranslate()],
[withPWA, {
pwa: {
dest: 'public',
// disable: process.env.NODE_ENV === 'development',
// register: true,
// scope: '/app',
// sw: 'service-worker.js',
//...
},
}],
]);
Loading

0 comments on commit 80e4294

Please sign in to comment.