rusackas commented on code in PR #33189:
URL: https://github.com/apache/superset/pull/33189#discussion_r2270601905


##########
superset/constants.py:
##########
@@ -203,6 +203,25 @@ class RouteMethod:  # pylint: 
disable=too-few-public-methods
     | EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS
 )
 
+LOCALES_LANGUAGE_MAP = {
+    "en": "en_US",
+    "es": "es_ES",
+    "it": "it_IT",
+    "fr": "fr_FR",
+    "zh": "zh_CN",
+    "zh_TW": "zh_TW",
+    "ja": "ja_JP",
+    "de": "de_DE",
+    "pt": "pt_PT",
+    "pt_BR": "pt_BR",
+    "ru": "ru_RU",
+    "ko": "ko_KR",
+    "sk": "sk_SK",
+    "sl": "sl_SI",
+    "nl": "nl_NL",
+    "uk": "uk_UA",
+}
+

Review Comment:
   This looks a lot like `LOCALE_MAPPING` in 
superset-frontend/src/hooks/useLocale.ts`
   
   ```
   export const LOCALE_MAPPING = {
     en: () => import('antd/locale/en_US'),
     fr: () => import('antd/locale/fr_FR'),
     es: () => import('antd/locale/es_ES'),
     it: () => import('antd/locale/it_IT'),
     zh: () => import('antd/locale/zh_CN'),
     ja: () => import('antd/locale/ja_JP'),
     de: () => import('antd/locale/de_DE'),
     pt: () => import('antd/locale/pt_PT'),
     pt_BR: () => import('antd/locale/pt_BR'),
     ru: () => import('antd/locale/ru_RU'),
     ko: () => import('antd/locale/ko_KR'),
     sk: () => import('antd/locale/sk_SK'),
     sl: () => import('antd/locale/sl_SI'),
     nl: () => import('antd/locale/nl_NL'),
   };
   ```
   
   It also looks a bit like `LocaleCode` in 
`superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NumericCell/index.tsx`
   ... though I'm not sure we even NEED all that boilerplate there.
   
   Point of the ramble is: I wonder if this is the time to 
simplify/consolidate/DRY this all together in a central location somehow.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to