Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature | Support multi-lingual: UI Internationalization #228

Merged
merged 31 commits into from
May 9, 2023

Conversation

haddadzineddine
Copy link

@haddadzineddine haddadzineddine commented Mar 30, 2023

Context

See : agroportal/project-management#309

Changes

  • Save the users settings in cookies ( so they will be persisted across browser sessions )
  • Make the portal detect and use automatically the local language (depending on headers['Accept-Language'])
  • Make all the text of the portal multilingual (in the start French and English)

Translated Pages

  • Home
  • Ontologies
  • Ontologies/{NAME}
  • Recommender
  • Search
  • Mappings
  • Projects
  • Annotator
  • Ncbo Annotator Plus ( next one )
  • Landscape

Documentation

app/controllers/application_controller.rb Outdated Show resolved Hide resolved
app/controllers/application_controller.rb Outdated Show resolved Hide resolved
app/javascript/controllers/language_change_controller.js Outdated Show resolved Hide resolved
app/views/layouts/_topnav.html.haml Outdated Show resolved Hide resolved
app/controllers/language_controller.rb Outdated Show resolved Hide resolved
@haddadzineddine haddadzineddine changed the title Support multi-lingual: UI Internationalization Feature | Support multi-lingual: UI Internationalization Apr 24, 2023
Copy link
Collaborator

@syphax-bouazzouni syphax-bouazzouni left a comment

Choose a reason for hiding this comment

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

@haddadzineddine, when using your branch

I got this error
image

because you updated the configuration variable $HOME_PAGE_LOGOS, like so

$HOME_PAGE_LOGOS = [
  {
    title: {
      en: 'Supported by',
      fr: 'Soutenu par',
    },
    ....

But as we discussed, we want all internationalization to be done in the local files not in the configuration files which need to be generic and no language-related.

@syphax-bouazzouni
Copy link
Collaborator

syphax-bouazzouni commented May 8, 2023

Added:

  • Update the $HOME_PAGE_LOGOS config variable to be internationalized (0ddcd57)
  • Rename 'set_locale' to 'set_locale_language' to prevent name conflicts (b77c27f)
  • Add rails-i18n gem to add french dates localization (6914388)
  • Add localization for the ontology_viewer header (9644023)

Copy link
Collaborator

@syphax-bouazzouni syphax-bouazzouni left a comment

Choose a reason for hiding this comment

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

Good work;

Two remarks:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants