Skip to content

Conversation

@stefanocudini
Copy link
Member

@stefanocudini stefanocudini commented Jan 15, 2026

Description

This PR enable support of multilanguages fields define by new json-schema in GeoNode/geonode#13643

New look and behavior for text fields that support multilingual support

A new TextWidgetMultiLang widget has been introduced for the rjsf library that supports both text fields and text areas.
An overview here:

Peek.2026-01-15.10-34.mp4

UPDATE

In this version of the backend, we can't extract strings for language names; we'll show the code in the component.
However, logic is implemented so that if a 'geonode:multilang-lang-label' field is present.
Alternatively the name of the languages ​​loaded from MS lang names list(but names is not localized to current language) and the code are shown together with the name
image

render textMultilang

fix title multilang schema

fix metadata structure multilang

fix support teaxareas

fix update metadata multilang

clean comments

base multilang widget
@stefanocudini stefanocudini self-assigned this Jan 15, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @stefanocudini, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the metadata editor by introducing comprehensive multilingual support for text-based fields. It achieves this by integrating a new TextWidgetMultiLang component that provides a dynamic interface for users to manage content in multiple languages. The underlying MetadataEditor container has been refactored to intelligently transform the schema and metadata, ensuring seamless conversion between the multilingual display format and the single-language storage format, thereby enabling a more versatile and internationalized data entry experience.

Highlights

  • Multilingual Field Support: Implements support for multilingual fields in the metadata editor, aligning with a new JSON schema definition.
  • New TextWidgetMultiLang: Introduces a custom TextWidgetMultiLang for the rjsf library, capable of handling both text input and textarea fields.
  • Dynamic UI for Languages: Provides a user interface with language selection buttons, allowing users to input and switch between different language versions of a field.
  • Schema and Data Transformation: Includes logic within the MetadataEditor container to transform the JSON schema and metadata between single-language and multilingual formats for proper display and storage.
  • Integration with SchemaField: The SchemaField component is updated to dynamically render the new TextWidgetMultiLang based on the ui:widget property in the UI schema.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces multi-language support for text fields in the metadata editor, a valuable feature enhancement. The implementation involves a new TextWidgetMultiLang widget and associated logic for data and schema transformation. My review has identified a critical issue regarding direct mutation of component props, which violates React's core principles and must be fixed. Additionally, there are high-severity issues related to hardcoded values and incomplete logic that impact maintainability and correctness. I have also included several medium-severity suggestions to improve code quality by removing unused code, debugging statements, and commented-out blocks. Addressing these points will significantly improve the robustness and quality of the new feature.

@subashtiwari1010
Copy link
Collaborator

Screencast_20260115_200627.webm
When editing the fields:

  1. the title gets changed to gnviewer.metadataEditorTitle.
  2. The typed text is not inserted in the input field.

@stefanocudini
Copy link
Member Author

Screencast_20260115_200627.webm When editing the fields:

  1. the title gets changed to gnviewer.metadataEditorTitle.
  2. The typed text is not inserted in the input field.

@subashtiwari1010 Thank you for this observation, in last commit the form title is consistent with the previous single-language behavior, it uses the default language.

Peek.2026-01-15.18-39.mp4

@subashtiwari1010
Copy link
Collaborator

subashtiwari1010 commented Jan 16, 2026

Screencast_20260116_125750.mp4

@stefanocudini I noticed a bug here, check the video attached for more information.

  • Go to the sidebar
  • Click to open the section list
  • Click the fields such as date, category (that do not have the multi-language support).
  • The form will scroll to view for such fields
  • Click the field (here Title and Abstract) that have multi-language support
  • The form will not scroll to view for such fields

@stefanocudini
Copy link
Member Author

stefanocudini commented Jan 16, 2026

Screencast_20260116_125750.mp4
@stefanocudini I noticed a bug here, check the video attached for more information.
...

Peek 2026-01-16 10-54
@subashtiwari1010 I found the problem, was before the last commit, was simply missing the id field in the of the multilingual widget

Copy link
Collaborator

@subashtiwari1010 subashtiwari1010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and approved. Everything looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants