Skip to content

Commit

Permalink
add edit submission french translations
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Mar 29, 2024
1 parent eb608b1 commit f42ef43
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 87 deletions.
4 changes: 2 additions & 2 deletions app/helpers/internationalisation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ def self.t(*args)
begin
original_translation = I18n.t(*args)
downcase_translation = original_translation.downcase
rescue
return "Missing downcase_translation for #{args.first}"
rescue StandardError => e
return e.message
end

term = I18n.t("resource_term.ontology")
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/ontologies_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def private_ontology_icon(is_private)
end
def browse_filter_section_label(key)
labels = {
categories: t('ontologies.categories'),
groups: t('ontologies.groups'),
hasFormalityLevel: t('ontologies.formality_levels'),
isOfType: t('ontologies.ontology_types'),
naturalLanguage: t('ontologies.natural_languages')
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/submission_inputs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def contact_input(label: '', name: t('submission_inputs.contact'), show_help: tr

render NestedFormInputsComponent.new(object_name: 'contact', default_empty_row: true) do |c|
c.header do
content_tag(:div, t('submission_inputs.contact_name', name: name), class: 'w-50') + content_tag(:div, t('submission_inputs.contact_email', name: name), class: 'w-50')
content_tag(:div, name.blank? ? '' : t('submission_inputs.contact_name', name: name), class: 'w-50') + content_tag(:div, name.blank? ? '' : t('submission_inputs.contact_email', name: name), class: 'w-50')
end

c.template do
Expand Down
40 changes: 14 additions & 26 deletions app/helpers/submissions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ module SubmissionsHelper
def metadata_help_link
content_tag(:div, class: 'edit-ontology-desc') do
html = content_tag(:div) do
content_tag(:div, 'Edit the metadata of your ontology here.') +
content_tag(:span, "Some of these values are used by #{portal_name} functionalities, includng for FAIRness assessment. ") +
content_tag(:span) do
link_to('See guidelines and recommendations for metadata here.', Rails.configuration.settings.links[:metadata_help], target: "_blank")
end
content_tag(:div, t('submission_inputs.edit_metadata_instruction',
portal_name: portal_name,
link: link_to(t('submission_inputs.edit_metadata_instruction_link'), Rails.configuration.settings.links[:metadata_help], target: '_blank')).html_safe
)
end

html.html_safe
Expand All @@ -15,20 +14,18 @@ def metadata_help_link

def metadata_license_help_link
content_tag(:div, class: 'edit-ontology-desc') do
html = content_tag(:div) do
content_tag(:span, " #{portal_name} requires an URI for the license. If you do not find your choice here, ") +
content_tag(:span) do
link_to('Please pick up an URI from here.', "https://rdflicense.linkeddata.es/", target: "_blank")
end
end
html = content_tag(:div, t('submission_inputs.license_help',
portal_name: portal_name,
link: link_to(t('submission_inputs.license_help_link'), "https://rdflicense.linkeddata.es/", target: '_blank')).html_safe
)
html.html_safe
end
end

def metadata_deprecated_help
content_tag(:div, style: 'edit-ontology-desc') do
html = content_tag(:div) do
content_tag(:div, " An ontology with status retired shall necessarily be also deprecated, but not the opposite.")
content_tag(:div, t('submission_inputs.deprecated_help'))
end
html.html_safe
end
Expand All @@ -37,10 +34,7 @@ def metadata_deprecated_help
def metadata_knownUsage_help
content_tag(:div, class: 'edit-ontology-desc') do
html = content_tag(:div) do
content_tag(:span, 'Consider also declaring ') +
content_tag(:span, style: 'width: 10px; height: 10px') do
link_to('the projects that are using the ontology.', "/projects/new", target: "_blank")
end
content_tag(:span, t('submission_inputs.known_usage_help', metadata_knownUsage_help: link_to(t('submission_inputs.known_usage_help_link'), "/projects/new", target: "_blank")).html_safe)
end
html.html_safe
end
Expand All @@ -49,7 +43,7 @@ def metadata_knownUsage_help
def metadata_help_creator
content_tag(:div, class: 'edit-ontology-desc') do
html = content_tag(:div, style: 'text-align: center; margin-top: 56px;') do
content_tag(:span, "The following properties take for value an 'agent' in #{portal_name} (either a person or an organization). These agents are shared over all the ontologies and suggested with autocompletion if they already exist. Editing an agent here will change it to all the ontologies that agent is involved in.")
content_tag(:span, t('submission_inputs.help_creator', portal_name: portal_name))
end

html.html_safe
Expand All @@ -58,23 +52,17 @@ def metadata_help_creator

def metadata_version_help
content_tag(:div, class: 'edit-ontology-desc') do
html = content_tag(:div) do
content_tag(:span, 'For more information on how to encode versionning information in an ontology, see ') +
content_tag(:span, style: 'width: 10px; height: 10px') do
link_to('guidelines and recommendations.', "https://hal.science/hal-04094847", target: "_blank")
end
end
html.html_safe
content_tag(:div , t('submission_inputs.version_help' , link: link_to(t('submission_inputs.version_helper_link'), "https://hal.science/hal-04094847", target: "_blank")).html_safe).html_safe
end
end

def ontology_submission_id_label(acronym, submission_id)
[acronym, submission_id].join('#')
end

def submission_metadata_selector(id: 'search_metadata', name: 'search[metadata]', label: 'Filter properties to show')
def submission_metadata_selector(id: 'search_metadata', name: 'search[metadata]', label: t('submission_inputs.metadata_selector_label'))
select_input(id: id, name: name, label: label, values: submission_editable_properties.sort, multiple: true,
data: { placeholder: 'Start typing to select properties' })
data: { placeholder: t('submission_inputs.metadata_selector_placeholder') })
end

def ontology_and_submission_id(value)
Expand Down
4 changes: 2 additions & 2 deletions app/views/annotator/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
- btn.icon_left do
= inline_svg_tag "summary/sparql.svg"
.cite-us-button
= render Buttons::RegularButtonComponent.new(id:'annotator_cite_us', value: "Cite", variant: "secondary", href: $CITE_ANNOTATOR, size: "slim", target: '_blank', state: "regular") do |btn|
= render Buttons::RegularButtonComponent.new(id:'annotator_cite_us', value: t('recommender.cite'), variant: "secondary", href: $CITE_ANNOTATOR, size: "slim", target: '_blank', state: "regular") do |btn|
- btn.icon_left do
= inline_svg_tag "icons/cite.svg"
.annotator-doc
= render Buttons::RegularButtonComponent.new(id:'annotator_api_doc', value: "Annotator API documentation", variant: "secondary", href: $ANNOTATOR_API_DOC, size: "slim", target: '_blank', state: "regular") do |btn|
= render Buttons::RegularButtonComponent.new(id:'annotator_api_doc', value: t('annotator.api_documentation'), variant: "secondary", href: $ANNOTATOR_API_DOC, size: "slim", target: '_blank', state: "regular") do |btn|
- btn.icon_left do
= inline_svg_tag "summary/documentation.svg"
2 changes: 1 addition & 1 deletion app/views/landscape/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
%hr{:style => "margin-top: 5em; margin-bottom: 5em;"}

%h1= t("landscape.ontology_relations_network")
%p{:style => "margin-bottom: 1em;"}= t("landscape.relations_between_stored_ontologies")
%p{:style => "margin-bottom: 1em;"}= t("landscape.relations_between_stored_ontologies", site: portal_name)

%div{:style => "display: flex;"}
%div{:style => "text-align: left; width: 23em;"}
Expand Down
2 changes: 1 addition & 1 deletion app/views/ontologies/sections/_metadata.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
= render partial: 'ontologies/sections/metadata/ontology_metrics_section'
.summary-page-second-row
= ontology_depiction_card
= properties_card('Identifiers',t("ontologies.sections.identifiers"), @identifiers) do |values|
= properties_card(t('ontologies.sections.identifiers'),t("ontologies.sections.identifiers"), @identifiers) do |values|
= horizontal_list_container(values) do |v|
= render LinkFieldComponent.new(value: v, check_resolvability: true)

Expand Down
4 changes: 2 additions & 2 deletions app/views/recommender/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@
- btn.icon_left do
= inline_svg_tag "json.svg"
.cite-us-button
= render Buttons::RegularButtonComponent.new(id:'recommender_cite_us', value: "Cite", variant: "secondary", href: $CITE_RECOMMENDER, size: "slim", target: '_blank', state: "regular") do |btn|
= render Buttons::RegularButtonComponent.new(id:'recommender_cite_us', value: t('recommender.cite'), variant: "secondary", href: $CITE_RECOMMENDER, size: "slim", target: '_blank', state: "regular") do |btn|
- btn.icon_left do
= inline_svg_tag "icons/cite.svg"
.go-to-annotator
= render Buttons::RegularButtonComponent.new(id:'recommender_go_annotator', value: "Call Annotator with the same input", variant: "secondary", href: "/annotator?text=#{params[:input]}&ontologies=#{params[:ontologies]}", size: "slim", target: '_blank', state: "regular") do |btn|
= render Buttons::RegularButtonComponent.new(id:'recommender_go_annotator', value: t('recommender.call_annotator'), variant: "secondary", href: "/annotator?text=#{params[:input]}&ontologies=#{params[:ontologies]}", size: "slim", target: '_blank', state: "regular") do |btn|
- btn.icon_right do
= inline_svg_tag "arrow-right-outlined.svg"

Expand Down
3 changes: 2 additions & 1 deletion app/views/submissions/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
= turbo_frame_tag(params[:container_id] || 'test') do
= form_for :submission, url: ontology_submission_path(@ontology.acronym, params["id"]), html: { id: "ontology_submission_form", method: :put, multipart: true, 'data-turbo': true, 'data-turbo-frame': '_top', novalidate: 'true'} do
.edit-ontology-title
%div Edit ontology
%div
= t('submission_inputs.edit_ontology_title')
%hr
.edit-ontology-sub-container
- if @selected_attributes.empty?
Expand Down
25 changes: 20 additions & 5 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ en:
temporality: Temporality
experiencer: Experiencer
score: Score
api_documentation: "Annotator API documentation"
insert_sample_text: Insert sample text
sample_text: Melanoma is a malignant tumor of melanocytes found mainly in the skin but also in the intestine and the eye.
concepts:
Expand Down Expand Up @@ -730,6 +731,8 @@ en:
get_recommendations: Get recommendations
edit: Edit
results_title: Recommended ontologies
call_annotator: Call Annotator with the same input
cite: Cite
results_table:
ontology: Ontology
final_score: Final score
Expand Down Expand Up @@ -958,6 +961,9 @@ en:
export_users_link: "Export Appliance Users As CSV"
bioportal_user: BioPortal User ID
submission_inputs:
edit_ontology_title: Edit ontology
metadata_selector_label: "Filter properties to show"
metadata_selector_placeholder: "Start typing to select properties"
administrators: Administrators
ontology_skos_language_link: Please refer to the documentation for more details.
ontology_skos_language_help: >
Expand Down Expand Up @@ -987,6 +993,16 @@ en:
help_text: Help text
contact_name: "%{name} Name"
contact_email: "%{name} Email"
edit_metadata_instruction: "Edit the metadata of your ontology here. Some of these values are used by %{portal_name} functionalities, including for FAIRness assessment. %{link)"
edit_metadata_instruction_link: "See guidelines and recommendations for metadata here."
license_help: "%{portal_name} requires an URI for the license. If you do not find your choice here, %{link}"
license_help_link: "Please pick up an URI from here."
deprecated_help: "An ontology with status retired shall necessarily be also deprecated, but not the opposite."
known_usage_help: "Consider also declaring %{metadata_knownUsage_help}"
known_usage_help_link: "the projects that are using the ontology"
help_creator: "The following properties take for value an 'agent' in %{portal_name} (either a person or an organization). These agents are shared over all the ontologies and suggested with autocompletion if they already exist. Editing an agent here will change it to all the ontologies that agent is involved in."
version_help: "For more information on how to encode versioning information in an ontology, see %{link}"
version_helper_link: "guidelines and recommendations."
collections:
error_valid_collection: "Error: You must provide a valid collection id"
no_collections_alert: "%{acronym} does not contain collections (skos:Collection)"
Expand Down Expand Up @@ -1083,6 +1099,8 @@ en:
referred_to: It can also be referred to as
private_ontology: Private Ontology
formality_levels: Formality levels
categories: Categories
groups: Groups
ontology_types: Ontology types
natural_languages: Natural languages
showing: Showing
Expand Down Expand Up @@ -1174,7 +1192,8 @@ en:
classes_with_a_single_child: Classes with a single child
classes_with_more_than_25_children: Classes with more than 25 children
classes_with_no_definition: Classes with no definition
identifiers: Principal identifiers of the ontology.
identifiers: Identifiers
identifiers_tooltip: Principal identifiers of the ontology.
dates: Dates
person_and_organization: Persons and organizations
other_links: Other links
Expand Down Expand Up @@ -1247,19 +1266,15 @@ en:
metadata:
fair_score_title: FAIR score
total_score: "Total score : %{score} ( %{normalized_score}%)"

metrics: Metrics
metrics_link_title: Information and evolution diagrams about metrics and other measurements of the ontology.
see_all_metrics: See all the metrics of %{acronym}
show_modal_title_1: All the metrics of %{acronym}
not_calculated_metrics: We have not yet calculated metrics for %{acronym}
show_modal_title_2: "Evolution of the number of %{metric} in %{acronym} per submissions."

submissions: Submissions
submissions_link_title: Set of all the files that have been submitted to %{site}. Each previous metadata record is accessible but only the content of the latest parsed file is accessible via %{site} services

relations_network: Ontology relations network

general_information: General information
initial_created_on: Initial created on
additional_information: For additional information, contact
Expand Down
Loading

0 comments on commit f42ef43

Please sign in to comment.