forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Make the word "Ontology" configurable in all the portal (#520)
* update the fr.file * remove the duplicated keys in en.yml file * internationalization of ontologies helpers * fix the bug of missing translate error * Internationalization of remaining files * remove duplicated keys and update the en.yml file * remove duplicated keys and update the fr.yml file * add the logic to replace ontology with semantic term * fix the bug of missing translation * fix the bug of missing translation * add the semantic term in it and de files * resolve the problem of translation terms * include ApplicationHelper into components.rb to use t(*args) function * add vocabulary, terminology and semantic_artefact terms in all languages * add Resource term to config file * add InternationalisationHelper * Remove the logic of configuring the ontology from the ApplicationHelper * include the InternationalisationHelper into the components.rb * fix the bug of syntax error * eliminate the use of the words ontology and semantic resource together * remove unused code * add documentation to the function * add resource term variable to bioportal config * add comment in all languages to explain how to use the resource term * handle the case of the $RESOURCE_TERM variable is not set --------- Co-authored-by: Syphax bouazzouni <[email protected]>
- Loading branch information
1 parent
9962096
commit 94c067e
Showing
18 changed files
with
192 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -629,5 +629,4 @@ def cancel_button_component(class_name: nil, id: , value:, data: nil) | |
end | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module InternationalisationHelper | ||
|
||
#Implement logic to make the term 'ontology' configurable throughout the portal, allowing it to be replaced with the variable $RESOURCE_TERM | ||
def t(*args) | ||
translation = I18n.t(*args).downcase | ||
term = I18n.t("resource_term.ontology") | ||
plural_term = I18n.t("resource_term.ontology_plural") | ||
single_term = I18n.t("resource_term.ontology_single") | ||
resource = I18n.t("resource_term.#{$RESOURCE_TERM}") | ||
resources = I18n.t("resource_term.#{$RESOURCE_TERM}_plural") | ||
a_resource = I18n.t("resource_term.#{$RESOURCE_TERM}_single") | ||
|
||
if translation.include?(term) && resource | ||
replacement = resource.capitalize | ||
replacement = resource if translation.include?(term) | ||
if translation.include?(single_term) | ||
term = single_term | ||
replacement = a_resource | ||
end | ||
translation.gsub(term, replacement) | ||
|
||
elsif translation.include?(plural_term) && resources | ||
replacement = resources.capitalize | ||
replacement = resources if translation.include?(plural_term) | ||
translation.gsub(plural_term, replacement) | ||
else | ||
I18n.t(*args) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.