File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
geonode_mapstore_client/client/js/plugins/MetadataEditor/components/_widgets Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import isString from 'lodash/isString';
1212
1313import DefaultTextareaWidget from '@rjsf/core/lib/components/widgets/TextareaWidget' ;
1414import IconWithTooltip from '../IconWithTooltip' ;
15- import { getMessageById } from '@mapstore/framework/utils/LocaleUtils' ;
15+ import { getMessageById , getSupportedLocales } from '@mapstore/framework/utils/LocaleUtils' ;
1616
1717const TextWidgetMultiLang = ( props ) => {
1818
@@ -23,13 +23,15 @@ const TextWidgetMultiLang = (props) => {
2323
2424 const languages = Object . keys ( schema ?. properties ) ;
2525 const languageLabels = languages . reduce ( ( acc , lang ) => {
26- const label = schema ?. properties ?. [ lang ] ?. [ 'geonode:multilang-lang-label' ] || lang ;
26+ const label = schema ?. properties ?. [ lang ] ?. [ 'geonode:multilang-lang-label' ] ;
2727 acc [ lang ] = label ;
2828 return acc ;
2929 } , { } ) ;
3030
3131 const getLanguageName = ( langCode ) => {
32- return languageLabels [ langCode ] || langCode ;
32+ const languagesNames = getSupportedLocales ( ) ;
33+ const langName = languageLabels [ langCode ] || languagesNames [ langCode ] ?. description
34+ return `${ langName } (${ langCode } )`
3335 } ;
3436
3537 const isTextarea = schema ?. [ 'ui:options' ] ?. widget === 'textarea' ;
You can’t perform that action at this time.
0 commit comments