Advanced
Internationalization (i18n)
Multilingual support in gh-please
Internationalization (i18n)
gh-please supports multilingual output with automatic system language detection.
Supported Languages
- Korean (ko) - Full support
- English (en) - Default and fallback
Automatic Language Detection
The CLI automatically detects your system language from environment variables:
LANGLANGUAGELC_ALL
If any variable starts with ko, Korean messages are displayed. Otherwise, English is used.
Examples
Korean Output
LANG=ko_KR.UTF-8 gh please issue sub-issue list 123
Output:
π μμ μ΄μ #123 κ°μ Έμ€λ μ€...
β
μ±κ³΅μ μΌλ‘ νμ μ΄μλ₯Ό μ‘°ννμ΅λλ€.
μμ μ΄μ #123μ νμ μ΄μ:
β
#124 - κ²μ¦ λ‘μ§ μΆκ° (CLOSED)
π΅ #125 - ν
μ€νΈ μ
λ°μ΄νΈ (OPEN)
English Output
LANG=en_US.UTF-8 gh please issue sub-issue list 123
Output:
π Getting parent issue #123...
β
Successfully retrieved sub-issues.
Sub-issues of #123:
β
#124 - Add validation (CLOSED)
π΅ #125 - Update tests (OPEN)
Command Messages
All user-facing messages are internationalized:
Success Messages
// Korean
msg.success.subIssueCreated(101, 100)
// "β
νμ μ΄μ #101μ΄ μ±κ³΅μ μΌλ‘ μμ±λκ³ #100μ μ°κ²°λμμ΅λλ€."
// English
msg.success.subIssueCreated(101, 100)
// "β
Sub-issue #101 created and linked to #100 successfully."
Error Messages
// Korean
msg.error.issueNotFound(123)
// "β μ΄μ #123μ μ°Ύμ μ μμ΅λλ€."
// English
msg.error.issueNotFound(123)
// "β Issue #123 not found."
Progress Messages
// Korean
msg.progress.gettingIssue(123)
// "π μ΄μ #123 κ°μ Έμ€λ μ€..."
// English
msg.progress.gettingIssue(123)
// "π Getting issue #123..."
Implementation
Message Structure
Messages are organized by command group:
// src/lib/i18n.ts
export function getIssueMessages(lang: Language) {
return {
progress: {
gettingParentIssue: (num: number) =>
lang === 'ko'
? `π μμ μ΄μ #${num} κ°μ Έμ€λ μ€...`
: `π Getting parent issue #${num}...`,
},
success: {
subIssueCreated: (child: number, parent: number) =>
lang === 'ko'
? `β
νμ μ΄μ #${child}μ΄ μ±κ³΅μ μΌλ‘ μμ±λκ³ #${parent}μ μ°κ²°λμμ΅λλ€.`
: `β
Sub-issue #${child} created and linked to #${parent} successfully.`,
},
error: {
issueNotFound: (num: number) =>
lang === 'ko'
? `β μ΄μ #${num}μ μ°Ύμ μ μμ΅λλ€.`
: `β Issue #${num} not found.`,
},
}
}
Usage in Commands
import { detectSystemLanguage, getIssueMessages } from '../../lib/i18n'
const lang = detectSystemLanguage()
const msg = getIssueMessages(lang)
console.log(msg.progress.gettingParentIssue(123))
Coverage
Internationalized
β All command output messages β Success messages β Error messages β Progress indicators β Help text and descriptions
Not Internationalized
β οΈ GitHub API URLs β οΈ Git output β οΈ JSON/XML structured output β οΈ Technical error stack traces
Force Language
You can force a specific language by setting the environment variable:
# Force Korean
LANG=ko_KR.UTF-8 gh please issue sub-issue list 123
# Force English
LANG=en_US.UTF-8 gh please issue sub-issue list 123
# Also works with LANGUAGE
LANGUAGE=ko gh please issue sub-issue list 123
Adding New Languages
To add support for a new language:
- Update the
Languagetype insrc/types.ts:export type Language = 'ko' | 'en' | 'ja' // Add 'ja' for Japanese - Update language detection in
src/lib/i18n.ts:export function detectSystemLanguage(): Language { const lang = process.env.LANG || process.env.LANGUAGE || process.env.LC_ALL || 'en' if (lang.startsWith('ko')) return 'ko' if (lang.startsWith('ja')) return 'ja' // Add Japanese return 'en' } - Add translations to message functions:
export function getIssueMessages(lang: Language) { return { progress: { gettingParentIssue: (num: number) => { if (lang === 'ko') return `π μμ μ΄μ #${num} κ°μ Έμ€λ μ€...` if (lang === 'ja') return `π θ¦ͺγ€γ·γ₯γΌ #${num} γεεΎδΈ...` return `π Getting parent issue #${num}...` }, }, } }
Related
- Getting Started - Installation
- Issue Management - Issue commands
- PR Management - PR commands