Skip to content

Commit

Permalink
mvp-tema-i18n (#9): parte do ruby de memória de tradução quase ok, in…
Browse files Browse the repository at this point in the history
…iciando HTMLs
  • Loading branch information
fititnt committed Jun 18, 2021
1 parent 7915e57 commit 83376c1
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 25 deletions.
8 changes: 4 additions & 4 deletions _data/translationem-memoriam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
typum: tm
gid: XZ
lid: hapi-miniman
title: "hapi-miniman.tm"
titulum: "hapi-miniman.tm"
noindex: true
situs_interretialis:
referens_officinale:
Expand All @@ -25,7 +25,7 @@
typum: tm
gid: XZ
lid: hapi-api
title: "hapi-api.tm"
titulum: "hapi-api.tm"
noindex: true
situs_interretialis:
referens_officinale:
Expand All @@ -42,7 +42,7 @@
typum: tm
gid: XZ
lid: schemam
title: "schemam.tm"
titulum: "schemam.tm"
noindex: true
situs_interretialis:
referens_officinale:
Expand All @@ -59,7 +59,7 @@
typum: tm
gid: XZ
lid: commune
title: "commune.tm"
titulum: "commune.tm"
noindex: true
situs_interretialis:
referens_officinale:
Expand Down
1 change: 1 addition & 0 deletions _includes/commune/bootstrap_card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- _includes/commune/bootstrap_card.html -->
3 changes: 3 additions & 0 deletions _includes/index-corporeum-mul-Zyyy.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ <h2 id="{% _🗣️ 🔎🔕🔍 schemam_datum_slug 🔎🔕🔍 🗣️_ %}">{%

<article>
<h2 id="translationem-memoriam" lang="la">Trānslātiōnem memoriam</h2>

{% include tm/index.html initiale_html_hN=3 %}

{% include temporarium/tm.html %}
</article>

Expand Down
2 changes: 2 additions & 0 deletions _includes/index-corporeum.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ <h2 id="{% _🗣️ 🔎🔕🔍 schemam_datum_slug 🔎🔕🔍 🗣️_ %}">{%
<article>
<h2 id="translationem-memoriam">{% _🗣️ translationem_memoriam_nomen 🗣️_ %}</h2>

{% include tm/index.html initiale_html_hN=3 %}

{% include temporarium/tm.html %}
</article>

Expand Down
4 changes: 0 additions & 4 deletions _includes/tm/index-xdefallo.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
{% assign h2sx = h_2sx | prepend: 'h' %}
{% assign h3sx = h_3sx | prepend: 'h' %}

{% _🗣️ opus_in_progressu_emoji_nomen 🗣_️ %}

{{ xtm }}

{% for rem in xtm.alternativum %}
<article style="padding: 1em">
{% include tm/item.html tm=rem initiale_html_hN=h_3sx multiplum_linguam=true %}
Expand Down
8 changes: 7 additions & 1 deletion _includes/tm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
{% assign h1sx = h_1sx | prepend: 'h' %}
{% assign h2sx = h_2sx | prepend: 'h' %}
{% assign h3sx = h_3sx | prepend: 'h' %}

aaa
{{ site.data.hapi.tm }}
bbb
<hr>
ccc
{{ site.data.hapi }}
ddd
{% for xschemam_global in site.data.hapi.xschemam %}
{% if xschemam_global.collectionem_xschemam[0] %}
<section>
Expand Down
2 changes: 1 addition & 1 deletion _includes/tm/item.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% assign h3 = h_3 | prepend: 'h' %}
{% assign h4 = h_4 | prepend: 'h' %}

{{ tm }}
{% include commune/bootstrap_card.html schemam=rem initiale_html_hN=h_3sx multiplum_linguam=true %}

<div class="card">
<div class="card-header">
Expand Down
12 changes: 11 additions & 1 deletion _plugins/hapi/drops/commune_drop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ def inspect
JSON.pretty_generate(@optionem)
end

# def keys
# keys = []
# # @optionem.each do |clavem, _valendum|
# # keys.append(clavem)
# # end

# keys
# end

def lid
# puts 'lid'
@optionem['lid'] || @optionem['datum']['lid']
Expand All @@ -69,7 +78,8 @@ def linguam

# _[eng] Returns the object as a debug String [eng]_
def to_s
opts = optionem.keys + ['alternativum_linguam']
opts = @optionem.keys + ['alternativum_linguam']
# opts = self.keys
"#<#{self.class} @gid=#{gid} @lid=#{lid} @optionem=[#{opts.join(', ')}]>"
end

Expand Down
8 changes: 6 additions & 2 deletions _plugins/hapi/drops/hapi_drop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ def tm
def to_s # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
optionem_explanandum = []
@optionem.each_key do |clavem|
# puts 'clavem'
# puts clavem

optionem_item = ''
if @optionem[clavem].length.positive? && @optionem[clavem][0] && @optionem[clavem][0].keys
# if @optionem[clavem].length.positive? && @optionem[clavem][0] && @optionem[clavem][0].keys
if @optionem[clavem].length.positive? && @optionem[clavem][0] && defined? @optionem[clavem][0].keys
optionem_item = @optionem[clavem][0].keys.join(', ')
# puts @optionem[clavem][0].inspect
optionem_explanandum.append("#{clavem} => {dēscendēns => #{@optionem[clavem].length}, optionem => #{optionem_item}}")
Expand Down Expand Up @@ -122,7 +126,7 @@ def xschemam
@optionem['xschemam']
end

# TODO: abstract xschemam
# TODO: abstract xtm
def xtm
@optionem['xtm']
end
Expand Down
10 changes: 9 additions & 1 deletion _plugins/hapi/hic_sunt_dracones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def initiale_pre_render # rubocop:disable Metrics/AbcSize, Metrics/MethodLength,
'xschemam' => xschemam, # Nota: acesse via globum ou entao interaga direto via schemam
# 'xschemam' => { 'TODO' => '_[eng] To be implemented also here [eng]_' },
'tm' => tm,
'xtm' => xtm,
'globum' => globum,
'categoriam' => categoriam,
'pittacium' => pittacium
Expand Down Expand Up @@ -422,13 +423,20 @@ def globum?(api_collectionem = nil, schemam_collectionem = nil, tm_collectionem
# TODO: this is a draft, needs implement exclusive XTmDrop
if !!tm.xdefallo_est && tm.gid_est?(clavem_gid)
# puts " #{schemam.nomen}"
res['collectionem_xtm'].append(Hapi::Drops::XTranslationemMemoriamDrop.new(tm))
# res['collectionem_xtm'].append(Hapi::Drops::XTranslationemMemoriamDrop.new(tm))
res['collectionem_xtm'].append(tm)
end

# res['collectionem_xapi'].append(api) if api.xdefallo_est && api.gid_est?(clavem_gid)
# # resultatum[clavem] = valendum
end

# puts res['collectionem_tm']
# puts ''
# puts ''
# puts ''
# puts res['collectionem_xtm']

# resultatum.append(res)
drop = Hapi::Drops::HapiGlobumDrop.new(res)
resultatum.append(drop)
Expand Down
4 changes: 2 additions & 2 deletions _plugins/hapi/paginam/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ def openapi_filum
end

# TODO: remove obsolete parts
# TODO: Hapi::HapiCommunePaginam.titulum?
# TODO: Hapi::HapiPaginamCommune.titulum?
def titulum
@titulum || @nomen || @title
end

# TODO: Hapi::HapiCommunePaginam.titulum?
# TODO: Hapi::HapiPaginamCommune.titulum?
def nomen
@titulum || @nomen || @title
end
Expand Down
9 changes: 0 additions & 9 deletions _plugins/hapi/paginam/tm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,6 @@ def tags
]
end

# TODO: remove obsolete parts
def titulum
# {% _🗣️ schemam_datum_nomen 🗣️_ %}: {{ schemam.nomen }}
prefix = Hapi::HSD.l10n_simplex('schemam_datum_nomen', linguam)
# @titulum || @nomen || @title || @datum['summarius']

"#{prefix} : #{nomen}"
end

# _[eng] Returns the object as a debug String [eng]_
# @see https://github.com/jekyll/jekyll/blob/master/lib/jekyll/collection.rb
# @see https://github.com/jekyll/jekyll/blob/master/lib/jekyll/page.rb
Expand Down

0 comments on commit 83376c1

Please sign in to comment.