Add Korean localization (#2395)
* Create messages.po * Add Korean localization
This commit is contained in:
		
							parent
							
								
									d4bb64c1e6
								
							
						
					
					
						commit
						ffd08570a5
					
				
					 6 changed files with 3334 additions and 40 deletions
				
			
		|  | @ -1,6 +1,6 @@ | ||||||
| /** @type {import('@lingui/conf').LinguiConfig} */ | /** @type {import('@lingui/conf').LinguiConfig} */ | ||||||
| module.exports = { | module.exports = { | ||||||
|   locales: ['en', 'hi', 'ja', 'fr', 'de', 'es'], |   locales: ['en', 'hi', 'ja', 'fr', 'de', 'es', 'ko'], | ||||||
|   catalogs: [ |   catalogs: [ | ||||||
|     { |     { | ||||||
|       path: '<rootDir>/src/locale/locales/{locale}/messages', |       path: '<rootDir>/src/locale/locales/{locale}/messages', | ||||||
|  |  | ||||||
|  | @ -110,18 +110,20 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage { | ||||||
|     switch (lang) { |     switch (lang) { | ||||||
|       case 'en': |       case 'en': | ||||||
|         return AppLanguage.en |         return AppLanguage.en | ||||||
|       case 'hi': |  | ||||||
|         return AppLanguage.hi |  | ||||||
|       case 'ja': |  | ||||||
|         return AppLanguage.ja |  | ||||||
|       case 'fr': |  | ||||||
|         return AppLanguage.fr |  | ||||||
|       // DISABLED until this translation is fixed -prf
 |       // DISABLED until this translation is fixed -prf
 | ||||||
|       // case 'de':
 |       // case 'de':
 | ||||||
|       //   return AppLanguage.de
 |       //   return AppLanguage.de
 | ||||||
|       // DISABLED until this translation is more thoroughly reviewed -prf
 |       // DISABLED until this translation is more thoroughly reviewed -prf
 | ||||||
|       // case 'es':
 |       // case 'es':
 | ||||||
|       //   return AppLanguage.es
 |       //   return AppLanguage.es
 | ||||||
|  |       case 'fr': | ||||||
|  |         return AppLanguage.fr | ||||||
|  |       case 'hi': | ||||||
|  |         return AppLanguage.hi | ||||||
|  |       case 'ja': | ||||||
|  |         return AppLanguage.ja | ||||||
|  |       case 'ko': | ||||||
|  |         return AppLanguage.ko | ||||||
|       default: |       default: | ||||||
|         continue |         continue | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -3,13 +3,14 @@ import {i18n} from '@lingui/core' | ||||||
| 
 | 
 | ||||||
| import {useLanguagePrefs} from '#/state/preferences' | import {useLanguagePrefs} from '#/state/preferences' | ||||||
| import {messages as messagesEn} from '#/locale/locales/en/messages' | import {messages as messagesEn} from '#/locale/locales/en/messages' | ||||||
| import {messages as messagesHi} from '#/locale/locales/hi/messages' |  | ||||||
| import {messages as messagesJa} from '#/locale/locales/ja/messages' |  | ||||||
| import {messages as messagesFr} from '#/locale/locales/fr/messages' |  | ||||||
| // DISABLED until this translation is fixed -prf
 | // DISABLED until this translation is fixed -prf
 | ||||||
| // import {messages as messagesDe} from '#/locale/locales/de/messages'
 | // import {messages as messagesDe} from '#/locale/locales/de/messages'
 | ||||||
| // DISABLED until this translation is more thoroughly reviewed -prf
 | // DISABLED until this translation is more thoroughly reviewed -prf
 | ||||||
| // import {messages as messagesEs} from '#/locale/locales/es/messages'
 | // import {messages as messagesEs} from '#/locale/locales/es/messages'
 | ||||||
|  | import {messages as messagesFr} from '#/locale/locales/fr/messages' | ||||||
|  | import {messages as messagesHi} from '#/locale/locales/hi/messages' | ||||||
|  | import {messages as messagesJa} from '#/locale/locales/ja/messages' | ||||||
|  | import {messages as messagesKo} from '#/locale/locales/ko/messages' | ||||||
| 
 | 
 | ||||||
| import {sanitizeAppLanguageSetting} from '#/locale/helpers' | import {sanitizeAppLanguageSetting} from '#/locale/helpers' | ||||||
| import {AppLanguage} from '#/locale/languages' | import {AppLanguage} from '#/locale/languages' | ||||||
|  | @ -19,18 +20,6 @@ import {AppLanguage} from '#/locale/languages' | ||||||
|  */ |  */ | ||||||
| export async function dynamicActivate(locale: AppLanguage) { | export async function dynamicActivate(locale: AppLanguage) { | ||||||
|   switch (locale) { |   switch (locale) { | ||||||
|     case AppLanguage.hi: { |  | ||||||
|       i18n.loadAndActivate({locale, messages: messagesHi}) |  | ||||||
|       break |  | ||||||
|     } |  | ||||||
|     case AppLanguage.ja: { |  | ||||||
|       i18n.loadAndActivate({locale, messages: messagesJa}) |  | ||||||
|       break |  | ||||||
|     } |  | ||||||
|     case AppLanguage.fr: { |  | ||||||
|       i18n.loadAndActivate({locale, messages: messagesFr}) |  | ||||||
|       break |  | ||||||
|     } |  | ||||||
|     // DISABLED until this translation is fixed -prf
 |     // DISABLED until this translation is fixed -prf
 | ||||||
|     // case AppLanguage.de: {
 |     // case AppLanguage.de: {
 | ||||||
|     //   i18n.loadAndActivate({locale, messages: messagesDe})
 |     //   i18n.loadAndActivate({locale, messages: messagesDe})
 | ||||||
|  | @ -41,6 +30,22 @@ export async function dynamicActivate(locale: AppLanguage) { | ||||||
|     //   i18n.loadAndActivate({locale, messages: messagesEs})
 |     //   i18n.loadAndActivate({locale, messages: messagesEs})
 | ||||||
|     //   break
 |     //   break
 | ||||||
|     // }
 |     // }
 | ||||||
|  |     case AppLanguage.fr: { | ||||||
|  |       i18n.loadAndActivate({locale, messages: messagesFr}) | ||||||
|  |       break | ||||||
|  |     } | ||||||
|  |     case AppLanguage.hi: { | ||||||
|  |       i18n.loadAndActivate({locale, messages: messagesHi}) | ||||||
|  |       break | ||||||
|  |     } | ||||||
|  |     case AppLanguage.ja: { | ||||||
|  |       i18n.loadAndActivate({locale, messages: messagesJa}) | ||||||
|  |       break | ||||||
|  |     } | ||||||
|  |     case AppLanguage.ko: { | ||||||
|  |       i18n.loadAndActivate({locale, messages: messagesKo}) | ||||||
|  |       break | ||||||
|  |     } | ||||||
|     default: { |     default: { | ||||||
|       i18n.loadAndActivate({locale, messages: messagesEn}) |       i18n.loadAndActivate({locale, messages: messagesEn}) | ||||||
|       break |       break | ||||||
|  |  | ||||||
|  | @ -12,18 +12,6 @@ export async function dynamicActivate(locale: AppLanguage) { | ||||||
|   let mod: any |   let mod: any | ||||||
| 
 | 
 | ||||||
|   switch (locale) { |   switch (locale) { | ||||||
|     case AppLanguage.hi: { |  | ||||||
|       mod = await import(`./locales/hi/messages`) |  | ||||||
|       break |  | ||||||
|     } |  | ||||||
|     case AppLanguage.ja: { |  | ||||||
|       mod = await import(`./locales/ja/messages`) |  | ||||||
|       break |  | ||||||
|     } |  | ||||||
|     case AppLanguage.fr: { |  | ||||||
|       mod = await import(`./locales/fr/messages`) |  | ||||||
|       break |  | ||||||
|     } |  | ||||||
|     // DISABLED until this translation is fixed -prf
 |     // DISABLED until this translation is fixed -prf
 | ||||||
|     // case AppLanguage.de: {
 |     // case AppLanguage.de: {
 | ||||||
|     //   mod = await import(`./locales/de/messages`)
 |     //   mod = await import(`./locales/de/messages`)
 | ||||||
|  | @ -34,6 +22,22 @@ export async function dynamicActivate(locale: AppLanguage) { | ||||||
|     //   mod = await import(`./locales/es/messages`)
 |     //   mod = await import(`./locales/es/messages`)
 | ||||||
|     //   break
 |     //   break
 | ||||||
|     // }
 |     // }
 | ||||||
|  |     case AppLanguage.fr: { | ||||||
|  |       mod = await import(`./locales/fr/messages`) | ||||||
|  |       break | ||||||
|  |     } | ||||||
|  |     case AppLanguage.hi: { | ||||||
|  |       mod = await import(`./locales/hi/messages`) | ||||||
|  |       break | ||||||
|  |     } | ||||||
|  |     case AppLanguage.ja: { | ||||||
|  |       mod = await import(`./locales/ja/messages`) | ||||||
|  |       break | ||||||
|  |     } | ||||||
|  |     case AppLanguage.ko: { | ||||||
|  |       mod = await import(`./locales/ko/messages`) | ||||||
|  |       break | ||||||
|  |     } | ||||||
|     default: { |     default: { | ||||||
|       mod = await import(`./locales/en/messages`) |       mod = await import(`./locales/en/messages`) | ||||||
|       break |       break | ||||||
|  |  | ||||||
|  | @ -6,13 +6,14 @@ interface Language { | ||||||
| 
 | 
 | ||||||
| export enum AppLanguage { | export enum AppLanguage { | ||||||
|   en = 'en', |   en = 'en', | ||||||
|   hi = 'hi', |  | ||||||
|   ja = 'ja', |  | ||||||
|   fr = 'fr', |  | ||||||
|   // DISABLED until this translation is fixed -prf
 |   // DISABLED until this translation is fixed -prf
 | ||||||
|   // de = 'de',
 |   // de = 'de',
 | ||||||
|   // DISABLED until this translation is more thoroughly reviewed -prf
 |   // DISABLED until this translation is more thoroughly reviewed -prf
 | ||||||
|   // es = 'es',
 |   // es = 'es',
 | ||||||
|  |   fr = 'fr', | ||||||
|  |   hi = 'hi', | ||||||
|  |   ja = 'ja', | ||||||
|  |   ko = 'ko', | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| interface AppLanguageConfig { | interface AppLanguageConfig { | ||||||
|  | @ -22,13 +23,14 @@ interface AppLanguageConfig { | ||||||
| 
 | 
 | ||||||
| export const APP_LANGUAGES: AppLanguageConfig[] = [ | export const APP_LANGUAGES: AppLanguageConfig[] = [ | ||||||
|   {code2: AppLanguage.en, name: 'English'}, |   {code2: AppLanguage.en, name: 'English'}, | ||||||
|   {code2: AppLanguage.hi, name: 'हिंदी'}, |  | ||||||
|   {code2: AppLanguage.ja, name: '日本語'}, |  | ||||||
|   {code2: AppLanguage.fr, name: 'Français'}, |  | ||||||
|   // DISABLED until this translation is fixed -prf
 |   // DISABLED until this translation is fixed -prf
 | ||||||
|   // {code2: AppLanguage.de, name: 'Deutsch'},
 |   // {code2: AppLanguage.de, name: 'Deutsch'},
 | ||||||
|   // DISABLED until this translation is more thoroughly reviewed -prf
 |   // DISABLED until this translation is more thoroughly reviewed -prf
 | ||||||
|   // {code2: AppLanguage.es, name: 'Español'},
 |   // {code2: AppLanguage.es, name: 'Español'},
 | ||||||
|  |   {code2: AppLanguage.fr, name: 'Français'}, | ||||||
|  |   {code2: AppLanguage.hi, name: 'हिंदी'}, | ||||||
|  |   {code2: AppLanguage.ja, name: '日本語'}, | ||||||
|  |   {code2: AppLanguage.ko, name: '한국어'}, | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| export const LANGUAGES: Language[] = [ | export const LANGUAGES: Language[] = [ | ||||||
|  |  | ||||||
							
								
								
									
										3281
									
								
								src/locale/locales/ko/messages.po
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3281
									
								
								src/locale/locales/ko/messages.po
									
										
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue