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.
Fix: Some bugs in the pre-release 2.7.4 including internationalisatio…
…n and code cleaning (#554) * remove old no more used controller * correct the casing of the imported stimulus controller * remove the internationalization of template string the search components * update internationilaztion helper to add the class method version * clean the include of internationalisation helper in some files * remove unused helper * remove the switch from the metadata curator * update the search input stimulus controller to add searchEndpoint value * clean some old usage to jquery chosen to prepare its total removal * fix project index edit button translation missing * handle the case of corrupted agents in the landscape * catch the missing translation in the overided internationalization * fix duplicated translations * complete missing translations and clean the en.yml file * complete and clean the fr.yml file * fix translation upcasing * fix internationlization not displayed well as sanitized * re-write the french translations * add edit submission french translations
- Loading branch information
1 parent
597a832
commit 4f26969
Showing
49 changed files
with
404 additions
and
922 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,3 @@ | |
margin-top: 5px; | ||
} | ||
|
||
|
||
.chosen-container { | ||
padding: 0; | ||
border-radius: 5px; | ||
} | ||
|
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,31 +1,43 @@ | ||
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 | ||
# Implement logic to make the term 'ontology' configurable throughout the portal, | ||
# allowing it to be replaced with the variable $RESOURCE_TERM | ||
def self.t(*args) | ||
return I18n.t(*args) unless $RESOURCE_TERM | ||
|
||
begin | ||
original_translation = I18n.t(*args) | ||
downcase_translation = original_translation.downcase | ||
rescue StandardError => e | ||
return e.message | ||
end | ||
|
||
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 | ||
if downcase_translation.include?(term) && resource | ||
replacement = resource.capitalize | ||
replacement = resource if translation.include?(term) | ||
if translation.include?(single_term) | ||
replacement = resource if downcase_translation.include?(term) | ||
if downcase_translation.include?(single_term) | ||
term = single_term | ||
replacement = a_resource | ||
end | ||
translation.gsub(term, replacement) | ||
|
||
elsif translation.include?(plural_term) && resources | ||
original_translation.gsub(term, replacement) | ||
elsif downcase_translation.include?(plural_term) && resources | ||
replacement = resources.capitalize | ||
replacement = resources if translation.include?(plural_term) | ||
translation.gsub(plural_term, replacement) | ||
replacement = resources if downcase_translation.include?(plural_term) | ||
original_translation.gsub(plural_term, replacement) | ||
else | ||
I18n.t(*args) | ||
end | ||
end | ||
|
||
def t(*args) | ||
InternationalisationHelper.t(*args) | ||
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
Oops, something went wrong.