File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
geonode_mapstore_client/client/js/plugins/MetadataEditor/components/_widgets Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,15 @@ const TextWidgetMultiLang = (props) => {
1919 const id = props . id || Math . random ( ) . toString ( 36 ) . substring ( 7 ) ;
2020 const { title, description } = schema ;
2121
22- // TODO map langs from schema when iso lang is change to 2 chars https://github.com/GeoNode/geonode/issues/13643#issuecomment-3728578749
23- const languages = [ "en" , "hy" , "ru" ] ;
22+ const languages = Object . keys ( schema ?. properties ) ;
23+ const languageLabels = languages . reduce ( ( acc , lang ) => {
24+ const label = schema ?. properties ?. [ lang ] ?. [ 'geonode:multilang-lang-label' ] || lang ;
25+ acc [ lang ] = label ;
26+ return acc ;
27+ } , { } ) ;
28+
2429 const languageLong = ( langCode ) => {
25- return {
26- en : "English" ,
27- hy : "Armenian" ,
28- ru : "Russian"
29- } [ langCode ] || langCode . toUpperCase ( ) ;
30+ return languageLabels [ langCode ] || langCode ;
3031 } ;
3132
3233 const isTextarea = schema ?. [ 'ui:options' ] ?. widget === 'textarea' ;
You can’t perform that action at this time.
0 commit comments