@@ -32,24 +32,8 @@ const lastCacheUpdate: Record<string, number> = {};
3232const CACHE_TTL = 60 * 60 * 1000 ; // 1 hour in milliseconds
3333const DEFAULT_LOCALE = 'en' ;
3434
35- // Add support for both formats of locales (kebab-case and camelCase)
36- const SUPPORTED_LOCALES = [ 'en' , 'de' , 'es' , 'ja' , 'zh-hans' , 'zhHans' , 'zh-hant' , 'zhHant' ] ;
37-
38- // Mapping for locale names to handle kebab-case vs. camelCase formats
39- const localeDirectoryMapping : Record < string , string > = {
40- 'zhHans' : 'zh-hans' , // Map camelCase to kebab-case
41- 'zhHant' : 'zh-hant' , // Map camelCase to kebab-case
42- 'zh-hans' : 'zh-hans' , // Keep kebab-case as is
43- 'zh-hant' : 'zh-hant' // Keep kebab-case as is
44- } ;
45-
46- /**
47- * Normalizes a locale name to the directory format
48- * @param locale The locale to normalize
49- */
50- function normalizeLocaleForDirectory ( locale : string ) : string {
51- return localeDirectoryMapping [ locale ] || locale ;
52- }
35+ // Supported locales list
36+ const SUPPORTED_LOCALES = [ 'en' , 'de' , 'es' , 'ja' , 'zh-hans' , 'zh-hant' ] ;
5337
5438/**
5539 * Loads all MCP server data from split files and combines them
@@ -67,7 +51,7 @@ export async function loadMcpServersData(locale: string = DEFAULT_LOCALE): Promi
6751 const baseDir = join ( __dirname , '..' , 'data' , 'split' ) ;
6852
6953 // Map the locale to the correct directory name if needed
70- const directoryLocale = normalizeLocaleForDirectory ( locale ) ;
54+ const directoryLocale = locale ;
7155
7256 // For English, use the root directory; for other locales, use the locale-specific subdirectory
7357 let dirPath = locale === DEFAULT_LOCALE ? baseDir : join ( baseDir , directoryLocale ) ;
0 commit comments