Skip to content

Commit

Permalink
fix: move i18n files
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanyawat-Arsaga committed Apr 1, 2024
1 parent 729576f commit 5b2f680
Show file tree
Hide file tree
Showing 27 changed files with 172 additions and 150 deletions.
3 changes: 2 additions & 1 deletion apps/astro/panda.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from '@pandacss/dev';
import { createPreset } from '@park-ui/panda-preset';
import { theme } from './src/theme';

export default defineConfig({
// Whether to use css reset
Expand All @@ -22,7 +23,7 @@ export default defineConfig({

// Useful for theme customization
theme: {
extend: {}
extend: theme
},

jsxFramework: 'react',
Expand Down
3 changes: 3 additions & 0 deletions apps/astro/src/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { type PartialTheme } from '@pandacss/types';

export const theme: PartialTheme = {};
3 changes: 2 additions & 1 deletion apps/astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"baseUrl": "src",
"jsxImportSource": "react",
"paths": {
"~/*": ["./*"]
"~/*": ["./*"],
"i18n/*": ["../../libs/i18n/*"]
}
},
"include": ["src", "styled-system"]
Expand Down
4 changes: 2 additions & 2 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"dotenv": "^16.4.5",
"fets": "^0.8.0",
"graphql": "^16.8.1",
"graphql-request": "6.1.0",
"graphql-request": "5.1.0",
"graphql-tag": "^2.12.6",
"lodash": "^4.17.21",
"remove-markdown": "^0.5.0",
Expand All @@ -76,4 +76,4 @@
"three": "^0.163.0",
"vite-plugin-pwa": "^0.19.7"
}
}
}
32 changes: 16 additions & 16 deletions apps/client/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,96 +6,96 @@ const config = {
{
locale: 'en',
key: 'common',
loader: async () => (await import('./en/common.json')).default
loader: async () => (await import('i18n/en/common.json')).default
},
{
locale: 'ja',
key: 'common',
loader: async () => (await import('./ja/common.json')).default
loader: async () => (await import('i18n/ja/common.json')).default
},
{
locale: 'en',
key: 'home',
pathname: '/',
loader: async () => (await import('./en/home.json')).default
loader: async () => (await import('i18n/en/home.json')).default
},
{
locale: 'ja',
key: 'home',
pathname: '/',
loader: async () => (await import('./ja/home.json')).default
loader: async () => (await import('i18n/ja/home.json')).default
},
{
locale: 'en',
key: 'project',
pathname: '/project',
loader: async () => (await import('./en/project.json')).default
loader: async () => (await import('i18n/en/project.json')).default
},
{
locale: 'ja',
key: 'project',
pathname: '/project',
loader: async () => (await import('./ja/project.json')).default
loader: async () => (await import('i18n/ja/project.json')).default
},
{
locale: 'en',
key: 'contact',
pathname: '/contact',
loader: async () => (await import('./en/contact.json')).default
loader: async () => (await import('i18n/en/contact.json')).default
},
{
locale: 'ja',
key: 'contact',
pathname: '/contact',
loader: async () => (await import('./ja/contact.json')).default
loader: async () => (await import('i18n/ja/contact.json')).default
},
{
locale: 'en',
key: 'about-me',
pathname: '/about',
loader: async () => (await import('./en/about-me.json')).default
loader: async () => (await import('i18n/en/about-me.json')).default
},
{
locale: 'ja',
key: 'about-me',
pathname: '/about',
loader: async () => (await import('./ja/about-me.json')).default
loader: async () => (await import('i18n/ja/about-me.json')).default
},
{
locale: 'en',
key: 'blog',
pathname: '/blog',
loader: async () => (await import('./en/blog.json')).default
loader: async () => (await import('i18n/en/blog.json')).default
},
{
locale: 'ja',
key: 'blog',
pathname: '/blog',
loader: async () => (await import('./ja/blog.json')).default
loader: async () => (await import('i18n/ja/blog.json')).default
},
{
locale: 'en',
key: 'note',
pathname: '/note',
loader: async () => (await import('./en/note.json')).default
loader: async () => (await import('i18n/en/note.json')).default
},
{
locale: 'ja',
key: 'note',
pathname: '/note',
loader: async () => (await import('./ja/note.json')).default
loader: async () => (await import('i18n/ja/note.json')).default
},
{
locale: 'en',
key: 'name-card',
pathname: '/namecard',
loader: async () => (await import('./en/name-card.json')).default
loader: async () => (await import('i18n/en/name-card.json')).default
},
{
locale: 'ja',
key: 'name-card',
pathname: '/namecard',
loader: async () => (await import('./ja/name-card.json')).default
loader: async () => (await import('i18n/ja/name-card.json')).default
}
]
};
Expand Down
5 changes: 4 additions & 1 deletion apps/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"disableSizeLimit": true
"disableSizeLimit": true,
"paths": {
"i18n/*": ["../../libs/i18n/*"]
}
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
Expand Down
2 changes: 2 additions & 0 deletions apps/client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { SvelteKitPWA } from '@vite-pwa/sveltekit';
import { join } from 'node:path';
// import { visualizer } from 'rollup-plugin-visualizer';
import type { UserConfig } from 'vite';
import { imagetools } from 'vite-imagetools';
Expand All @@ -23,6 +24,7 @@ const config: UserConfig = {
},
resolve: {
alias: {
i18n: join(__dirname, '../../libs/i18n/')
// 'three/addons': join(__dirname, '../../node_modules/three/examples/jsm/')
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions libs/i18n/en/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import aboutMe from './about-me.json';
import blog from './blog.json';
import common from './common.json';
import contact from './contact.json';
import home from './home.json';
import nameCard from './name-card.json';
import note from './note.json';
import project from './project.json';

export default {
'about-me': aboutMe,
blog: blog,
common: common,
contact: contact,
home: home,
'name-card': nameCard,
note: note,
project: project
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions libs/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import en from './en';
import ja from './ja';

export default {
en,
ja
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions libs/i18n/ja/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import aboutMe from './about-me.json';
import blog from './blog.json';
import common from './common.json';
import contact from './contact.json';
import home from './home.json';
import nameCard from './name-card.json';
import note from './note.json';
import project from './project.json';

export default {
'about-me': aboutMe,
blog: blog,
common: common,
contact: contact,
home: home,
'name-card': nameCard,
note: note,
project: project
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5b2f680

Please sign in to comment.