Skip to content

Commit

Permalink
Added Flag Quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaishnavi-Raykar committed Oct 25, 2024
1 parent 4cdc11c commit c104795
Show file tree
Hide file tree
Showing 146 changed files with 25,088 additions and 0 deletions.
38 changes: 38 additions & 0 deletions demos/Flag Quiz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build
/dist-e2e

# misc
.DS_Store
*.pem

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

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
26 changes: 26 additions & 0 deletions demos/Flag Quiz/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Country Flag Quiz using Tolgee
[<img src="https://raw.githubusercontent.com/tolgee/documentation/main/tolgee_logo_text.svg" alt="Tolgee" width="100" />](https://tolgee.io)

### [Live Website](https://flag-quiz-phi.vercel.app/)
### [Dev.to Blog Link](https://dev.to/vaishnavi_raykar/flag-quiz-4bc3)
##
Here i used `tolgee` with `next.js` app router.
based on `next14` app folder with `tolgee` and `next-intl` package.

## Setup

1. Clone this repo
2. Run `npm i`
3. Run `npm run dev`

## Setup tolgee credentials (optional)

5. Create project in Tolgee platform
6. Add `.env.development.local` file to base folder of this project with an API key to your project

```
NEXT_PUBLIC_TOLGEE_API_URL=https://app.tolgee.io
NEXT_PUBLIC_TOLGEE_API_KEY=<your project API key>
```

7. Re-run `npm run dev`
15 changes: 15 additions & 0 deletions demos/Flag Quiz/messages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"app-name": "Flag Quiz",
"correct": "Correct !",
"correct-ans": "Correct Answer :",
"game-over": "Game Over !",
"guess": "What country does this flag represent?",
"incorrect": "Incorrect !",
"question": "Question",
"quiz-name": "Flag Quiz",
"restart-quiz": "Restart Quiz !",
"select-lang": "Select Language",
"you-lose": "You Lose !",
"your-score": "Your Score :",
"you-win": "You Wins !"
}
15 changes: 15 additions & 0 deletions demos/Flag Quiz/messages/fr-FR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"app-name": "Quiz des drapeaux",
"correct": "C'est exact !",
"correct-ans": "Réponse correcte :",
"game-over": "Jeu Terminé !",
"guess": "Quel pays représente ce drapeau ?",
"incorrect": "C'est faux !",
"question": "Question",
"quiz-name": "Quiz sur le drapeau",
"restart-quiz": "Redémarrez Quiz !",
"select-lang": "Sélectionnez la langue",
"you-lose": "Tu perds !",
"your-score": "Votre score :",
"you-win": "Tu as gagné !"
}
15 changes: 15 additions & 0 deletions demos/Flag Quiz/messages/hi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"app-name": "ध्वज प्रश्नोत्तरी",
"correct": "सही है!",
"correct-ans": "सही जवाब :",
"game-over": "खेल समाप्त !",
"guess": "यह ध्वज किस देश का प्रतिनिधित्व करता है?",
"incorrect": "गलत है!",
"question": "सवाल",
"quiz-name": "ध्वज प्रश्नोत्तरी",
"restart-quiz": "प्रश्नोत्तरी पुनः आरंभ करें!",
"select-lang": "भाषा चुनें",
"you-lose": "आप हार गए !",
"your-score": "तुम्हारे अंक :",
"you-win": "आप जीत गए!"
}
15 changes: 15 additions & 0 deletions demos/Flag Quiz/messages/ja-JP.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"app-name": "旗クイズ",
"correct": "正しい!",
"correct-ans": "正解:",
"game-over": "ゲームオーバー!",
"guess": "この国旗はどの国を表していますか?",
"incorrect": "間違い!",
"question": "質問",
"quiz-name": "旗クイズ",
"restart-quiz": "クイズを再開!",
"select-lang": "言語選択",
"you-lose": "負けました!",
"your-score": "あなたのスコア:",
"you-win": "あなたの勝ち!"
}
10 changes: 10 additions & 0 deletions demos/Flag Quiz/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const createNextIntlPlugin = require('next-intl/plugin');

const withNextIntl = createNextIntlPlugin();

/** @type {import('next').NextConfig} */
const nextConfig = {
distDir: process.env.NEXT_BUILD_DIR || '.next',
};

module.exports = withNextIntl(nextConfig);
Loading

0 comments on commit c104795

Please sign in to comment.