Skip to content

Commit

Permalink
Merge pull request #91 from ontoportal-lirmm/support-multi-lang-part-02
Browse files Browse the repository at this point in the history
Feature: Support multi lingual -  add show_language argument to the attributes getters
  • Loading branch information
syphax-bouazzouni committed Jul 13, 2023
2 parents 5c39fcb + 1cb2c73 commit 3abd9ae
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
22 changes: 12 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: c3456c45c12ed92d4a3ae43cac7c1d4cdbf290b6
revision: c6660c3f4aca88a911fcd5dda33c30d6022632f0
branch: development
specs:
goo (0.0.2)
Expand Down Expand Up @@ -36,18 +36,18 @@ GEM
public_suffix (>= 2.0.2, < 6.0)
ansi (1.5.0)
ast (2.4.2)
bcrypt (3.1.18)
bcrypt (3.1.19)
builder (3.2.4)
coderay (1.1.3)
concurrent-ruby (1.2.2)
connection_pool (2.4.0)
connection_pool (2.4.1)
cube-ruby (0.0.3)
daemons (1.4.1)
date (3.3.3)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
email_spec (2.2.1)
email_spec (2.2.2)
htmlentities (~> 4.3.3)
launchy (~> 2.1)
mail (~> 2.7)
Expand Down Expand Up @@ -110,7 +110,7 @@ GEM
multi_json (1.15.0)
multipart-post (2.3.0)
net-http-persistent (2.9.4)
net-imap (0.3.4)
net-imap (0.3.6)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -124,16 +124,18 @@ GEM
omni_logger (0.1.4)
logger
parallel (1.23.0)
parser (3.2.2.1)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pony (1.13.1)
mail (>= 2.0)
powerbar (2.0.1)
hashie (>= 1.1.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.1)
public_suffix (5.0.3)
racc (1.7.1)
rack (1.6.13)
rack-test (0.8.3)
rack (>= 1.0, < 3)
Expand All @@ -145,7 +147,7 @@ GEM
redis-client (>= 0.9.0)
redis-client (0.14.1)
connection_pool
regexp_parser (2.8.0)
regexp_parser (2.8.1)
request_store (1.5.1)
rack (>= 1.4)
rest-client (2.1.0)
Expand All @@ -166,7 +168,7 @@ GEM
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
Expand All @@ -188,7 +190,7 @@ GEM
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thread_safe (0.3.6)
timeout (0.3.2)
timeout (0.4.0)
tzinfo (0.3.62)
unf (0.1.4)
unf_ext
Expand Down
2 changes: 1 addition & 1 deletion lib/ontologies_linked_data/monkeypatches/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def populate_hash_from_list(hash, attributes)

next unless self.respond_to?(attribute)
begin
hash[attribute] = self.send(attribute)
hash[attribute] = self.send(attribute, :show_with_language)
rescue Goo::Base::AttributeNotLoaded
next
rescue ArgumentError
Expand Down
3 changes: 2 additions & 1 deletion lib/ontologies_linked_data/serializers/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def self.get_languages(submission, user_languages)
end

def self.get_submission_languages(submission_natural_language = [])
submission_natural_language.map { |natural_language| natural_language["iso639"] && natural_language.split('/').last[0..1].to_sym }.compact
submission_natural_language = submission_natural_language.values.flatten if submission_natural_language.is_a?(Hash)
submission_natural_language.map { |natural_language| natural_language.value["iso639"] && natural_language.value.split('/').last[0..1].to_sym }.compact
end

def self.type(current_cls, hashed_obj)
Expand Down

0 comments on commit 3abd9ae

Please sign in to comment.