Skip to content

Commit 59759f3

Browse files
lwinmoepaingclaude
andcommitted
📝 docs: update README with i18n and Myanmar font documentation
Add Internationalization section with usage guide, Myanmar font guidelines, and translation instructions. Update Tech Stack, Features, and Project Structure to reflect bilingual support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e3a1bc4 commit 59759f3

1 file changed

Lines changed: 42 additions & 2 deletions

File tree

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ MMSWE is an open-source platform where Myanmar software engineers can showcase t
2727
- **Developer Profiles** — 116+ engineer profiles with tech stacks, bios, and custom MDX pages
2828
- **Blog Platform** — Technical articles written by community members
2929
- **Profile Editor** — In-browser tool to create your profile MDX file without writing code
30+
- **Myanmar & English** — Full bilingual support with EN/MM toggle, powered by next-intl
3031
- **Responsive Design** — Obsidian Prism dark theme with animated interactions
3132

3233
## Tech Stack
@@ -38,7 +39,8 @@ MMSWE is an open-source platform where Myanmar software engineers can showcase t
3839
| **Styling** | Tailwind CSS 3 + DaisyUI + Sass |
3940
| **Content** | Contentlayer2 with MDX |
4041
| **Animation** | Framer Motion, Three.js, React Three Fiber |
41-
| **Fonts** | Bricolage Grotesque, Plus Jakarta Sans, JetBrains Mono |
42+
| **i18n** | next-intl (Myanmar & English) |
43+
| **Fonts** | Bricolage Grotesque, Plus Jakarta Sans, JetBrains Mono, KhitHaungg (Myanmar) |
4244
| **Package Manager** | Bun |
4345
| **Deployment** | GitHub Pages via GitHub Actions |
4446

@@ -139,14 +141,20 @@ src/
139141
ProfileEditor/ # Profile creation tool components
140142
Contributors/ # Custom contributor page widgets
141143
Ui/ # Base UI elements
144+
context/ # React context (LanguageProvider)
142145
config/ # App configuration
143146
data/ # Static data & animation variants
144147
hooks/ # Custom React hooks
145148
styles/ # Global SCSS & Tailwind tokens
146149
utils/ # Utility functions
150+
i18n/ # next-intl configuration
151+
fonts/ # Local fonts (KhitHaungg Myanmar font)
147152
content/
148153
profile/ # Developer profile MDX files (116+)
149154
blog/ # Blog post MDX files
155+
messages/
156+
en.json # English translations
157+
mm.json # Myanmar translations
150158
```
151159

152160
## Design System
@@ -162,7 +170,39 @@ MMSWE uses the **Obsidian Prism** theme — a dark interface with prismatic acce
162170
| `prism-rose` | `#fb7185` | Tertiary accent |
163171
| `accent-gold` | `#fbbf24` | Highlight accent |
164172

165-
Typography uses **Bricolage Grotesque** for display, **Plus Jakarta Sans** for body, and **JetBrains Mono** for code.
173+
Typography uses **Bricolage Grotesque** for display, **Plus Jakarta Sans** for body, **JetBrains Mono** for code, and **KhitHaungg** for Myanmar script.
174+
175+
## Internationalization (i18n)
176+
177+
The site supports **Myanmar** and **English** with an EN/MM toggle in the Navbar. Localization is opt-in per component using [next-intl](https://next-intl.dev/).
178+
179+
### How it works
180+
181+
- **`LanguageProvider`** (`src/context/LanguageContext.tsx`) manages locale state with `useSyncExternalStore` + `localStorage` persistence
182+
- **`useLanguage`** hook (`src/hooks/useLanguage.ts`) provides `locale`, `setLocale`, `isMyanmar`, `isEnglish`
183+
- **Translation files** in `messages/en.json` and `messages/mm.json` with namespaced keys
184+
- **Myanmar font**: KhitHaungg (`src/fonts/khit-haungg/`) loaded via `next/font/local`, applied with `khitHaungg.className` when Myanmar is active
185+
186+
### Adding translations
187+
188+
1. Add keys to both `messages/en.json` and `messages/mm.json` under a namespace
189+
2. In your component, use `useTranslations("namespace")` and `useLanguage()`:
190+
191+
```tsx
192+
const t = useTranslations("mySection");
193+
const { isMyanmar } = useLanguage();
194+
const mmFont = isMyanmar ? khitHaungg.className : "";
195+
196+
return <h1 className={mmFont}>{t("title")}</h1>;
197+
```
198+
199+
### Myanmar font guidelines
200+
201+
- Use `khitHaungg.className` directly (not Tailwind `font-myanmar` class)
202+
- Avoid `bg-clip-text text-transparent` for Myanmar text — use solid colors instead (e.g. `text-prism-cyan`)
203+
- Remove `overflow-hidden` from parent containers when Myanmar is active
204+
- Use `leading-[1.6]` with `py-2` for large Myanmar headings
205+
- Disable character-by-character `AnimateText` for Myanmar — render plain text instead
166206

167207
## Contributing
168208

0 commit comments

Comments
 (0)