Skip to content

Commit

Permalink
feat(ui): add Japanese translation from karokaro and Traditional Chin…
Browse files Browse the repository at this point in the history
…ese translation from HYA
  • Loading branch information
MichaelMakesGames committed Jun 1, 2024
1 parent 018f130 commit 2a9ebed
Show file tree
Hide file tree
Showing 5 changed files with 785 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ Stylized and customizable Stellaris maps

# Credits

Special thanks to the translators:

- HYA for Traditional Chinese
- karokaro for Japanese

The app icon is [Orbital](https://game-icons.net/1x1/lorc/orbital.html) by Lorc, licensed under [CC BY 3.0](http://creativecommons.org/licenses/by/3.0/).

Map icons are made by me. Basic shapes are released to the public domain, but others (Wormhole, Gateway, L-Gate, etc) are based on icons from the game Stellaris, and should not be used other than for tools or mods for the game.
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/src/intl/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import IntlMessageFormat, { type FormatXMLElementFn, type PrimitiveType } from 'intl-messageformat';
import { derived, writable } from 'svelte/store';
import enUS from './en-US';
import jaJP from './ja-JP';
import zhTW from './zh-TW';

type Paths<T> = T extends object
? {
Expand All @@ -23,6 +25,8 @@ function flattenMessages(messages: UnflattenedMessages, prefix = ''): Record<str

const locales = {
'en-US': flattenMessages(enUS) as Record<MessageID, string>,
'ja-JP': flattenMessages(jaJP) as Partial<Record<MessageID, string>>,
'zh-TW': flattenMessages(zhTW) as Partial<Record<MessageID, string>>,
ENGLISH: Object.fromEntries(
Object.entries(flattenMessages(enUS)).map(([k, v]) => [k, v.toUpperCase()]),
) as Partial<Record<MessageID, string>>,
Expand Down
Loading

0 comments on commit 2a9ebed

Please sign in to comment.