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

Multilingual support #325

Merged
merged 22 commits into from
Sep 11, 2024
Merged

Multilingual support #325

merged 22 commits into from
Sep 11, 2024

Conversation

mdorf
Copy link
Member

@mdorf mdorf commented Sep 9, 2024

Pull request to merge the multilingual enhancements to master. This request implements a dropdown menu to allow switching between available languages when viewing an ontology terms.

- if @concept.prefLabel({:use_html => false}).to_s.empty?
%div.alert.alert-warning= 'No preferred name provided for selected language'
- else
= @concept.prefLabel({:use_html => true}).html_safe

Check notice

Code scanning / Brakeman

Unescaped parameter value. Note

Unescaped parameter value.
@alexskr alexskr merged commit 15c4497 into master Sep 11, 2024
2 checks passed
Copy link
Contributor

@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.

Added some comments, of not used code that can be removed.
But you adapted well our code to work with the old Jauery code, maybe you should merge it in the develop branch ?

gem 'terser'
gem 'thin'
gem 'will_paginate', '~> 3.0'
gem 'net-ftp'
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure net-ftp is required

@@ -0,0 +1,21 @@
class LanguageController < ApplicationController
Copy link
Contributor

Choose a reason for hiding this comment

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

this file is not needed

@@ -0,0 +1,43 @@
module InternationalisationHelper
Copy link
Contributor

Choose a reason for hiding this comment

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

this file is not needed

@@ -0,0 +1,146 @@
module MultiLanguagesHelper

def portal_language_help_text
Copy link
Contributor

Choose a reason for hiding this comment

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

portal_language_help_text, portal_languages and portal_language_selector can be removed as not used

lang
end

def lang_code(code_in)
Copy link
Contributor

Choose a reason for hiding this comment

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

this function is not used and can be removed

@@ -25,7 +25,11 @@
%tr
%td Preferred Name
%td
%p= @concept.prefLabel({:use_html => true}).html_safe
%p
- if @concept.prefLabel({:use_html => false}).to_s.empty?
Copy link
Contributor

Choose a reason for hiding this comment

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

can be changed to @concept.prefLabel.blank?, to prevent the nil exception

Copy link
Member Author

@mdorf mdorf Sep 12, 2024

Choose a reason for hiding this comment

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

this code @concept.prefLabel({:use_html => false}).to_s.empty? will not throw a nil exception.

nil.to_s is a valid call that will turn a nil into an empty string. xxx.to_s.empty? is generally used to check for either nil or empty? condition.

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.

3 participants