diff --git a/Gemfile b/Gemfile
index 7de2ef3ea..759678dc6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -54,6 +54,7 @@ gem 'flamegraph'
gem 'graphql-client'
gem 'haml', '~> 5.1'
gem 'i18n'
+gem 'rails-i18n', '~> 7.0.0'
gem 'iconv'
gem 'multi_json'
gem 'mysql2', '0.5.3'
diff --git a/Gemfile.lock b/Gemfile.lock
index 17d6890f9..a2c036524 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -129,6 +129,8 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.2.2)
crass (1.0.6)
+ css_parser (1.14.0)
+ addressable
cube-ruby (0.0.3)
daemons (1.4.1)
dalli (3.2.4)
@@ -170,6 +172,8 @@ GEM
haml (>= 4.0)
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
+ htmlbeautifier (1.4.2)
+ htmlentities (4.3.4)
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
@@ -197,6 +201,19 @@ GEM
loofah (2.20.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
+ lookbook (1.5.5)
+ actioncable
+ activemodel
+ css_parser
+ htmlbeautifier (~> 1.3)
+ htmlentities (~> 4.3.4)
+ listen (~> 3.0)
+ railties (>= 5.0)
+ redcarpet (~> 3.5)
+ rouge (>= 3.26, < 5.0)
+ view_component (> 2.0, < 4)
+ yard (~> 0.9.25)
+ zeitwerk (~> 2.5)
lz4-ruby (0.3.3)
mail (2.8.1)
mini_mime (>= 0.1.1)
@@ -278,6 +295,9 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
+ rails-i18n (7.0.6)
+ i18n (>= 0.7, < 2)
+ railties (>= 6.0.0, < 8)
rails_autolink (1.1.8)
actionview (> 3.1)
activesupport (> 3.1)
@@ -450,6 +470,7 @@ DEPENDENCIES
jquery-ui-rails
jsbundling-rails
listen
+ lookbook (~> 1.5.5)
multi_json
mysql2 (= 0.5.3)
net-ftp (~> 0.2.0)
@@ -463,6 +484,7 @@ DEPENDENCIES
puma (~> 5.0)
rack-mini-profiler
rails (= 7.0.3)
+ rails-i18n (~> 7.0.0)
rails_autolink
rdoc
recaptcha (~> 5.9.0)
@@ -486,4 +508,4 @@ DEPENDENCIES
will_paginate (~> 3.0)
BUNDLED WITH
- 2.3.23
+ 2.4.12
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index ebae1b90b..c9efe8304 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -13,6 +13,29 @@
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
+
+ before_action :set_locale
+
+ # Sets the locale based on the locale cookie or the value returned by detect_locale.
+ def set_locale
+ I18n.locale = cookies[:locale] || detect_locale
+ cookies.permanent[:locale] = I18n.locale if cookies[:locale].nil?
+ end
+
+ # Returns detedted locale based on the Accept-Language header of the request or the default locale if none is found.
+ def detect_locale
+ languages = request.headers['Accept-Language']&.split(',')
+ supported_languages = I18n.available_locales
+
+ languages.each do |language|
+ language_code = language.split(/[-;]/).first.downcase.to_sym
+ return language_code if supported_languages.include?(language_code)
+ end
+
+ return I18n.default_locale
+ end
+
+
helper :all # include all helpers, all the time
helper_method :bp_config_json, :current_license, :using_captcha?
rescue_from ActiveRecord::RecordNotFound, with: :not_found_record
diff --git a/app/controllers/language_controller.rb b/app/controllers/language_controller.rb
new file mode 100644
index 000000000..ed1ec7c79
--- /dev/null
+++ b/app/controllers/language_controller.rb
@@ -0,0 +1,21 @@
+class LanguageController < ApplicationController
+
+ # set locale to the language selected by the user
+ def set_locale_language
+ language = params[:language].strip.downcase.to_sym
+ supported_languages = I18n.available_locales
+
+ if language
+ if supported_languages.include?(language)
+ cookies.permanent[:locale] = language
+ else
+ # in case we want to show a message if the language is not available
+ flash.now[:notice] = "#{language} translation not available"
+ logger.error flash.now[:notice]
+ end
+ end
+
+ redirect_to request.referer || root_path
+ end
+
+end
diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb
index a2a34a755..7b14c5ba4 100644
--- a/app/helpers/home_helper.rb
+++ b/app/helpers/home_helper.rb
@@ -5,14 +5,11 @@
module HomeHelper
def render_footer_link(options = {})
-
- link_content = options[:text].presence
- link_content ||= image_tag(options[:img_src]) if options[:img_src].present?
- link_content ||= content_tag(:i, '', class: options[:icon]) if options[:icon].present?
-
- unless link_content.blank?
- link_to(link_content, options[:url], target: options[:target], class: options[:css_class].to_s, style: options[:text].blank? ? 'text-decoration: none' : '')
- end.to_s.html_safe
-
+ link_content = options[:text][I18n.locale] || options[:text][:en] if options[:text]
+ link_content ||= image_tag(options[:img_src]) if options[:img_src]
+ link_content ||= content_tag(:i, '', class: options[:icon]) if options[:icon]
+
+ link_to(link_content, options[:url], target: options[:target], class: options[:css_class].to_s, style: options[:text].blank? ? 'text-decoration: none' : '').html_safe if link_content
end
+
end
\ No newline at end of file
diff --git a/app/helpers/schemes_helper.rb b/app/helpers/schemes_helper.rb
index 1ecb91908..01b3993da 100644
--- a/app/helpers/schemes_helper.rb
+++ b/app/helpers/schemes_helper.rb
@@ -41,15 +41,13 @@ def get_schemes_labels(schemes, main_uri)
end
def concept_label_to_show(submission: @submission_latest)
- submission&.hasOntologyLanguage == 'SKOS' ? 'Concepts' : 'Classes'
+ submission&.hasOntologyLanguage == 'SKOS' ? 'concepts' : 'classes'
end
def section_name(section)
- if section.eql?('classes')
- concept_label_to_show(submission: @submission_latest || @submission)
- else
- section.capitalize
- end
+ section = concept_label_to_show(submission: @submission_latest || @submission) if section.eql?('classes')
+
+ t("ontology_details.sections.#{section}")
end
def scheme_path(scheme_id = '')
diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js
index e015799d7..1b3f7532a 100644
--- a/app/javascript/controllers/index.js
+++ b/app/javascript/controllers/index.js
@@ -34,9 +34,15 @@ application.register("load-chart", LoadChartController)
import MetadataDownloaderController from "./metadata_downloader_controller"
application.register("metadata-downloader", MetadataDownloaderController)
+import OntologyViewerTabsController from "./ontology_viewer_tabs_controller"
+application.register("ontology-viewer-tabs", OntologyViewerTabsController)
+
import OntoportalAutocompleteController from "./ontoportal_autocomplete_controller"
application.register("ontoportal-autocomplete", OntoportalAutocompleteController)
+import PlatformLanguageController from "./platform_language_controller"
+application.register("platform-language", PlatformLanguageController)
+
import ShowModalController from "./show_modal_controller"
application.register("show-modal", ShowModalController)
diff --git a/app/javascript/controllers/language_change_controller.js b/app/javascript/controllers/language_change_controller.js
index e4d891317..144b5fa36 100644
--- a/app/javascript/controllers/language_change_controller.js
+++ b/app/javascript/controllers/language_change_controller.js
@@ -1,10 +1,11 @@
import { Controller } from "@hotwired/stimulus"
// Connects to data-controller="language-change"
+// This controller is used to change the language of the Concepts, Schemes and Collections
export default class extends Controller {
dispatchLangChangeEvent() {
-
+ debugger
this.element.dispatchEvent(new CustomEvent('lang_changed', {
bubbles: true,
cancelable: true,
@@ -14,6 +15,6 @@ export default class extends Controller {
}
}
}));
-
}
+
}
diff --git a/app/javascript/controllers/platform_language_controller.js b/app/javascript/controllers/platform_language_controller.js
new file mode 100644
index 000000000..682d8e901
--- /dev/null
+++ b/app/javascript/controllers/platform_language_controller.js
@@ -0,0 +1,21 @@
+import { Controller } from "@hotwired/stimulus"
+import { Turbo } from "@hotwired/turbo-rails";
+import { getCookie } from "../mixins/cookie";
+
+// Connects to data-controller="platform-language"
+// this controller is used to change the language of the whole platform
+export default class extends Controller {
+
+ connect() {
+ const locale = getCookie('locale');
+
+ const option = document.querySelector(`#language-select option[value="${locale}"]`);
+ option && (option.selected = true);
+
+ }
+
+ handleLangChanged(event) {
+ const userPreferedLanguage = event.target.value;
+ Turbo.visit(`/locale/${userPreferedLanguage}`, { action: "replace" });
+ }
+}
diff --git a/app/javascript/mixins/cookie.js b/app/javascript/mixins/cookie.js
new file mode 100644
index 000000000..5e2b5bf0d
--- /dev/null
+++ b/app/javascript/mixins/cookie.js
@@ -0,0 +1,8 @@
+export const getCookie = (name) => {
+ const cookieValue = document.cookie.match('(^|[^;]+)\\s*' + name + '\\s*=\\s*([^;]+)');
+ return cookieValue ? cookieValue.pop() : '';
+}
+
+export const setCookie = (name, value, days) => {
+ document.cookie = `${name}=${value};max-age=${days * 24 * 60 * 60}`;
+}
\ No newline at end of file
diff --git a/app/views/annotator/index.html.haml b/app/views/annotator/index.html.haml
index 6c12a1f55..7b65537d2 100644
--- a/app/views/annotator/index.html.haml
+++ b/app/views/annotator/index.html.haml
@@ -1,4 +1,4 @@
-- @title = "Annotator"
+- @title= t('annotator.title')
%head
= javascript_include_tag "bp_annotator"
@@ -6,7 +6,7 @@
%div.container-fluid
%div.row
%div.col
- %h2.mt-3 Annotator
+ %h2.mt-3= t('annotator.title')
%p
= t('annotator.index.intro', site: $SITE).html_safe
= link_to(help_path(anchor: "Annotator_Tab"), id: "annotator-help", target: "_blank") do
@@ -17,90 +17,90 @@
%form
%div.form-group
= hidden_field_tag :annotation_sample_text, t('annotator.index.sample_text')
- = text_area_tag("annotation_text", nil, rows: 10, class: "form-control", placeholder: "Enter or paste text to be annotated", "aria-describedby": "annotateTextHelpBlock")
+ = text_area_tag("annotation_text", nil, rows: 10, class: "form-control", placeholder: t('annotator.enter_or_paste_text'), "aria-describedby": "annotateTextHelpBlock")
%small#annotateTextHelpBlock.form-text
- %a#insert_text_link{href: "javascript:void(0);"} insert sample text
+ %a#insert_text_link{href: "javascript:void(0);"}= t('shared.insert_sample_text')
- %a#advancedOptionsLink{:href => "javascript:void(0);"} Show advanced options >>
+ %a#advancedOptionsLink{:href => "javascript:void(0);"}= t('shared.show_advanced_options') + ">>"
%div#advanced-options-container.mt-4
%div.form-group
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("longest_only", "all", false, class: "custom-control-input")
- %label.custom-control-label{for: "longest_only"} Match longest only
+ %label.custom-control-label{for: "longest_only"}= t('annotator.filters.match_longest_only')
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("whole_word_only", "all", false, class: "custom-control-input")
- %label.custom-control-label{for: "whole_word_only"} Match partial words
+ %label.custom-control-label{for: "whole_word_only"}= t('annotator.filters.match_partial_words')
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("mappings", "all", false, id: "mappings_all", class: "custom-control-input")
- %label.custom-control-label{for: "mappings_all"} Include mappings
+ %label.custom-control-label{for: "mappings_all"}= t('annotator.filters.include_mappings')
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("exclude_numbers", "all", false, class: "custom-control-input")
- %label.custom-control-label{for: "exclude_numbers"} Exclude numbers
+ %label.custom-control-label{for: "exclude_numbers"}= t('annotator.filters.exclude_numbers')
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("exclude_synonyms", "all", false, class: "custom-control-input")
- %label.custom-control-label{for: "exclude_synonyms"} Exclude synonyms
+ %label.custom-control-label{for: "exclude_synonyms"}= t('annotator.filters.exclude_synonyms')
%div.form-group
- %label{for: "ontology_ontologyId"} Select ontologies
+ %label{for: "ontology_ontologyId"}= t('annotator.select', name: t('ontology'))
= select_tag("ontology_ontologyId", options_from_collection_for_select(@annotator_ontologies, :acronym, lambda { |ont| "#{ont.name} (#{ont.acronym})" }), |
multiple: true, class: "form-control", "aria-describedby": "selectOntologiesHelpBlock") |
- %small#selectOntologiesHelpBlock.form-text.text-muted Start typing to select ontologies or leave blank to use all
+ %small#selectOntologiesHelpBlock.form-text.text-muted= t('annotator.start_typing_to_select', type: t('ontology'))
- if @sem_type_ont
%div.form-group
- %label{for: "semantic_types"} Select UMLS semantic types
+ %label{for: "semantic_types"}= t('annotator.select', name: t('annotator.umls.semantic_types'))
= select_tag("semantic_types", options_for_select(@semantic_types_for_select), multiple: "true", class: "form-control", "aria-describedby": "selectSemanticTypesHelpBlock")
- %small#selectSemanticTypesHelpBlock.form-text.text-muted Start typing to select UMLS semantic types or leave blank to use all
+ %small#selectSemanticTypesHelpBlock.form-text.text-muted= t('annotator.start_typing_to_select', type: t('annotator.umls.semantic_types'))
%div.form-group
- %label{for: "semantic_groups"} Select UMLS semantic groups
+ %label{for: "semantic_groups"}= t('annotator.select', name: t('annotator.umls.semantic_groups'))
= select_tag("semantic_groups", options_for_select(@semantic_groups_for_select), multiple: "true", class: "form-control", "aria-describedby": "selectSemanticGroupsHelpBlock")
- %small#selectSemanticGroupsHelpBlock.form-text.text-muted Start typing to select UMLS semantic groups or leave blank to use all
+ %small#selectSemanticGroupsHelpBlock.form-text.text-muted= t('annotator.start_typing_to_select', type: t('annotator.umls.semantic_groups'))
%div.form-group
- %label{for: "class_hierarchy_max_level"} Include ancestors up to level
+ %label{for: "class_hierarchy_max_level"}= t('annotator.filters.max_hierarchy_level')
- options = [["none", 0], *(1..10).map {|i| [i, i]}, ["all", 999]]
= select_tag("class_hierarchy_max_level", options_for_select(options, 0), class: "form-control")
%div.form-group
- %label{for: "score"} Include score
+ %label{for: "score"}= t('annotator.filters.score')
- options = [["none", ""], ["old", "old"], ["cvalue", "cvalue"], ["cvalueh", "cvalueh"]]
= select_tag(:score, options_for_select(options, 0), class: "form-control", "aria-describedby": "includeScoreHelpBlock")
- %small#includeScoreHelpBlock.form-text.text-muted Score annotations following the previous 2009 NCBO measure (old) or the C-Value measure (cvalue). If hierarchy expansion is used, then prefer cvalueh.
+ %small#includeScoreHelpBlock.form-text.text-muted= t('annotator.filters.score_help')
%div.form-group
- %label{for: "score_threshold"} Filter by score threshold
+ %label{for: "score_threshold"}= t('annotator.filters.score_threshold')
= number_field_tag(:score_threshold, 0, id: "score_threshold", class: "form-control", "aria-describedby": "scoreThresholdHelpBlock")
- %small#scoreThresholdHelpBlock.form-text.text-muted Specify the minimum score value for annotations
+ %small#scoreThresholdHelpBlock.form-text.text-muted= t('annotator.filters.score_threshold_help')
%div.form-group
- %label{for: "confidence_threshold"} Filter confidence threshold
+ %label{for: "confidence_threshold"}= t('annotator.filters.confidence_threshold')
= number_field_tag(:confidence_threshold, 0, min: 0, max: 100, id: "confidence_threshold", class: "form-control", "aria-describedby": "confidenceThresholdHelpBlock")
- %small#confidenceThresholdHelpBlock.form-text.text-muted Specify the minimum position in the scoring distribution (between 1 and 100)
+ %small#confidenceThresholdHelpBlock.form-text.text-muted= t('annotator.filters.confidence_threshold_help')
- if @recognizers.length > 1
%div.form-group
- %label{for: "recognizer"} Entity recognizer
+ %label{for: "recognizer"}= t('annotator.filters.recognizer')
- default_recognizer = @recognizers.include?("mgrep") ? "mgrep" : @recognizers.first
= select_tag("recognizer", options_for_select(@recognizers.map {|r| [r, r]}, default_recognizer), class: "form-control")
%div.form-group
%div.custom-control.custom-checkbox
= check_box_tag("fast_context", :all, false, class: "custom-control-input")
- %label.custom-control-label{for: "fast_context"} FastContext
+ %label.custom-control-label{for: "fast_context"}= t('annotator.fast_context')
%small#fast_contextnHelp.form-text.text-muted= t('annotator.index.fast_context.tooltip')
%div.form-group
%div.custom-control.custom-checkbox
= check_box_tag("lemmatize", false, false, class: "custom-control-input")
- %label.custom-control-label{for: "lemmatize"} Lemmatize
- %small#lemmatize.form-text.text-muted Enable Lemmatize to lemmatize the submitted text and use a lemmatized dictionary for the annotations
+ %label.custom-control-label{for: "lemmatize"}= t('annotator.lemmatize')
+ %small#lemmatize.form-text.text-muted= t('annotator.index.lemmatize.tooltip')
%div.my-4
- = button_tag("Get annotations", type: "button", id: "annotator_button", class: "btn btn-primary btn-lg")
+ = button_tag(t('annotator.get_annotator'), type: "button", id: "annotator_button", class: "btn btn-primary btn-lg")
%span.annotator_spinner
%img{src: asset_path('spinners/spinner_000000_16px.gif')}/
%span#annotator_error.annotator_error
@@ -109,9 +109,9 @@
%div.col
#annotations_container
#result_counts
- %h4 Annotations
+ %h4= t('annotator.annotations_result')
#filter_list{:style => "font-size: 9pt; color: gray; display: none; clear: both; margin: -15px 0 5px"}
- %span#filter_title> Results are filtered by
+ %span#filter_title> #{t('annotator.results_filtered_by')}:
\
%span#filter_names
#results_error{:style => "color: red; margin-bottom: 7px;"}
@@ -119,45 +119,45 @@
%thead
%tr
%th
- Class
+ = t('class')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_classes.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_classes.bp_popup_link{:href => "javascript:void(0);"}= t('filter')
%div#classes_filter_list.bp_popup_list
%th
- Ontology
+ = t('ontology')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_ontologies.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_ontologies.bp_popup_link{:href => "javascript:void(0);"}= t('filter')
%div#ontology_filter_list.bp_popup_list
%th{class: "match_type"}
- Type
+ = t('type')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_match_type.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_match_type.bp_popup_link{:href => "javascript:void(0);"}= t('filter')
%div#match_type_filter_list.bp_popup_list
- %th UMLS Sem Type
- %th{class: "match_context"} Context
+ %th= t('umls_sem_type')
+ %th{class: "match_context"}= t('context')
%th
- Matched Class
+ = t('matched_class')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_matched_classes.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_matched_classes.bp_popup_link{:href => "javascript:void(0);"}= t('filter')
%div#matched_classes_filter_list.bp_popup_list
%th
- Matched Ontology
+ = t('matched_ontology')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_matched_ontologies.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_matched_ontologies.bp_popup_link{:href => "javascript:void(0);"}= t('filter')
%div#matched_ontology_filter_list.bp_popup_list
- %th Score
- %th Negation
- %th Experiencer
- %th Temporality
- %th Certainty
+ %th= t('score')
+ %th= t('negation')
+ %th= t('experiencer')
+ %th= t('temporality')
+ %th= t('certainty')
%tbody
%div.my-3
- %b Format results as
+ %b= t('format_results')
%div.my-3
%span#download_links_tabdelimited.link_button.ui_button
%span#download_links_json.link_button.ui_button
@@ -165,8 +165,8 @@
%span#download_links_text.link_button.ui_button
-# %span#download_links_xml.link_button.ui_button
%div.mt-3
- Reproduce these results using the
+ = link_to(t('reproduce_results'))
%span#annotator_parameters
%div.mb-4
- Additional parameters explained at
+ = t('additional_parameters')
= link_to('Annotator API documentation', "#{$REST_URL}/documentation#nav_annotator", target: "_blank")
diff --git a/app/views/fair_score/_fair_service_header.html.haml b/app/views/fair_score/_fair_service_header.html.haml
index f4550d08b..61321623d 100644
--- a/app/views/fair_score/_fair_service_header.html.haml
+++ b/app/views/fair_score/_fair_service_header.html.haml
@@ -4,7 +4,7 @@
%span.badge.badge-pill.badge-secondary
beta
%span
- = link_to("https://github.com/agroportal/fairness", target: "_blank", "aria-label": "View fair scores definitions", title: "View fair scores definitions") do
+ = link_to("https://github.com/agroportal/fairness", target: "_blank", "aria-label": t("view_fair_scores_definitions"), title: t("view_fair_scores_definitions")) do
%i.fas.fa-lg.fa-question-circle{"aria-hidden": "true", style: "margin-left: 0.5rem"}
- = link_to(get_fairness_service_url,id: "fairness-service-url", target: "_blank", "aria-label": "Get the json version", title: "Get the json version") do
+ = link_to(get_fairness_service_url,id: "fairness-service-url", target: "_blank", "aria-label": t("get_json_version"), title: t("get_json_version")) do
%i.fas.fa-lg.fa-code{"aria-hidden": "true", style: "margin-left: 0.5rem" }
\ No newline at end of file
diff --git a/app/views/home/_fair_score_home.html.haml b/app/views/home/_fair_score_home.html.haml
index 9e83a221b..519e62cf3 100644
--- a/app/views/home/_fair_score_home.html.haml
+++ b/app/views/home/_fair_score_home.html.haml
@@ -5,22 +5,22 @@
= render partial: "fair_score/fair_service_header"
%span
%h2.p-2.badge.badge-secondary
- Average
+ = t('average')
%span.badge.badge-light
%span#fair-score-average
0 (0%)
%h2.p-2.badge.badge-secondary
- Min
+ = t('min')
%span.badge.badge-light
%span#fair-score-min
0 (0%)
%h2.p-2.badge.badge-secondary
- Max
+ = t('max')
%span.badge.badge-light
%span#fair-score-max
0 (0%)
%h2.p-2.badge.badge-secondary
- Median
+ = t('median')
%span.badge.badge-light
%span#fair-score-median
0 (0%)
@@ -33,6 +33,6 @@
%div.col-md-6.col-sm
= render partial: "shared/fair_score_radar" , locals: {data: nil }
%a.btn.btn-link{href:"/landscape#fairness_assessment"}
- See details
+ = t('see_details')
%div.col-md-6.col-sm
= render partial: "shared/fair_score_bars", locals: {data: nil}
\ No newline at end of file
diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml
index b3454de47..497235156 100644
--- a/app/views/home/index.html.haml
+++ b/app/views/home/index.html.haml
@@ -1,4 +1,4 @@
-- @title = t(".title", organization: "#{$ORG_SITE}")
+- @title = t("home.index.title", organization: "#{$ORG_SITE}")
- unless $FRONT_NOTICE.nil? || $FRONT_NOTICE.empty? || cookies[:front_page_notice_closed].eql?("true")
:javascript
@@ -19,27 +19,27 @@
%div.col
%div.px-2.py-2.pt-md-5.border-bottom.text-center
%h2
- = t(".welcome", site: "#{$SITE}")
+ = t("home.index.welcome", site: "#{$SITE}")
%small.text-muted
- = t(".tagline")
+ = t("home.index.tagline")
%div.row.search.pt-4
%div.col
%div.card-deck
-# Search for a class across ontologies
%div.card
- %div.card-header Search for a class
+ %div.card-header= t('home.search_class')
%div.card-body
= form_tag("/search", method: "get") do
%div.input-group.mb-3
- - placeholder = t(".query_placeholder")
+ - placeholder = t("home.index.query_placeholder")
= text_field_tag("query", nil, class: "form-control", placeholder: placeholder)
%div.input-group-append
= button_tag(type: "submit", class: "btn btn-primary", aria: {label: "Search for a class"}) do
%i{class: "fas fa-search fa-lg", aria: {hidden: "true"}}
- %a{:href => "/search?opt=advanced"} Advanced Search
+ %a{:href => "/search?opt=advanced"}= t("home.advanced_search")
-# Search for an ontology
%div.card
- %div.card-header Find an ontology
+ %div.card-header= t('home.find_ontology')
%div.card-body
%input#find_ontology_id{:type => "hidden"}
%div.input-group.mb-3
@@ -48,11 +48,11 @@
= button_tag(class: "btn btn-primary", onclick: "jumpToValueOntology()", aria: {label: "Find an ontology"}) do
%i{class: "fas fa-search fa-lg", aria: {hidden: "true"}}
%div.dropdown
- = button_tag("Browse Ontologies", type: "button", id: "ontologyGroupsDropdown", class: "btn btn-info dropdown-toggle", data: {toggle: "dropdown", offset: "0,10"}, aria: {haspopup: "true", expanded: "false"})
+ = button_tag(t('home.browse_ontologies'), type: "button", id: "ontologyGroupsDropdown", class: "btn btn-info dropdown-toggle", data: {toggle: "dropdown", offset: "0,10"}, aria: {haspopup: "true", expanded: "false"})
%div.dropdown-menu{"aria-labelledby": "ontologyGroupsDropdown"}
- = link_to("All", ontologies_path(), class: "dropdown-item")
+ = link_to(t('all'), ontologies_path(), class: "dropdown-item")
%div.dropdown-divider
- %h6.dropdown-header Browse by group
+ %h6.dropdown-header= t("home.browse_by_group")
- @groups.each do |group|
= link_to(group[:name], ontologies_path(filter: group[:acronym]), class: "dropdown-item")
%div.row.pt-3.statistics
@@ -60,33 +60,33 @@
%div.card-deck
-# Ontology visits
%div.card
- %div.card-header Ontology Visits #{"in full #{$SITE} " if at_slice?} (#{@analytics.date.strftime("%B %Y")})
+ %div.card-header #{t('home.ontology_visits')} #{"in full #{$SITE} " if at_slice?} (#{@analytics.date.strftime("%B %Y")})
= content_tag(:div, nil, id: "ontology-visits-chart", class: "card-body", data: {ontnames: @anal_ont_names, ontnumbers: @anal_ont_numbers}) do
%canvas#myChart
- = link_to("More", visits_path())
+ = link_to(t('more'), visits_path())
-# Ontology statistics
%div.card
- %div.card-header #{$SITE} Statistics #{"in full #{$SITE}" if at_slice?}
+ %div.card-header #{$SITE} #{t('statistics')} #{"in full #{$SITE}" if at_slice?}
%ul.list-group.list-group-flush
%li.list-group-item
%div.d-flex.justify-content-between.align-items-center
- %span Ontologies
+ %span= t('home.ontologies')
%span= number_with_delimiter(@ont_count)
%li.list-group-item
%div.d-flex.justify-content-between.align-items-center
- %span Classes
+ %span= t('home.classes')
%span= number_with_delimiter(@cls_count, :delimiter => ",")
%li.list-group-item
%div.d-flex.justify-content-between.align-items-center
- %span Individuals
+ %span= t('home.individuals')
%span= number_with_delimiter(@individuals_count, :delimiter => ",")
%li.list-group-item
%div.d-flex.justify-content-between.align-items-center
- %span Projects
+ %span= t('home.projects')
%span= LinkedData::Client::Models::Project.all.length
%li.list-group-item
%div.d-flex.justify-content-between.align-items-center
- %span Users
+ %span= t('home.users')
%span= LinkedData::Client::Models::User.all.length
- if fairness_service_enabled?
%div#fair-home.row.mt-3
@@ -96,11 +96,11 @@
%div.card-deck
-# Latest Notes
%div.card
- %div.card-header Latest Notes
+ %div.card-header= t('home.latest_notes')
%ul.list-group.list-group-flush
- if @last_notes.nil? || @last_notes.empty?
%li.list-group-item
- %span No recent notes have been submitted
+ %span= t('home.no_recent_notes')
- else
- for note in @last_notes
%li.list-group-item
@@ -118,7 +118,7 @@
- if !$ENABLE_SLICES.nil? && $ENABLE_SLICES == true && !at_slice?
-# Slices
%div.card
- %div.card-header Slices
+ %div.card-header= t("slices")
%ul.list-group.list-group-flush
- LinkedData::Client::Models::Slice.all.each_with_index do |slice, index|
- break if index == 10
@@ -127,15 +127,12 @@
%li.list-group-item
= link_to slice_name, slice_link
-
-
- - $HOME_PAGE_LOGOS.to_a.each do |home_page_logos_row|
- - unless home_page_logos_row[:links].to_a.empty?
- %div.row.pt-3
- %div.col
- %div.card-deck
- %div.card
- %div.card-header= home_page_logos_row[:title]
- %div.logos
- - home_page_logos_row[:links].to_a.each do |logo|
- = link_to(image_tag(logo[:img_src]), logo[:url], target: logo[:target])
+ - $HOME_PAGE_LOGOS.each do |key, home_page_logos_row|
+ %div.row.pt-3
+ %div.col
+ %div.card-deck
+ %div.card
+ %div.card-header= t("home.#{key}")
+ %div.logos
+ - home_page_logos_row.each do |logo|
+ = link_to(image_tag(logo[:img_src]), logo[:url], target: logo[:target])
diff --git a/app/views/landscape/index.html.haml b/app/views/landscape/index.html.haml
index 0a059e9c7..a9b105e24 100644
--- a/app/views/landscape/index.html.haml
+++ b/app/views/landscape/index.html.haml
@@ -6,87 +6,86 @@
- @title = "Landscape"
%div{:class => "container theme-showcase", :role => "main", :style => "width: 80%; display: block;", :align => "center"}
%h1{:style => "font-size: 45px;"}
- = $SITE
- Landscape
- %p Visualize data retrieved from the ontologies stored in the portal
+ = t("landscape.title", site: $SITE)
+ %p= t("landscape.intro")
%div{:class => "panel panel-success", :style => "margin-top: 2em;"}
%div{:class => "panel-heading"}
- %h3{:class => "panel-title"} Groups and categories
+ %h3{:class => "panel-title"}= t("landscape.groups_and_categories")
%div{:class => "panel-body"}
%div{:class => "row", :style => "width: 80%;"}
%div{:class => "col-md-6"}
- %h2 Ontologies by group
+ %h2= t("landscape.ontologies_by", type: t("landscape.group"))
%canvas#groupsCanvas
%div{:class => "col-md-6"}
- %h2 Ontologies by category
+ %h2= t("landscape.ontologies_by", type: t("landscape.category"))
%canvas#domainCanvas
%div{:class => "row", :style => "width: 80%; margin-top: 3em;"}
%div{:class => "col-md-7"}
- %h2 Ontologies count in each data catalog
+ %h2= t("landscape.ontologies_count_by_catalog")
%canvas#dataCatalogCanvas
%div{:class => "col-md-5"}
- %h2 Ontologies by size
+ %h2= t("landscape.ontologies_by", type: t("landscape.size"))
%canvas#sizeSlicesCanvas
%hr{:style => "margin-top: 5em; margin-bottom: 5em;"}
- %h1 Properties use
- %p The proportion of properties usage among stored ontologies.
+ %h1= t("landscape.properties_use")
+ %p= t("landscape.properties_usage_proportion")
%div#pieChartDiv
%div{:class => "row"}
%div{:class => "col-md-4"}
- %h2 Ontologies natural languages
+ %h2= t("landscape.ontologies_languages")
%div#naturalLanguagePieChartDiv
%div{:class => "col-md-4"}
- %h2 Licenses used by the ontologies
+ %h2= t("landscape.ontologies_licenses")
%div#licensePieChartDiv
%div{:class => "col-md-4"}
- %h2 Most used tools to build ontologies
+ %h2= t("landscape.ontology_tools")
%div#toolCloudChart{:style => "width: 100%; height: 500px;"}
%div#chartTooltip{:style => "width: auto; display: none;"}
- %span#chartTooltipValue none
+ %span#chartTooltipValue= t("none")
- %button#propertiesBtn{:style => "margin-top: 1em;", :type => "button", :class => "btn btn-success", :onclick => "toggleDiv('properties')"} More properties charts
+ %button#propertiesBtn{:style => "margin-top: 1em;", :type => "button", :class => "btn btn-success", :onclick => "toggleDiv('properties')"}= t("landscape.more_properties_charts")
%div#propertiesDiv{:class => "panel panel-info", :style => "margin-top: 2em;"}
%div{:class => "panel-heading"}
- %h3{:class => "panel-title"} Pie charts for properties used for the ontologies
+ %h3{:class => "panel-title"}= t("landscape.ontology_properties_pie_charts")
%div{:class => "panel-body"}
%div{:class => "row"}
%div{:class => "col-md-3"}
- %h2 prefLabel property URIs used for OWL ontologies
+ %h2= t("landscape.owl_ontology_preflabel_uris")
%div#prefLabelPropertyPieChartDiv
%div{:class => "col-md-3"}
- %h2 synonym property URIs used for OWL ontologies
+ %h2= t("landscape.owl_ontology_synonym_uris")
%div#synonymPropertyPieChartDiv
%div{:class => "col-md-3"}
- %h2 definition property URIs used for OWL ontologies
+ %h2= t("landscape.owl_ontology_definition_uris")
%div#definitionPropertyPieChartDiv
%div{:class => "col-md-3"}
- %h2 author property URIs used for OWL ontologies
+ %h2= t("landscape.owl_ontology_author_uris")
%div#authorPropertyPieChartDiv
%hr{:style => "margin-top: 5em; margin-bottom: 5em;"}
%div{:class => "panel panel-success", :style => "margin-top: 2em;"}
%div{:class => "panel-heading"}
- %h3{:class => "panel-title"} Ontologies types
+ %h3{:class => "panel-title"}= t("landscape.ontologies_properties")
%div{:class => "panel-body"}
%div{:class => "row"}
%div{:class => "col-md-4"}
- %h2 Format used
+ %h2= t("landscape.ontologies_formats")
%canvas#formatCanvas
%div{:class => "col-md-4"}
- %h2 Ontology types
+ %h2= t("landscape.ontologies_properties")
%canvas#isOfTypeCanvas
%div{:class => "col-md-4"}
- %h2 Ontology formality levels
+ %h2= t("landscape.ontology_formality_levels")
%canvas#formalityLevelCanvas
@@ -94,16 +93,16 @@
%div{:class => "panel panel-success", :style => "margin-top: 2em;"}
%div{:class => "panel-heading"}
- %h3{:class => "panel-title"} Contributors to ontologies development
+ %h3{:class => "panel-title"}= t("landscape.ontologies_contributors")
%div{:class => "panel-body"}
%div{:class => "row"}
%div{:class => "col-md-6"}
- %h1 Most active people
- %p Most mentioned people as contact, creator, contributor, curator.
+ %h1= t("landscape.most_active_people")
+ %p= t("landscape.most_mentioned_people")
%div#peopleCloudChart{:style => "width: 100%; height: 350px; margin-top: 2em; border-right: 1px solid #ccc;"}
%div{:class => "col-md-6"}
- %h1 Most active organizations
- %p Organizations that fund and endorse the greatest number of ontologies.
+ %h1= t("landscape.most_active_organizations")
+ %p= t("landscape.funding_endorsing_organizations")
%div#orgCloudChart{:style => "width: 100%; height: 350px; margin-top: 2em;"}
%hr{:style => "margin-top: 4em; margin-bottom: 4em;"}
@@ -111,23 +110,22 @@
%div{:class => "panel panel-success", :style => "margin-top: 2em;"}
%div{:class => "panel-heading"}
%h3{:class => "panel-title"}
- Ontologies activity on
- = $SITE
+ = t("landscape.ontologies_activity_on", site: $SITE)
%div{:class => "panel-body"}
%div{:class => "row"}
%div{:class => "col-md-6"}
- %h1 Most active people as reviewer
- %p People that posted notes, review and projects
+ %h1= t("landscape.most_active_people_as_reviewer")
+ %p= t("landscape.most_mentioned_people_as_reviewer")
%div#notesPeopleCloudChart{:style => "width: 100%; height: 350px; margin-top: 2em; border-right: 1px solid #ccc;"}
%div{:class => "col-md-6"}
- %h1 Most active ontologies
- %p Ontologies that have notes, review and projects
+ %h1= t("landscape.most_active_ontologies")
+ %p= t("landscape.ontologies_with_notes_reviews_projects")
%div#notesOntologiesCloudChart{:style => "width: 100%; height: 350px; margin-top: 2em;"}
%hr{:style => "margin-top: 5em; margin-bottom: 5em;"}
- %h1 Ontology relations network
- %p{:style => "margin-bottom: 1em;"} Relations between ontologies stored in the portal
+ %h1= t("landscape.ontology_relations_network")
+ %p{:style => "margin-bottom: 1em;"}= t("landscape.relations_between_stored_ontologies")
%div{:style => "display: flex;"}
%div{:style => "text-align: left; width: 23em;"}
@@ -135,7 +133,7 @@
= check_box_tag "selectedRelations[]", relation, true, :id => relation
= label_tag relation, relation
%br
- %button{:type => "button", :class => "btn btn-success", :onclick => "buildNetwork(ontologyRelationsArray)", :style => "margin-bottom: 1em;"} Filter Network
+ %button{:type => "button", :class => "btn btn-success", :onclick => "buildNetwork(ontologyRelationsArray)", :style => "margin-bottom: 1em;"}= t("landscape.filter_network")
%div{:style => "width: 100%;"}
%div#networkContainer{:style => "height: 80vh; width: 100%; border:1px solid #cecece;"}
@@ -144,13 +142,13 @@
-if fairness_service_enabled?
%hr{:style => "margin-top: 5em; margin-bottom: 5em;"}
%h1
- Ontology FAIRness Evaluator (O’FAIRe)
+ = t("landscape.ontology_fairness_evaluator")
%div#fairness_assessment.p-2
= render partial: "fair_score_landscape"
%hr{:style => "margin-top: 5em; margin-bottom: 5em;"}
%div
- %h1 Average metrics
+ %h1= t("landscape.average_metrics")
%table.minimal.align-right{width: "30%", style: "margin-bottom: 3em;"}
%tbody
- for metric in @metrics_average
diff --git a/app/views/layouts/_topnav.html.haml b/app/views/layouts/_topnav.html.haml
index 8c3e73e76..4ae87baeb 100644
--- a/app/views/layouts/_topnav.html.haml
+++ b/app/views/layouts/_topnav.html.haml
@@ -6,36 +6,41 @@
%div#topNavigationToggler.navbar-collapse.collapse.justify-content-between
%ul.navbar-nav
%li.nav-item
- = link_to("Browse", ontologies_path(), class: "nav-link")
+ = link_to(t('layout.header.browse'), ontologies_path(), class: "nav-link")
%li.nav-item
- = link_to("Search", "/search", class: "nav-link")
+ = link_to(t('layout.header.search'), "/search", class: "nav-link")
%li.nav-item
- = link_to("Mappings", mappings_path(), class: "nav-link")
+ = link_to(t('layout.header.mappings'), mappings_path(), class: "nav-link")
%li.nav-item
- = link_to("Recommender", recommender_index_path, class: "nav-link")
+ = link_to(t('layout.header.recommender'), recommender_index_path, class: "nav-link")
%li.nav-item
- = link_to("Annotator", annotator_index_path(), class: "nav-link")
+ = link_to(t('layout.header.annotator'), annotator_index_path(), class: "nav-link")
- if $NCBO_ANNOTATORPLUS_ENABLED == true
%li.nav-item
- = link_to("NCBO Annotator+", '/ncbo_annotatorplus', class: "nav-link")
+ = link_to(t('layout.header.ncbo_annotator_plus'), '/ncbo_annotatorplus', class: "nav-link")
%li.nav-item
- = link_to("Projects", projects_path(), class: "nav-link")
+ = link_to(t('layout.header.projects'), projects_path(), class: "nav-link")
%li.nav-item
- = link_to("Landscape", '/landscape', class: "nav-link")
+ = link_to(t('layout.header.landscape'), '/landscape', class: "nav-link")
-if (!session[:user].nil? && session[:user].admin?)
%li.nav-item
- = link_to("Admin", admin_index_path, class: "nav-link")
+ = link_to(t('layout.header.admin'), admin_index_path, class: "nav-link")
%ul.navbar-nav
+ %li.nav-item{ style: "margin-right: 10px;" }
+ %select#language-select.form-control{ data: { controller: "platform-language", action: "change->platform-language#handleLangChanged" } }
+ %option{ value: "en" } English
+ %option{ value: "fr" } Français
+
- if session[:user].nil?
%li.nav-item
- = link_to("Login", login_index_path(redirect: request.original_url), class: "btn btn-bp-login mr-md-2")
+ = link_to(t(:_login), login_index_path(redirect: request.original_url), class: "btn btn-bp-login mr-md-2")
- else
-# Account menu
%li.nav-item.dropdown
= link_to("#", id: "accountMenuDropdownLink", class: "nav-link dropdown-toggle", role: "button", data: {toggle: "dropdown"}, aria: {haspopup: "true", expanded: "false"}) do
= session[:user].username
%div.dropdown-menu.dropdown-menu-right{aria: {labelledby: "accountMenuDropdownLink"}}
- = link_to("Account Settings", "/account", class: "dropdown-item")
+ = link_to(t(:_account_setting), "/account", class: "dropdown-item")
- unless session[:ontologies].nil?
%div.dropdown-divider
%h6.dropdown-header Recently Viewed
@@ -48,9 +53,9 @@
= link_to("#", id: "supportMenuDropdownLink", class: "nav-link dropdown-toggle", role: "button", data: {toggle: "dropdown"}, aria: {haspopup: "true", expanded: "false"}) do
Support
%div.dropdown-menu.dropdown-menu-right{aria: {labelledby: "supportMenuDropdownLink"}}
- = link_to("Submit Feedback", feedback_path(location: encode_param(request.url)), id: "submitFeedbackMenuItem", class: "dropdown-item pop_window")
+ = link_to(t(:submit_feedback), feedback_path(location: encode_param(request.url)), id: "submitFeedbackMenuItem", class: "dropdown-item pop_window")
%div.dropdown-divider
%h6.dropdown-header Documentation
- = link_to("Help", "#{$WIKI_HELP_PAGE}", target: "_blank", class: "dropdown-item")
- = link_to("Release Notes", "#{$RELEASE_NOTES}", target: "_blank", class: "dropdown-item")
- = link_to("Publications", $PUBLICATIONS_URL, target: "_blank", class: "dropdown-item")
+ = link_to(t(:_help), "#{$WIKI_HELP_PAGE}", target: "_blank", class: "dropdown-item")
+ = link_to(t(:_release_notes), "#{$RELEASE_NOTES}", target: "_blank", class: "dropdown-item")
+ = link_to(t(:_publications), $PUBLICATIONS_URL, target: "_blank", class: "dropdown-item")
diff --git a/app/views/layouts/ontology_viewer/_header.html.haml b/app/views/layouts/ontology_viewer/_header.html.haml
index 82f2c421d..bc5e094da 100644
--- a/app/views/layouts/ontology_viewer/_header.html.haml
+++ b/app/views/layouts/ontology_viewer/_header.html.haml
@@ -10,7 +10,7 @@
%div
- if (details_available && !sub.released.nil?)
%span.text-muted
- Last uploaded:
+ = t('ontology_details.header.last_uploaded')
= l(Date.parse(sub.creationDate), format: :monthfull_day_year)
%div.ont-info-links
- unless (@ontology.summaryOnly || @ont_restricted || @submission_latest.nil?)
diff --git a/app/views/mappings/_concept_mappings_selector.html.haml b/app/views/mappings/_concept_mappings_selector.html.haml
index 19b8bafae..b091cacfd 100644
--- a/app/views/mappings/_concept_mappings_selector.html.haml
+++ b/app/views/mappings/_concept_mappings_selector.html.haml
@@ -2,13 +2,13 @@
#headingTwo.card-header
%h2.mb-0
%button.btn.btn-link.btn-block.text-left.collapsed{"data-target" => "#collapseTwo", "data-toggle" => "collapse", :type => "button"}
- Find mappings of a class/concept
- = link_to(Rails.configuration.settings.links[:mappings], id: "mappings-help", "aria-label": "View mappings help") do
+ = t('mappings.find_mappings')
+ = link_to(Rails.configuration.settings.links[:mappings], id: "mappings-help", "aria-label": t('view_mappings_help')) do
%i.fas.fa-question-circle.fa-lg{"aria-hidden": "true"}
#collapseTwo.collapse{"data-parent" => "#accordionExample"}
.card-body
%div
- = render partial: 'shared/concept_picker', locals: {name: :concept_mapping_selector, concept_label: '', ontology_acronym: 'all', include_definition: true }
+ = render partial: 'shared/concept_picker', locals: {name: :concept_mapping_selector, concept_label: '', ontology_acronym: t('all'), include_definition: true }
%div.mt-1
= render TurboFrameComponent.new(id:'concept_mappings')
:javascript
diff --git a/app/views/mappings/_ontology_mappings.html.haml b/app/views/mappings/_ontology_mappings.html.haml
index 357784b8e..3e0689d94 100644
--- a/app/views/mappings/_ontology_mappings.html.haml
+++ b/app/views/mappings/_ontology_mappings.html.haml
@@ -9,10 +9,10 @@
.card-body
%div#mappings_select
- if @options.empty?
- No mappings available
+ = t('mappings.no_mappings_available')
- else
- = select('search', 'ontologies', @options, {:include_blank => ""},{:onchange=>"loadMappings(this.value);", "data-placeholder".to_sym => "Select an Ontology", autocomplete: "off"})
+ = select('search', 'ontologies', @options, {:include_blank => ""},{:onchange=>"loadMappings(this.value);", "data-placeholder".to_sym => t('select_ontologies_list'), autocomplete: "off"})
#mapping_load
%img{src: asset_path("jquery.simple.tree/spinner.gif")}/
- Loading mappings...
+ = t('mappings.loading_mappings')
#mappingCount{style:'min-height: 300px;'}
diff --git a/app/views/mappings/index.html.haml b/app/views/mappings/index.html.haml
index 438f3658f..15304b414 100644
--- a/app/views/mappings/index.html.haml
+++ b/app/views/mappings/index.html.haml
@@ -1,10 +1,10 @@
-- @title = "Mappings"
-%div#mappings_container.container-fluid.py-4
- %h1.my-1 Mappings
+- @title= t('mappings.title')
+%div#mappings_container.container-fluid.py-4.flex-grow-1
+ %h1.my-1= t('mappings.title')
%div#mappings_uploader.my-2
- = link_to_modal "Upload mappings" , "/mappings/loader", class: "btn btn-primary btn-block",
- data: { show_modal_title_value: "Mappings bulk load", show_modal_size_value: 'modal-xl'}
+ = link_to_modal t('mappings.upload_mappings') , "/mappings/loader", class: "btn btn-primary btn-block",
+ data: { show_modal_title_value: t('mappings.mappings_bulk_load'), show_modal_size_value: 'modal-xl'}
%hr.my-3.w-100
#accordionExample.accordion
= render partial: 'ontology_mappings'
diff --git a/app/views/ncbo_annotatorplus/index.html.haml b/app/views/ncbo_annotatorplus/index.html.haml
index ba1315f02..7b24e1126 100644
--- a/app/views/ncbo_annotatorplus/index.html.haml
+++ b/app/views/ncbo_annotatorplus/index.html.haml
@@ -1,4 +1,4 @@
-- @title = "NCBO Annotator +"
+- @title = t('nbco_annotatosplus.index.title')
%head
= javascript_include_tag "bp_annotator"
@@ -6,7 +6,7 @@
%div.container-fluid.annotator
%div.row
%div.col
- %h2.mt-3 NCBO Annotator +
+ %h2.mt-3= t('nbco_annotatosplus.index.title')
%p
= t('nbco_annotatosplus.index.intro', organization: $ORG).html_safe
= link_to(help_path(anchor: "Annotator_Tab"), id: "annotator-help", target: "_blank") do
@@ -17,82 +17,82 @@
%form
%div.form-group
= hidden_field_tag :annotation_sample_text, t('nbco_annotatosplus.index.sample_text')
- = text_area_tag("annotation_text", nil, rows: 10, class: "form-control", placeholder: "Enter or paste text to be annotated", "aria-describedby": "annotateTextHelpBlock")
+ = text_area_tag("annotation_text", nil, rows: 10, class: "form-control", placeholder: t('nbco_annotatosplus.enter_paste_text_to_annotate'), "aria-describedby": "annotateTextHelpBlock")
%small#annotateTextHelpBlock.form-text
- %a#insert_text_link{href: "javascript:void(0);"} insert sample text
+ %a#insert_text_link{href: "javascript:void(0);"}= t('nbco_annotatosplus.insert_sample_text')
- %a#advancedOptionsLink{:href => "javascript:void(0);"} Show advanced options >>
+ %a#advancedOptionsLink{:href => "javascript:void(0);"}= t('nbco_annotatosplus.show_advanced_options') >>
%div#advanced-options-container.mt-4
%div.form-group
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("longest_only", "all", false, class: "custom-control-input")
- %label.custom-control-label{for: "longest_only"} Match longest only
+ %label.custom-control-label{for: "longest_only"}= t('nbco_annotatosplus.match_longest_only')
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("whole_word_only", "all", false, class: "custom-control-input")
- %label.custom-control-label{for: "whole_word_only"} Match partial words
+ %label.custom-control-label{for: "whole_word_only"}= t('nbco_annotatosplus.match_partial_words')
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("mappings", "all", false, id: "mappings_all", class: "custom-control-input")
- %label.custom-control-label{for: "mappings_all"} Include mappings
+ %label.custom-control-label{for: "mappings_all"}= t('nbco_annotatosplus.include_mappings')
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("exclude_numbers", "all", false, class: "custom-control-input")
- %label.custom-control-label{for: "exclude_numbers"} Exclude numbers
+ %label.custom-control-label{for: "exclude_numbers"}= t('nbco_annotatosplus.exclude_numbers')
%div.custom-control.custom-checkbox.custom-control-inline
= check_box_tag("exclude_synonyms", "all", false, class: "custom-control-input")
- %label.custom-control-label{for: "exclude_synonyms"} Exclude synonyms
+ %label.custom-control-label{for: "exclude_synonyms"}= t('nbco_annotatosplus.exclude_synonyms')
%div.form-group
- %label{for: "ontology_ontologyId"} Select ontologies
+ %label{for: "ontology_ontologyId"}= t('nbco_annotatosplus.select_ontologies_list')
= select_tag "ontology_ontologyId", options_for_select(@ontologies_for_select), multiple: true, data: { placeholder: "Click here to select ontologies" }, class: "form-control", "aria-describedby": "selectOntologiesHelpBlock"
- %small#selectOntologiesHelpBlock.form-text.text-muted Start typing to select ontologies or leave blank to use all
+ %small#selectOntologiesHelpBlock.form-text.text-muted= t('nbco_annotatosplus.select_ontologies')
- if @sem_type_ont
%div.form-group
- %label{for: "semantic_types"} Select UMLS semantic types
+ %label{for: "semantic_types"}= t('nbco_annotatosplus.select', t('nbco_annotatosplus.umls.semantic_types'))
= select_tag("semantic_types", options_for_select(@semantic_types_for_select), multiple: "true", class: "form-control", "aria-describedby": "selectSemanticTypesHelpBlock")
- %small#selectSemanticTypesHelpBlock.form-text.text-muted Start typing to select UMLS semantic types or leave blank to use all
+ %small#selectSemanticTypesHelpBlock.form-text.text-muted= t('nbco_annotatosplus.start_typing_to_select', t('nbco_annotatosplus.umls.semantic_types'))
%div.form-group
- %label{for: "semantic_groups"} Select UMLS semantic groups
+ %label{for: "semantic_groups"}= t('nbco_annotatosplus.select', t('nbco_annotatosplus.umls.semantic_groups'))
= select_tag("semantic_groups", options_for_select(@semantic_groups_for_select), multiple: "true", class: "form-control", "aria-describedby": "selectSemanticGroupsHelpBlock")
- %small#selectSemanticGroupsHelpBlock.form-text.text-muted Start typing to select UMLS semantic groups or leave blank to use all
+ %small#selectSemanticGroupsHelpBlock.form-text.text-muted= t('nbco_annotatosplus.start_typing_to_select', t('nbco_annotatosplus.umls.semantic_groups'))
%div.form-group
- %label{for: "class_hierarchy_max_level"} Include ancestors up to level:
+ %label{for: "class_hierarchy_max_level"}= t('nbco_annotatosplus.include_ancestors_up_to_level') + ":"
- options = [["none", 0], *(1..10).map {|i| [i, i]}, ["all", 999]]
= select_tag("class_hierarchy_max_level", options_for_select(options, 0), class: "form-control")
%div.form-group
- %label{for: "score"} Include score:
+ %label{for: "score"}= t('nbco_annotatosplus.include_score') + ":"
- options = [["none", ""], ["old", "old"], ["cvalue", "cvalue"], ["cvalueh", "cvalueh"]]
= select_tag(:score, options_for_select(options, 0), class: "form-control", "aria-describedby": "includeScoreHelpBlock")
- %small#includeScoreHelpBlock.form-text.text-muted Score annotations following the previous 2009 NCBO measure (old) or the C-Value measure (cvalue). If hierarchy expansion is used, then prefer cvalueh.
+ %small#includeScoreHelpBlock.form-text.text-muted= t('nbco_annotatosplus.score_help')
%div.form-group
- %label{for: "score_threshold"} Filter by score threshold:
+ %label{for: "score_threshold"}= t('nbco_annotatosplus.filters.score_threshold') + ":"
= number_field_tag(:score_threshold, 0, id: "score_threshold", class: "form-control", "aria-describedby": "scoreThresholdHelpBlock")
- %small#scoreThresholdHelpBlock.form-text.text-muted Specify the minimum score value for annotations
+ %small#scoreThresholdHelpBlock.form-text.text-muted= t('nbco_annotatosplus.filters.score_threshold_help')
%div.form-group
- %label{for: "confidence_threshold"} Filter confidence threshold:
+ %label{for: "confidence_threshold"}= t('nbco_annotatosplus.filters.confidence_threshold') + ":"
= number_field_tag(:confidence_threshold, 0, min: 0, max: 100, id: "confidence_threshold", class: "form-control", "aria-describedby": "confidenceThresholdHelpBlock")
- %small#confidenceThresholdHelpBlock.form-text.text-muted Specify the minimum position in the scoring distribution (between 1 and 100)
+ %small#confidenceThresholdHelpBlock.form-text.text-muted= t('nbco_annotatosplus.filters.confidence_threshold_help')
- if @recognizers.length > 1
%div.form-group
- %label{for: "recognizer"} Entity recognizer:
+ %label{for: "recognizer"}= t('nbco_annotatosplus.recognizer') + ":"
- default_recognizer = @recognizers.include?("mgrep") ? "mgrep" : @recognizers.first
= select_tag("recognizer", options_for_select(@recognizers.map {|r| [r, r]}, default_recognizer), class: "form-control")
%div.form-group
%div.custom-control.custom-checkbox
= check_box_tag("fast_context", :all, false, class: "custom-control-input")
- %label.custom-control-label{for: "fast_context"} FastContext
- %small#fast_contextnHelp.form-text.text-muted Enable FastContext to detect : if a concept has been negated (affirmed, negated), who experienced the found concept (patient, other), when the annotated concept occurred (recent, historical, hypothetical), and/or if the annotated concept is uncertain (certain, uncertain).
+ %label.custom-control-label{for: "fast_context"}= t('nbco_annotatosplus.fast_context.title')
+ %small#fast_contextnHelp.form-text.text-muted= t('nbco_annotatosplus.fast_context.help')
%div.my-4
= button_tag("Get annotations", type: "button", id: "annotator_button", class: "btn btn-primary btn-lg")
@@ -104,9 +104,9 @@
%div.col
#annotations_container
#result_counts
- %h4 Annotations
+ %h4= t('nbco_annotatosplus.annotations')
#filter_list{:style => "font-size: 9pt; color: gray; display: none; clear: both; margin: -15px 0 5px"}
- %span#filter_title> Results are filtered by:
+ %span#filter_title> #{t('nbco_annotatosplus.filters.by.title') + " :"}:
\
%span#filter_names
#results_error{:style => "color: red; margin-bottom: 7px;"}
@@ -114,45 +114,45 @@
%thead
%tr
%th
- Class
+ = t('nbco_annotatosplus.filters.by.class')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_classes.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_classes.bp_popup_link{:href => "javascript:void(0);"}= t('nbco_annotatosplus.filters.by.filter')
%div#classes_filter_list.bp_popup_list
%th
- Ontology
+ = t('nbco_annotatosplus.filters.by.ontology')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_ontologies.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_ontologies.bp_popup_link{:href => "javascript:void(0);"}= t('nbco_annotatosplus.filters.by.filter')
%div#ontology_filter_list.bp_popup_list
%th{class: "match_type"}
- Type
+ = t('nbco_annotatosplus.filters.by.match_type')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_match_type.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_match_type.bp_popup_link{:href => "javascript:void(0);"}= t('nbco_annotatosplus.filters.by.filter')
%div#match_type_filter_list.bp_popup_list
- %th UMLS Sem Type
- %th{class: "match_context"} Context
+ %th= t('nbco_annotatosplus.filters.by.umls_sem_type')
+ %th{class: "match_context"}= t('nbco_annotatosplus.filters.by.match_context')
%th
- Matched Class
+ = t('nbco_annotatosplus.filters.by.matched_class')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_matched_classes.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_matched_classes.bp_popup_link{:href => "javascript:void(0);"}= t('nbco_annotatosplus.filters.by.filter')
%div#matched_classes_filter_list.bp_popup_list
%th
- Matched Ontology
+ = t('nbco_annotatosplus.filters.by.matched_ontology')
%span.popup_container
%span.bp_popup_link_container
- %a#filter_matched_ontologies.bp_popup_link{:href => "javascript:void(0);"} filter
+ %a#filter_matched_ontologies.bp_popup_link{:href => "javascript:void(0);"}= t('nbco_annotatosplus.filters.by.filter')
%div#matched_ontology_filter_list.bp_popup_list
- %th Score
- %th Negation
- %th Experiencer
- %th Temporality
- %th Certainty
+ %th= t('nbco_annotatosplus.filters.by.score')
+ %th= t('nbco_annotatosplus.filters.by.negation')
+ %th= t('nbco_annotatosplus.filters.by.experiencer')
+ %th= t('nbco_annotatosplus.filters.by.temporality')
+ %th= t('nbco_annotatosplus.filters.by.certainty')
%tbody
%div.my-3
- %b Format results as:
+ %b= t('nbco_annotatosplus.filters.format_results_as') + ":"
%div.my-3
%span#download_links_tabdelimited.link_button.ui_button
%span#download_links_json.link_button.ui_button
@@ -160,8 +160,8 @@
%span#download_links_text.link_button.ui_button
-# %span#download_links_xml.link_button.ui_button
%div.mt-3
- Reproduce these results using the
+ =t('nbco_annotatosplus.filters.reproduce_results_using')
%span#annotator_parameters
%div.mb-4
- Additional parameters explained at
+ =t('nbco_annotatosplus.filters.additional_parameters_explained_at')
= link_to('Annotator API documentation', "#{$REST_URL}/documentation#nav_annotator", target: "_blank")
diff --git a/app/views/ontologies/_additional_metadata.html.haml b/app/views/ontologies/_additional_metadata.html.haml
index dab2314de..ed48690b5 100644
--- a/app/views/ontologies/_additional_metadata.html.haml
+++ b/app/views/ontologies/_additional_metadata.html.haml
@@ -1,6 +1,6 @@
-# Additional Metadata pane
%section.ont-metadata-card.ont-additional-metadata-card
%header.pb-2.font-weight-bold
- Additional Metadata
+ = t('ontology_details.metadata.additional_metadata')
%table.table.table-sm
= raw additional_metadata(@submission_latest) unless @submission_latest.nil?
diff --git a/app/views/ontologies/browse.html.erb b/app/views/ontologies/browse.html.erb
index c35fdd01c..69d99663a 100644
--- a/app/views/ontologies/browse.html.erb
+++ b/app/views/ontologies/browse.html.erb
@@ -3,12 +3,12 @@
-
Ontologies loading
-
please wait...
+
<%= t('ontologies.loading') %>
+
<%= t('ontologies.please_wait') %>
- Browse
+ <%= t('browse') %>
<%= t('ontologies.intro').html_safe %>
<%= link_to(Rails.configuration.settings.links[:help_ontology_browse], id: 'ontology-browse-help',
@@ -19,27 +19,27 @@