2024-05-23 16:03:10 +01:00
|
|
|
import i18next from "i18next";
|
|
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
2024-06-04 02:38:52 +01:00
|
|
|
import processor, { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor";
|
2024-05-23 16:03:10 +01:00
|
|
|
|
|
|
|
import { deConfig } from "#app/locales/de/config.js";
|
|
|
|
import { enConfig } from "#app/locales/en/config.js";
|
|
|
|
import { esConfig } from "#app/locales/es/config.js";
|
|
|
|
import { frConfig } from "#app/locales/fr/config.js";
|
|
|
|
import { itConfig } from "#app/locales/it/config.js";
|
2024-06-02 00:53:13 +01:00
|
|
|
import { koConfig } from "#app/locales/ko/config.js";
|
2024-05-23 16:03:10 +01:00
|
|
|
import { ptBrConfig } from "#app/locales/pt_BR/config.js";
|
|
|
|
import { zhCnConfig } from "#app/locales/zh_CN/config.js";
|
2024-06-02 00:53:13 +01:00
|
|
|
import { zhTwConfig } from "#app/locales/zh_TW/config.js";
|
2024-05-23 13:01:22 +01:00
|
|
|
|
2024-04-22 00:53:24 +01:00
|
|
|
export interface SimpleTranslationEntries {
|
|
|
|
[key: string]: string
|
|
|
|
}
|
|
|
|
|
2024-04-18 13:40:42 +01:00
|
|
|
export interface MoveTranslationEntry {
|
|
|
|
name: string,
|
|
|
|
effect: string
|
|
|
|
}
|
|
|
|
|
2024-04-22 00:53:24 +01:00
|
|
|
export interface MoveTranslationEntries {
|
2024-04-18 13:40:42 +01:00
|
|
|
[key: string]: MoveTranslationEntry
|
|
|
|
}
|
|
|
|
|
2024-04-25 02:10:09 +01:00
|
|
|
export interface AbilityTranslationEntry {
|
|
|
|
name: string,
|
|
|
|
description: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AbilityTranslationEntries {
|
|
|
|
[key: string]: AbilityTranslationEntry
|
|
|
|
}
|
|
|
|
|
2024-05-16 05:32:45 +01:00
|
|
|
export interface ModifierTypeTranslationEntry {
|
|
|
|
name?: string,
|
|
|
|
description?: string,
|
|
|
|
extra?: SimpleTranslationEntries
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModifierTypeTranslationEntries {
|
|
|
|
ModifierType: { [key: string]: ModifierTypeTranslationEntry },
|
|
|
|
AttackTypeBoosterItem: SimpleTranslationEntries,
|
|
|
|
TempBattleStatBoosterItem: SimpleTranslationEntries,
|
|
|
|
BaseStatBoosterItem: SimpleTranslationEntries,
|
|
|
|
EvolutionItem: SimpleTranslationEntries,
|
|
|
|
FormChangeItem: SimpleTranslationEntries,
|
2024-05-17 15:43:11 +01:00
|
|
|
}
|
|
|
|
export interface PokemonInfoTranslationEntries {
|
|
|
|
Stat: SimpleTranslationEntries,
|
|
|
|
Type: SimpleTranslationEntries,
|
2024-05-16 05:32:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-17 11:09:08 +01:00
|
|
|
export interface BerryTranslationEntry {
|
|
|
|
name: string,
|
2024-06-02 00:53:13 +01:00
|
|
|
effect: string,
|
2024-05-17 11:09:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface BerryTranslationEntries {
|
|
|
|
[key: string]: BerryTranslationEntry
|
|
|
|
}
|
|
|
|
|
2024-06-02 00:53:13 +01:00
|
|
|
export interface AchievementTranslationEntry {
|
|
|
|
name?: string,
|
|
|
|
description?: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AchievementTranslationEntries {
|
|
|
|
[key: string]: AchievementTranslationEntry;
|
|
|
|
}
|
|
|
|
|
2024-05-27 12:14:37 +01:00
|
|
|
export interface DialogueTranslationEntry {
|
|
|
|
[key: number]: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DialogueTranslationCategory {
|
2024-05-28 17:32:01 +01:00
|
|
|
[category: string]: DialogueTranslationEntry;
|
2024-05-27 12:14:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DialogueTranslationEntries {
|
2024-05-28 17:32:01 +01:00
|
|
|
[trainertype: string]: DialogueTranslationCategory;
|
2024-05-27 12:14:37 +01:00
|
|
|
}
|
|
|
|
|
2024-05-28 17:32:01 +01:00
|
|
|
|
2024-04-19 19:55:01 +01:00
|
|
|
export interface Localizable {
|
|
|
|
localize(): void;
|
|
|
|
}
|
|
|
|
|
Add Korean Locale (#737)
* Add korean locale without translation
* Translate ability,move,pokemon to Korean
* Translate miscellaneous to Korean
* Add Accuracy in the fight ui to Korean
* Apply nature,growth rate lang files to Korean
* Add missed file import to Korean config.ts
* Add font and its license for Korean then Apply it
pokemon-dppt from FontStruction and its license
* Translate any other lang file to Korean
* Cleanup Korean locale files
Indentation for pokemon and starter-select-ui-handler
Make config shoft
* Update Korean translation for the latest commits
ToggleSize dependency e4d3f73d,
+ Align togglesize locale text
Frisk description 6d73500a
Starter select UI 34a4f869, 74ee3329
Add ability triggers locale file 1c56efc8
Zippy Zap description 4e279224
* Implement locale font loading
Revert multiple font usage from style fe7fe845
Dynamic font loading on language changed
* Translate new localization parts to Korean
Return to title become save and quit
menu-ui-handler.ts ac2e7812
Generation text added
starter-select-ui-handler.ts afcffab9
Missing translations for learning move
battles.ts:countdownPoof, learnMoveAnd 44c0d29c
Weather & evolution texts translated
config.ts, weather.ts, menu.ts b8dff030
Added modifier type file for item translate
config.ts, modifier-type.ts b5ae8330, b82b8c31
Egg gatcha machine is now Korean
config.ts, egg.ts 975d1ed5
Add splash message literals to locales
config.ts, splash-messages.ts 8dce9fa2
Trainers are also localized
config.ts, trainers.ts b06190c4, 7f003d46, 364b19df
Double battle trainers appeared
battle.ts:trainerAppearedDouble f1e97f3b
* Small patches to Korean translations
Include generation consistency (learnMovePrompt, eggHatching),
wrong space (learnMoveReplaceQuestion),
missing word (learnMoveNotLearned),
match to modifier-type.ts (ivScannerUseQuestion),
and match to english and else (bossAppeared)
* Apply edits to Korean translation
Re-order config.ts 3f571a36
Fix splash message attribute to fixed config 429e6635
* Corrections and new text for Korean translations
Trainer misstypo correction 0cd305d7
trainer.ts
BerryType localization 25014208
config.ts, berry.ts
IV scanner updated 96af567c
config.ts, battle-message-ui-handler.ts
Melt stat and type into info 3cc9c93
config.ts, modifier-type.ts pokemon-stat.ts -> pokemon-info.ts
* Update Korean locale up to date
Larry and Lance are now unique 93dee06e
Trainer names errors about 'poké' 49adedbc, 13f2cafe
Wrong text edit for maylene
trainers.ts
Egg voucher translation 7216990d
config.ts, voucher.ts
Cleanup starter select ui handler ca1ae4b5, b95a59c0
starter-select-ui-handler.ts
Correct text overflow
tutorial.ts
* Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
* Update Korean translations
* Apply updated text
Berry pouch 8b4aa872
modifier-type.ts
Acrobatics 0d614526
move.ts
failedToLoadSaveData 32fadf8c
menu.ts
HoneyGather caeb22c2
ability.ts
* Apply added Text
Plates and Memories f914b8fe
modifier-type.ts
trainerSendOut, moneyWon, partyFull 79af1152
battle.ts
gym_leader_double, champion_double, Double Names aaa95ebe
elite_four_female, champion_female ac2f7755
trainers.ts
* Apply new locale category implement
Biomes de1c2b2b
config.ts, biome.ts
Trainer dialogue ac2f7755, d23d8356
config.ts, dialogue.ts
Statistics 6d2b8ef2
config.ts, game-stats-ui-handler
Info Container fb26b6d5
config.ts, pokemon-info-container.ts
* Recover coding style
include 2-space-indentation
* Add Korean Font
No more license text file
* Add missing config to Korean
* Fix ESLint failure on Korean
* Fix ESLint failure on Korean 2
* Update to Main Localization Changes
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-30 00:05:14 +01:00
|
|
|
const alternativeFonts = {
|
|
|
|
"ko": [
|
2024-05-30 18:51:58 +01:00
|
|
|
new FontFace("emerald", "url(./fonts/PokePT_Wansung.ttf)"),
|
Add Korean Locale (#737)
* Add korean locale without translation
* Translate ability,move,pokemon to Korean
* Translate miscellaneous to Korean
* Add Accuracy in the fight ui to Korean
* Apply nature,growth rate lang files to Korean
* Add missed file import to Korean config.ts
* Add font and its license for Korean then Apply it
pokemon-dppt from FontStruction and its license
* Translate any other lang file to Korean
* Cleanup Korean locale files
Indentation for pokemon and starter-select-ui-handler
Make config shoft
* Update Korean translation for the latest commits
ToggleSize dependency e4d3f73d,
+ Align togglesize locale text
Frisk description 6d73500a
Starter select UI 34a4f869, 74ee3329
Add ability triggers locale file 1c56efc8
Zippy Zap description 4e279224
* Implement locale font loading
Revert multiple font usage from style fe7fe845
Dynamic font loading on language changed
* Translate new localization parts to Korean
Return to title become save and quit
menu-ui-handler.ts ac2e7812
Generation text added
starter-select-ui-handler.ts afcffab9
Missing translations for learning move
battles.ts:countdownPoof, learnMoveAnd 44c0d29c
Weather & evolution texts translated
config.ts, weather.ts, menu.ts b8dff030
Added modifier type file for item translate
config.ts, modifier-type.ts b5ae8330, b82b8c31
Egg gatcha machine is now Korean
config.ts, egg.ts 975d1ed5
Add splash message literals to locales
config.ts, splash-messages.ts 8dce9fa2
Trainers are also localized
config.ts, trainers.ts b06190c4, 7f003d46, 364b19df
Double battle trainers appeared
battle.ts:trainerAppearedDouble f1e97f3b
* Small patches to Korean translations
Include generation consistency (learnMovePrompt, eggHatching),
wrong space (learnMoveReplaceQuestion),
missing word (learnMoveNotLearned),
match to modifier-type.ts (ivScannerUseQuestion),
and match to english and else (bossAppeared)
* Apply edits to Korean translation
Re-order config.ts 3f571a36
Fix splash message attribute to fixed config 429e6635
* Corrections and new text for Korean translations
Trainer misstypo correction 0cd305d7
trainer.ts
BerryType localization 25014208
config.ts, berry.ts
IV scanner updated 96af567c
config.ts, battle-message-ui-handler.ts
Melt stat and type into info 3cc9c93
config.ts, modifier-type.ts pokemon-stat.ts -> pokemon-info.ts
* Update Korean locale up to date
Larry and Lance are now unique 93dee06e
Trainer names errors about 'poké' 49adedbc, 13f2cafe
Wrong text edit for maylene
trainers.ts
Egg voucher translation 7216990d
config.ts, voucher.ts
Cleanup starter select ui handler ca1ae4b5, b95a59c0
starter-select-ui-handler.ts
Correct text overflow
tutorial.ts
* Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
* Update Korean translations
* Apply updated text
Berry pouch 8b4aa872
modifier-type.ts
Acrobatics 0d614526
move.ts
failedToLoadSaveData 32fadf8c
menu.ts
HoneyGather caeb22c2
ability.ts
* Apply added Text
Plates and Memories f914b8fe
modifier-type.ts
trainerSendOut, moneyWon, partyFull 79af1152
battle.ts
gym_leader_double, champion_double, Double Names aaa95ebe
elite_four_female, champion_female ac2f7755
trainers.ts
* Apply new locale category implement
Biomes de1c2b2b
config.ts, biome.ts
Trainer dialogue ac2f7755, d23d8356
config.ts, dialogue.ts
Statistics 6d2b8ef2
config.ts, game-stats-ui-handler
Info Container fb26b6d5
config.ts, pokemon-info-container.ts
* Recover coding style
include 2-space-indentation
* Add Korean Font
No more license text file
* Add missing config to Korean
* Fix ESLint failure on Korean
* Fix ESLint failure on Korean 2
* Update to Main Localization Changes
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-30 00:05:14 +01:00
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
function loadFont(language: string) {
|
|
|
|
if (!alternativeFonts[language]) {
|
|
|
|
language = language.split(/[-_/]/)[0];
|
|
|
|
}
|
|
|
|
if (alternativeFonts[language]) {
|
2024-05-30 18:51:58 +01:00
|
|
|
alternativeFonts[language].forEach((fontFace: FontFace) => {
|
|
|
|
document.fonts.add(fontFace);
|
Add Korean Locale (#737)
* Add korean locale without translation
* Translate ability,move,pokemon to Korean
* Translate miscellaneous to Korean
* Add Accuracy in the fight ui to Korean
* Apply nature,growth rate lang files to Korean
* Add missed file import to Korean config.ts
* Add font and its license for Korean then Apply it
pokemon-dppt from FontStruction and its license
* Translate any other lang file to Korean
* Cleanup Korean locale files
Indentation for pokemon and starter-select-ui-handler
Make config shoft
* Update Korean translation for the latest commits
ToggleSize dependency e4d3f73d,
+ Align togglesize locale text
Frisk description 6d73500a
Starter select UI 34a4f869, 74ee3329
Add ability triggers locale file 1c56efc8
Zippy Zap description 4e279224
* Implement locale font loading
Revert multiple font usage from style fe7fe845
Dynamic font loading on language changed
* Translate new localization parts to Korean
Return to title become save and quit
menu-ui-handler.ts ac2e7812
Generation text added
starter-select-ui-handler.ts afcffab9
Missing translations for learning move
battles.ts:countdownPoof, learnMoveAnd 44c0d29c
Weather & evolution texts translated
config.ts, weather.ts, menu.ts b8dff030
Added modifier type file for item translate
config.ts, modifier-type.ts b5ae8330, b82b8c31
Egg gatcha machine is now Korean
config.ts, egg.ts 975d1ed5
Add splash message literals to locales
config.ts, splash-messages.ts 8dce9fa2
Trainers are also localized
config.ts, trainers.ts b06190c4, 7f003d46, 364b19df
Double battle trainers appeared
battle.ts:trainerAppearedDouble f1e97f3b
* Small patches to Korean translations
Include generation consistency (learnMovePrompt, eggHatching),
wrong space (learnMoveReplaceQuestion),
missing word (learnMoveNotLearned),
match to modifier-type.ts (ivScannerUseQuestion),
and match to english and else (bossAppeared)
* Apply edits to Korean translation
Re-order config.ts 3f571a36
Fix splash message attribute to fixed config 429e6635
* Corrections and new text for Korean translations
Trainer misstypo correction 0cd305d7
trainer.ts
BerryType localization 25014208
config.ts, berry.ts
IV scanner updated 96af567c
config.ts, battle-message-ui-handler.ts
Melt stat and type into info 3cc9c93
config.ts, modifier-type.ts pokemon-stat.ts -> pokemon-info.ts
* Update Korean locale up to date
Larry and Lance are now unique 93dee06e
Trainer names errors about 'poké' 49adedbc, 13f2cafe
Wrong text edit for maylene
trainers.ts
Egg voucher translation 7216990d
config.ts, voucher.ts
Cleanup starter select ui handler ca1ae4b5, b95a59c0
starter-select-ui-handler.ts
Correct text overflow
tutorial.ts
* Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
* Update Korean translations
* Apply updated text
Berry pouch 8b4aa872
modifier-type.ts
Acrobatics 0d614526
move.ts
failedToLoadSaveData 32fadf8c
menu.ts
HoneyGather caeb22c2
ability.ts
* Apply added Text
Plates and Memories f914b8fe
modifier-type.ts
trainerSendOut, moneyWon, partyFull 79af1152
battle.ts
gym_leader_double, champion_double, Double Names aaa95ebe
elite_four_female, champion_female ac2f7755
trainers.ts
* Apply new locale category implement
Biomes de1c2b2b
config.ts, biome.ts
Trainer dialogue ac2f7755, d23d8356
config.ts, dialogue.ts
Statistics 6d2b8ef2
config.ts, game-stats-ui-handler
Info Container fb26b6d5
config.ts, pokemon-info-container.ts
* Recover coding style
include 2-space-indentation
* Add Korean Font
No more license text file
* Add missing config to Korean
* Fix ESLint failure on Korean
* Fix ESLint failure on Korean 2
* Update to Main Localization Changes
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-30 00:05:14 +01:00
|
|
|
});
|
2024-05-30 18:51:58 +01:00
|
|
|
|
|
|
|
const altFontLanguages = Object.keys(alternativeFonts);
|
Add Korean Locale (#737)
* Add korean locale without translation
* Translate ability,move,pokemon to Korean
* Translate miscellaneous to Korean
* Add Accuracy in the fight ui to Korean
* Apply nature,growth rate lang files to Korean
* Add missed file import to Korean config.ts
* Add font and its license for Korean then Apply it
pokemon-dppt from FontStruction and its license
* Translate any other lang file to Korean
* Cleanup Korean locale files
Indentation for pokemon and starter-select-ui-handler
Make config shoft
* Update Korean translation for the latest commits
ToggleSize dependency e4d3f73d,
+ Align togglesize locale text
Frisk description 6d73500a
Starter select UI 34a4f869, 74ee3329
Add ability triggers locale file 1c56efc8
Zippy Zap description 4e279224
* Implement locale font loading
Revert multiple font usage from style fe7fe845
Dynamic font loading on language changed
* Translate new localization parts to Korean
Return to title become save and quit
menu-ui-handler.ts ac2e7812
Generation text added
starter-select-ui-handler.ts afcffab9
Missing translations for learning move
battles.ts:countdownPoof, learnMoveAnd 44c0d29c
Weather & evolution texts translated
config.ts, weather.ts, menu.ts b8dff030
Added modifier type file for item translate
config.ts, modifier-type.ts b5ae8330, b82b8c31
Egg gatcha machine is now Korean
config.ts, egg.ts 975d1ed5
Add splash message literals to locales
config.ts, splash-messages.ts 8dce9fa2
Trainers are also localized
config.ts, trainers.ts b06190c4, 7f003d46, 364b19df
Double battle trainers appeared
battle.ts:trainerAppearedDouble f1e97f3b
* Small patches to Korean translations
Include generation consistency (learnMovePrompt, eggHatching),
wrong space (learnMoveReplaceQuestion),
missing word (learnMoveNotLearned),
match to modifier-type.ts (ivScannerUseQuestion),
and match to english and else (bossAppeared)
* Apply edits to Korean translation
Re-order config.ts 3f571a36
Fix splash message attribute to fixed config 429e6635
* Corrections and new text for Korean translations
Trainer misstypo correction 0cd305d7
trainer.ts
BerryType localization 25014208
config.ts, berry.ts
IV scanner updated 96af567c
config.ts, battle-message-ui-handler.ts
Melt stat and type into info 3cc9c93
config.ts, modifier-type.ts pokemon-stat.ts -> pokemon-info.ts
* Update Korean locale up to date
Larry and Lance are now unique 93dee06e
Trainer names errors about 'poké' 49adedbc, 13f2cafe
Wrong text edit for maylene
trainers.ts
Egg voucher translation 7216990d
config.ts, voucher.ts
Cleanup starter select ui handler ca1ae4b5, b95a59c0
starter-select-ui-handler.ts
Correct text overflow
tutorial.ts
* Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
* Update Korean translations
* Apply updated text
Berry pouch 8b4aa872
modifier-type.ts
Acrobatics 0d614526
move.ts
failedToLoadSaveData 32fadf8c
menu.ts
HoneyGather caeb22c2
ability.ts
* Apply added Text
Plates and Memories f914b8fe
modifier-type.ts
trainerSendOut, moneyWon, partyFull 79af1152
battle.ts
gym_leader_double, champion_double, Double Names aaa95ebe
elite_four_female, champion_female ac2f7755
trainers.ts
* Apply new locale category implement
Biomes de1c2b2b
config.ts, biome.ts
Trainer dialogue ac2f7755, d23d8356
config.ts, dialogue.ts
Statistics 6d2b8ef2
config.ts, game-stats-ui-handler
Info Container fb26b6d5
config.ts, pokemon-info-container.ts
* Recover coding style
include 2-space-indentation
* Add Korean Font
No more license text file
* Add missing config to Korean
* Fix ESLint failure on Korean
* Fix ESLint failure on Korean 2
* Update to Main Localization Changes
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-30 00:05:14 +01:00
|
|
|
altFontLanguages.splice(altFontLanguages.indexOf(language), 0);
|
|
|
|
}
|
2024-05-30 18:51:58 +01:00
|
|
|
|
|
|
|
(Object.values(alternativeFonts)).forEach(fontFaces => {
|
|
|
|
fontFaces.forEach(fontFace => {
|
|
|
|
if (fontFace && fontFace.status === "loaded") {
|
|
|
|
document.fonts.delete(fontFace);
|
|
|
|
}
|
|
|
|
});
|
Add Korean Locale (#737)
* Add korean locale without translation
* Translate ability,move,pokemon to Korean
* Translate miscellaneous to Korean
* Add Accuracy in the fight ui to Korean
* Apply nature,growth rate lang files to Korean
* Add missed file import to Korean config.ts
* Add font and its license for Korean then Apply it
pokemon-dppt from FontStruction and its license
* Translate any other lang file to Korean
* Cleanup Korean locale files
Indentation for pokemon and starter-select-ui-handler
Make config shoft
* Update Korean translation for the latest commits
ToggleSize dependency e4d3f73d,
+ Align togglesize locale text
Frisk description 6d73500a
Starter select UI 34a4f869, 74ee3329
Add ability triggers locale file 1c56efc8
Zippy Zap description 4e279224
* Implement locale font loading
Revert multiple font usage from style fe7fe845
Dynamic font loading on language changed
* Translate new localization parts to Korean
Return to title become save and quit
menu-ui-handler.ts ac2e7812
Generation text added
starter-select-ui-handler.ts afcffab9
Missing translations for learning move
battles.ts:countdownPoof, learnMoveAnd 44c0d29c
Weather & evolution texts translated
config.ts, weather.ts, menu.ts b8dff030
Added modifier type file for item translate
config.ts, modifier-type.ts b5ae8330, b82b8c31
Egg gatcha machine is now Korean
config.ts, egg.ts 975d1ed5
Add splash message literals to locales
config.ts, splash-messages.ts 8dce9fa2
Trainers are also localized
config.ts, trainers.ts b06190c4, 7f003d46, 364b19df
Double battle trainers appeared
battle.ts:trainerAppearedDouble f1e97f3b
* Small patches to Korean translations
Include generation consistency (learnMovePrompt, eggHatching),
wrong space (learnMoveReplaceQuestion),
missing word (learnMoveNotLearned),
match to modifier-type.ts (ivScannerUseQuestion),
and match to english and else (bossAppeared)
* Apply edits to Korean translation
Re-order config.ts 3f571a36
Fix splash message attribute to fixed config 429e6635
* Corrections and new text for Korean translations
Trainer misstypo correction 0cd305d7
trainer.ts
BerryType localization 25014208
config.ts, berry.ts
IV scanner updated 96af567c
config.ts, battle-message-ui-handler.ts
Melt stat and type into info 3cc9c93
config.ts, modifier-type.ts pokemon-stat.ts -> pokemon-info.ts
* Update Korean locale up to date
Larry and Lance are now unique 93dee06e
Trainer names errors about 'poké' 49adedbc, 13f2cafe
Wrong text edit for maylene
trainers.ts
Egg voucher translation 7216990d
config.ts, voucher.ts
Cleanup starter select ui handler ca1ae4b5, b95a59c0
starter-select-ui-handler.ts
Correct text overflow
tutorial.ts
* Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
* Update Korean translations
* Apply updated text
Berry pouch 8b4aa872
modifier-type.ts
Acrobatics 0d614526
move.ts
failedToLoadSaveData 32fadf8c
menu.ts
HoneyGather caeb22c2
ability.ts
* Apply added Text
Plates and Memories f914b8fe
modifier-type.ts
trainerSendOut, moneyWon, partyFull 79af1152
battle.ts
gym_leader_double, champion_double, Double Names aaa95ebe
elite_four_female, champion_female ac2f7755
trainers.ts
* Apply new locale category implement
Biomes de1c2b2b
config.ts, biome.ts
Trainer dialogue ac2f7755, d23d8356
config.ts, dialogue.ts
Statistics 6d2b8ef2
config.ts, game-stats-ui-handler
Info Container fb26b6d5
config.ts, pokemon-info-container.ts
* Recover coding style
include 2-space-indentation
* Add Korean Font
No more license text file
* Add missing config to Korean
* Fix ESLint failure on Korean
* Fix ESLint failure on Korean 2
* Update to Main Localization Changes
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-30 00:05:14 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-04-19 19:55:01 +01:00
|
|
|
export function initI18n(): void {
|
2024-05-16 10:05:25 +01:00
|
|
|
// Prevent reinitialization
|
|
|
|
if (isInitialized) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
isInitialized = true;
|
2024-05-23 16:03:10 +01:00
|
|
|
let lang = "";
|
2024-04-19 19:55:01 +01:00
|
|
|
|
2024-05-23 16:03:10 +01:00
|
|
|
if (localStorage.getItem("prLang")) {
|
|
|
|
lang = localStorage.getItem("prLang");
|
|
|
|
}
|
2024-04-12 04:47:03 +01:00
|
|
|
|
Add Korean Locale (#737)
* Add korean locale without translation
* Translate ability,move,pokemon to Korean
* Translate miscellaneous to Korean
* Add Accuracy in the fight ui to Korean
* Apply nature,growth rate lang files to Korean
* Add missed file import to Korean config.ts
* Add font and its license for Korean then Apply it
pokemon-dppt from FontStruction and its license
* Translate any other lang file to Korean
* Cleanup Korean locale files
Indentation for pokemon and starter-select-ui-handler
Make config shoft
* Update Korean translation for the latest commits
ToggleSize dependency e4d3f73d,
+ Align togglesize locale text
Frisk description 6d73500a
Starter select UI 34a4f869, 74ee3329
Add ability triggers locale file 1c56efc8
Zippy Zap description 4e279224
* Implement locale font loading
Revert multiple font usage from style fe7fe845
Dynamic font loading on language changed
* Translate new localization parts to Korean
Return to title become save and quit
menu-ui-handler.ts ac2e7812
Generation text added
starter-select-ui-handler.ts afcffab9
Missing translations for learning move
battles.ts:countdownPoof, learnMoveAnd 44c0d29c
Weather & evolution texts translated
config.ts, weather.ts, menu.ts b8dff030
Added modifier type file for item translate
config.ts, modifier-type.ts b5ae8330, b82b8c31
Egg gatcha machine is now Korean
config.ts, egg.ts 975d1ed5
Add splash message literals to locales
config.ts, splash-messages.ts 8dce9fa2
Trainers are also localized
config.ts, trainers.ts b06190c4, 7f003d46, 364b19df
Double battle trainers appeared
battle.ts:trainerAppearedDouble f1e97f3b
* Small patches to Korean translations
Include generation consistency (learnMovePrompt, eggHatching),
wrong space (learnMoveReplaceQuestion),
missing word (learnMoveNotLearned),
match to modifier-type.ts (ivScannerUseQuestion),
and match to english and else (bossAppeared)
* Apply edits to Korean translation
Re-order config.ts 3f571a36
Fix splash message attribute to fixed config 429e6635
* Corrections and new text for Korean translations
Trainer misstypo correction 0cd305d7
trainer.ts
BerryType localization 25014208
config.ts, berry.ts
IV scanner updated 96af567c
config.ts, battle-message-ui-handler.ts
Melt stat and type into info 3cc9c93
config.ts, modifier-type.ts pokemon-stat.ts -> pokemon-info.ts
* Update Korean locale up to date
Larry and Lance are now unique 93dee06e
Trainer names errors about 'poké' 49adedbc, 13f2cafe
Wrong text edit for maylene
trainers.ts
Egg voucher translation 7216990d
config.ts, voucher.ts
Cleanup starter select ui handler ca1ae4b5, b95a59c0
starter-select-ui-handler.ts
Correct text overflow
tutorial.ts
* Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
* Update Korean translations
* Apply updated text
Berry pouch 8b4aa872
modifier-type.ts
Acrobatics 0d614526
move.ts
failedToLoadSaveData 32fadf8c
menu.ts
HoneyGather caeb22c2
ability.ts
* Apply added Text
Plates and Memories f914b8fe
modifier-type.ts
trainerSendOut, moneyWon, partyFull 79af1152
battle.ts
gym_leader_double, champion_double, Double Names aaa95ebe
elite_four_female, champion_female ac2f7755
trainers.ts
* Apply new locale category implement
Biomes de1c2b2b
config.ts, biome.ts
Trainer dialogue ac2f7755, d23d8356
config.ts, dialogue.ts
Statistics 6d2b8ef2
config.ts, game-stats-ui-handler
Info Container fb26b6d5
config.ts, pokemon-info-container.ts
* Recover coding style
include 2-space-indentation
* Add Korean Font
No more license text file
* Add missing config to Korean
* Fix ESLint failure on Korean
* Fix ESLint failure on Korean 2
* Update to Main Localization Changes
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-30 00:05:14 +01:00
|
|
|
loadFont(lang);
|
|
|
|
i18next.on("languageChanged", lng=> {
|
|
|
|
loadFont(lng);
|
|
|
|
});
|
2024-05-16 10:05:25 +01:00
|
|
|
|
2024-04-19 19:55:01 +01:00
|
|
|
/**
|
|
|
|
* i18next is a localization library for maintaining and using translation resources.
|
2024-04-25 23:54:56 +01:00
|
|
|
*
|
2024-04-19 19:55:01 +01:00
|
|
|
* Q: How do I add a new language?
|
|
|
|
* A: To add a new language, create a new folder in the locales directory with the language code.
|
|
|
|
* Each language folder should contain a file for each namespace (ex. menu.ts) with the translations.
|
2024-04-30 16:07:15 +01:00
|
|
|
* Don't forget to declare new language in `supportedLngs` i18next initializer
|
2024-04-25 23:54:56 +01:00
|
|
|
*
|
2024-04-19 19:55:01 +01:00
|
|
|
* Q: How do I add a new namespace?
|
|
|
|
* A: To add a new namespace, create a new file in each language folder with the translations.
|
|
|
|
* Then update the `resources` field in the init() call and the CustomTypeOptions interface.
|
2024-04-30 16:07:15 +01:00
|
|
|
*
|
2024-04-25 22:24:53 +01:00
|
|
|
* Q: How do I make a language selectable in the settings?
|
|
|
|
* A: In src/system/settings.ts, add a new case to the Setting.Language switch statement.
|
2024-04-19 19:55:01 +01:00
|
|
|
*/
|
|
|
|
|
2024-06-04 02:38:52 +01:00
|
|
|
i18next.use(LanguageDetector).use(processor).use(new KoreanPostpositionProcessor()).init({
|
2024-04-30 16:07:15 +01:00
|
|
|
lng: lang,
|
2024-05-21 04:26:53 +01:00
|
|
|
nonExplicitSupportedLngs: true,
|
2024-05-23 16:03:10 +01:00
|
|
|
fallbackLng: "en",
|
Add Korean Locale (#737)
* Add korean locale without translation
* Translate ability,move,pokemon to Korean
* Translate miscellaneous to Korean
* Add Accuracy in the fight ui to Korean
* Apply nature,growth rate lang files to Korean
* Add missed file import to Korean config.ts
* Add font and its license for Korean then Apply it
pokemon-dppt from FontStruction and its license
* Translate any other lang file to Korean
* Cleanup Korean locale files
Indentation for pokemon and starter-select-ui-handler
Make config shoft
* Update Korean translation for the latest commits
ToggleSize dependency e4d3f73d,
+ Align togglesize locale text
Frisk description 6d73500a
Starter select UI 34a4f869, 74ee3329
Add ability triggers locale file 1c56efc8
Zippy Zap description 4e279224
* Implement locale font loading
Revert multiple font usage from style fe7fe845
Dynamic font loading on language changed
* Translate new localization parts to Korean
Return to title become save and quit
menu-ui-handler.ts ac2e7812
Generation text added
starter-select-ui-handler.ts afcffab9
Missing translations for learning move
battles.ts:countdownPoof, learnMoveAnd 44c0d29c
Weather & evolution texts translated
config.ts, weather.ts, menu.ts b8dff030
Added modifier type file for item translate
config.ts, modifier-type.ts b5ae8330, b82b8c31
Egg gatcha machine is now Korean
config.ts, egg.ts 975d1ed5
Add splash message literals to locales
config.ts, splash-messages.ts 8dce9fa2
Trainers are also localized
config.ts, trainers.ts b06190c4, 7f003d46, 364b19df
Double battle trainers appeared
battle.ts:trainerAppearedDouble f1e97f3b
* Small patches to Korean translations
Include generation consistency (learnMovePrompt, eggHatching),
wrong space (learnMoveReplaceQuestion),
missing word (learnMoveNotLearned),
match to modifier-type.ts (ivScannerUseQuestion),
and match to english and else (bossAppeared)
* Apply edits to Korean translation
Re-order config.ts 3f571a36
Fix splash message attribute to fixed config 429e6635
* Corrections and new text for Korean translations
Trainer misstypo correction 0cd305d7
trainer.ts
BerryType localization 25014208
config.ts, berry.ts
IV scanner updated 96af567c
config.ts, battle-message-ui-handler.ts
Melt stat and type into info 3cc9c93
config.ts, modifier-type.ts pokemon-stat.ts -> pokemon-info.ts
* Update Korean locale up to date
Larry and Lance are now unique 93dee06e
Trainer names errors about 'poké' 49adedbc, 13f2cafe
Wrong text edit for maylene
trainers.ts
Egg voucher translation 7216990d
config.ts, voucher.ts
Cleanup starter select ui handler ca1ae4b5, b95a59c0
starter-select-ui-handler.ts
Correct text overflow
tutorial.ts
* Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
* Update Korean translations
* Apply updated text
Berry pouch 8b4aa872
modifier-type.ts
Acrobatics 0d614526
move.ts
failedToLoadSaveData 32fadf8c
menu.ts
HoneyGather caeb22c2
ability.ts
* Apply added Text
Plates and Memories f914b8fe
modifier-type.ts
trainerSendOut, moneyWon, partyFull 79af1152
battle.ts
gym_leader_double, champion_double, Double Names aaa95ebe
elite_four_female, champion_female ac2f7755
trainers.ts
* Apply new locale category implement
Biomes de1c2b2b
config.ts, biome.ts
Trainer dialogue ac2f7755, d23d8356
config.ts, dialogue.ts
Statistics 6d2b8ef2
config.ts, game-stats-ui-handler
Info Container fb26b6d5
config.ts, pokemon-info-container.ts
* Recover coding style
include 2-space-indentation
* Add Korean Font
No more license text file
* Add missing config to Korean
* Fix ESLint failure on Korean
* Fix ESLint failure on Korean 2
* Update to Main Localization Changes
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-30 00:05:14 +01:00
|
|
|
supportedLngs: ["en", "es", "fr", "it", "de", "zh", "pt", "ko"],
|
2024-04-19 19:55:01 +01:00
|
|
|
debug: true,
|
|
|
|
interpolation: {
|
|
|
|
escapeValue: false,
|
2024-04-12 04:47:03 +01:00
|
|
|
},
|
2024-04-19 19:55:01 +01:00
|
|
|
resources: {
|
|
|
|
en: {
|
2024-05-06 19:25:17 +01:00
|
|
|
...enConfig
|
2024-04-19 19:55:01 +01:00
|
|
|
},
|
2024-04-23 16:53:56 +01:00
|
|
|
es: {
|
2024-05-06 19:25:17 +01:00
|
|
|
...esConfig
|
2024-04-19 19:55:01 +01:00
|
|
|
},
|
|
|
|
fr: {
|
2024-05-06 19:25:17 +01:00
|
|
|
...frConfig
|
2024-04-24 05:36:07 +01:00
|
|
|
},
|
|
|
|
it: {
|
2024-05-06 19:25:17 +01:00
|
|
|
...itConfig
|
2024-04-24 05:36:07 +01:00
|
|
|
},
|
2024-04-25 22:24:53 +01:00
|
|
|
de: {
|
2024-05-06 19:25:17 +01:00
|
|
|
...deConfig
|
2024-05-09 04:59:49 +01:00
|
|
|
},
|
2024-06-07 17:27:42 +01:00
|
|
|
"pt-BR": {
|
2024-05-13 17:18:24 +01:00
|
|
|
...ptBrConfig
|
|
|
|
},
|
2024-06-07 17:27:42 +01:00
|
|
|
"zh-CN": {
|
2024-05-09 05:11:04 +01:00
|
|
|
...zhCnConfig
|
2024-05-24 00:45:04 +01:00
|
|
|
},
|
2024-06-07 17:27:42 +01:00
|
|
|
"zh-TW": {
|
2024-06-02 00:53:13 +01:00
|
|
|
...zhTwConfig
|
Add Korean Locale (#737)
* Add korean locale without translation
* Translate ability,move,pokemon to Korean
* Translate miscellaneous to Korean
* Add Accuracy in the fight ui to Korean
* Apply nature,growth rate lang files to Korean
* Add missed file import to Korean config.ts
* Add font and its license for Korean then Apply it
pokemon-dppt from FontStruction and its license
* Translate any other lang file to Korean
* Cleanup Korean locale files
Indentation for pokemon and starter-select-ui-handler
Make config shoft
* Update Korean translation for the latest commits
ToggleSize dependency e4d3f73d,
+ Align togglesize locale text
Frisk description 6d73500a
Starter select UI 34a4f869, 74ee3329
Add ability triggers locale file 1c56efc8
Zippy Zap description 4e279224
* Implement locale font loading
Revert multiple font usage from style fe7fe845
Dynamic font loading on language changed
* Translate new localization parts to Korean
Return to title become save and quit
menu-ui-handler.ts ac2e7812
Generation text added
starter-select-ui-handler.ts afcffab9
Missing translations for learning move
battles.ts:countdownPoof, learnMoveAnd 44c0d29c
Weather & evolution texts translated
config.ts, weather.ts, menu.ts b8dff030
Added modifier type file for item translate
config.ts, modifier-type.ts b5ae8330, b82b8c31
Egg gatcha machine is now Korean
config.ts, egg.ts 975d1ed5
Add splash message literals to locales
config.ts, splash-messages.ts 8dce9fa2
Trainers are also localized
config.ts, trainers.ts b06190c4, 7f003d46, 364b19df
Double battle trainers appeared
battle.ts:trainerAppearedDouble f1e97f3b
* Small patches to Korean translations
Include generation consistency (learnMovePrompt, eggHatching),
wrong space (learnMoveReplaceQuestion),
missing word (learnMoveNotLearned),
match to modifier-type.ts (ivScannerUseQuestion),
and match to english and else (bossAppeared)
* Apply edits to Korean translation
Re-order config.ts 3f571a36
Fix splash message attribute to fixed config 429e6635
* Corrections and new text for Korean translations
Trainer misstypo correction 0cd305d7
trainer.ts
BerryType localization 25014208
config.ts, berry.ts
IV scanner updated 96af567c
config.ts, battle-message-ui-handler.ts
Melt stat and type into info 3cc9c93
config.ts, modifier-type.ts pokemon-stat.ts -> pokemon-info.ts
* Update Korean locale up to date
Larry and Lance are now unique 93dee06e
Trainer names errors about 'poké' 49adedbc, 13f2cafe
Wrong text edit for maylene
trainers.ts
Egg voucher translation 7216990d
config.ts, voucher.ts
Cleanup starter select ui handler ca1ae4b5, b95a59c0
starter-select-ui-handler.ts
Correct text overflow
tutorial.ts
* Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
* Update Korean translations
* Apply updated text
Berry pouch 8b4aa872
modifier-type.ts
Acrobatics 0d614526
move.ts
failedToLoadSaveData 32fadf8c
menu.ts
HoneyGather caeb22c2
ability.ts
* Apply added Text
Plates and Memories f914b8fe
modifier-type.ts
trainerSendOut, moneyWon, partyFull 79af1152
battle.ts
gym_leader_double, champion_double, Double Names aaa95ebe
elite_four_female, champion_female ac2f7755
trainers.ts
* Apply new locale category implement
Biomes de1c2b2b
config.ts, biome.ts
Trainer dialogue ac2f7755, d23d8356
config.ts, dialogue.ts
Statistics 6d2b8ef2
config.ts, game-stats-ui-handler
Info Container fb26b6d5
config.ts, pokemon-info-container.ts
* Recover coding style
include 2-space-indentation
* Add Korean Font
No more license text file
* Add missing config to Korean
* Fix ESLint failure on Korean
* Fix ESLint failure on Korean 2
* Update to Main Localization Changes
---------
Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-30 00:05:14 +01:00
|
|
|
},
|
|
|
|
ko: {
|
|
|
|
...koConfig
|
|
|
|
},
|
2024-04-16 19:29:32 +01:00
|
|
|
},
|
2024-06-04 02:38:52 +01:00
|
|
|
postProcess: ["korean-postposition"],
|
2024-04-19 19:55:01 +01:00
|
|
|
});
|
|
|
|
}
|
2024-04-12 04:47:03 +01:00
|
|
|
|
|
|
|
// Module declared to make referencing keys in the localization files type-safe.
|
2024-05-23 16:03:10 +01:00
|
|
|
declare module "i18next" {
|
2024-04-12 04:47:03 +01:00
|
|
|
interface CustomTypeOptions {
|
2024-05-30 18:51:58 +01:00
|
|
|
defaultNS: "menu"; // Even if we don't use it, i18next requires a valid default namespace
|
2024-04-12 04:47:03 +01:00
|
|
|
resources: {
|
2024-05-06 19:25:17 +01:00
|
|
|
ability: AbilityTranslationEntries;
|
2024-06-08 16:03:01 +01:00
|
|
|
abilityTriggers: SimpleTranslationEntries;
|
|
|
|
achv: AchievementTranslationEntries;
|
|
|
|
battle: SimpleTranslationEntries;
|
2024-05-17 11:21:35 +01:00
|
|
|
battleMessageUiHandler: SimpleTranslationEntries;
|
2024-05-17 11:09:08 +01:00
|
|
|
berry: BerryTranslationEntries;
|
2024-05-25 21:57:22 +01:00
|
|
|
biome: SimpleTranslationEntries;
|
2024-06-08 16:03:01 +01:00
|
|
|
challenges: SimpleTranslationEntries;
|
|
|
|
commandUiHandler: SimpleTranslationEntries;
|
2024-05-27 12:14:37 +01:00
|
|
|
PGMdialogue: DialogueTranslationEntries;
|
|
|
|
PGMbattleSpecDialogue: SimpleTranslationEntries;
|
|
|
|
PGMmiscDialogue: SimpleTranslationEntries;
|
|
|
|
PGMdoubleBattleDialogue: DialogueTranslationEntries;
|
|
|
|
PGFdialogue: DialogueTranslationEntries;
|
|
|
|
PGFbattleSpecDialogue: SimpleTranslationEntries;
|
|
|
|
PGFmiscDialogue: SimpleTranslationEntries;
|
|
|
|
PGFdoubleBattleDialogue: DialogueTranslationEntries;
|
2024-06-08 16:03:01 +01:00
|
|
|
egg: SimpleTranslationEntries;
|
|
|
|
fightUiHandler: SimpleTranslationEntries;
|
|
|
|
gameMode: SimpleTranslationEntries;
|
|
|
|
gameStatsUiHandler: SimpleTranslationEntries;
|
|
|
|
growth: SimpleTranslationEntries;
|
|
|
|
menu: SimpleTranslationEntries;
|
|
|
|
menuUiHandler: SimpleTranslationEntries;
|
|
|
|
modifierType: ModifierTypeTranslationEntries;
|
|
|
|
move: MoveTranslationEntries;
|
|
|
|
nature: SimpleTranslationEntries;
|
2024-06-07 20:08:34 +01:00
|
|
|
partyUiHandler: SimpleTranslationEntries;
|
2024-06-08 16:03:01 +01:00
|
|
|
pokeball: SimpleTranslationEntries;
|
|
|
|
pokemon: SimpleTranslationEntries;
|
|
|
|
pokemonInfo: PokemonInfoTranslationEntries;
|
|
|
|
pokemonInfoContainer: SimpleTranslationEntries;
|
|
|
|
saveSlotSelectUiHandler: SimpleTranslationEntries;
|
|
|
|
splashMessages: SimpleTranslationEntries;
|
|
|
|
starterSelectUiHandler: SimpleTranslationEntries;
|
|
|
|
titles: SimpleTranslationEntries;
|
|
|
|
trainerClasses: SimpleTranslationEntries;
|
|
|
|
trainerNames: SimpleTranslationEntries;
|
|
|
|
tutorial: SimpleTranslationEntries;
|
|
|
|
voucher: SimpleTranslationEntries;
|
|
|
|
weather: SimpleTranslationEntries;
|
2024-04-12 04:47:03 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default i18next;
|
2024-05-16 10:05:25 +01:00
|
|
|
|
|
|
|
export function getIsInitialized(): boolean {
|
|
|
|
return isInitialized;
|
|
|
|
}
|
|
|
|
|
2024-05-17 11:21:35 +01:00
|
|
|
let isInitialized = false;
|