Skip to content

Commit

Permalink
mvp-tema-i18n (#9): _data/expandendum/api.json iniciado
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Jun 24, 2021
1 parent 8e2451c commit ff32eff
Show file tree
Hide file tree
Showing 10 changed files with 283 additions and 12 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exclude:
- _data/navigationem.l10n.json
- _data/referens.l10n.json
- _data/schema.l10n.json
- _data/expandendum/schemam.json
- _data/expandendum/
- _data/tm/
- _assets/

Expand Down
16 changes: 16 additions & 0 deletions _data/expandendum/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# _data/expandendum
> \_[eng-Latn] Do not manually edit files on this folder. They are expanded from the yml files on upper directory [eng-Latn]\_
>
> \_[por-Latn] Não edite manualmente arquivos nesta pasta. Eles são gerados a partir do .yml na pasta acima [por-Latn]\_

- [_data/schemam.yml](../schemam.yml)
- [_data/expandendum/schemam.json](schemam.json)
- (non-Git) [_site/data/schemam.l10n.json](../../_site/data/schemam.l10n.json)(non-Git)
- (non-Git) [_data/l10n/schemam.l10n.json](../l10n/schemam.l10n.json)(non-Git)
- [_data/api.yml](../api.yml)
- [_data/expandendum/api.json](api.json)
- (non-Git) [_site/data/api.l10n.json](../../_site/data/api.l10n.json)(non-Git)
- (non-Git) [_data/l10n/api.l10n.json](../l10n/api.l10n.json) (non-Git)


193 changes: 193 additions & 0 deletions _data/expandendum/api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
[
{
"xdefallo": "/mul-Zyyy/api/UN/HDX/",
"xdefallo_est": 1,
"linguam": "mul-Zyyy",
"typum": "api",
"gid": "UN",
"lid": "HDX",
"title": "Alternātīvum pāginam: {% _🗣️ 📝eng-Latn📝 Hapi_api_UN_HDX_titulum 📝eng-Latn📝 🗣️_ %}",
"noindex": true
},
{
"xdefallo": "/mul-Zyyy/api/UN/HDX/",
"linguam": "eng-Latn",
"typum": "api",
"gid": "UN",
"lid": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 Hapi_api_UN_HDX_slug 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"openapi_filum": "/api/UN/HDX/eng/openapi.yaml",
"title": "{% _🗣️ 📝eng-Latn📝 Hapi_api_UN_HDX_titulum 📝eng-Latn📝 🗣️_ %}",
"opus_in_progressu": true,
"experimentum_est": true,
"noindex": true
},
{
"xdefallo": "/mul-Zyyy/api/UN/HDX/",
"linguam": "por-Latn",
"typum": "api",
"gid": "UN",
"lid": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 Hapi_api_UN_HDX_slug 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"openapi_filum": "/api/UN/HDX/eng/openapi.yaml",
"title": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 Hapi_api_UN_HDX_titulum 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"noindex": true,
"opus_in_progressu": true,
"experimentum_est": true
},
{
"xdefallo": "/mul-Zyyy/api/UN/HDX/",
"linguam": "arb-Arab",
"typum": "api",
"gid": "UN",
"lid": "اختبارات",
"openapi_filum": "/api/UN/HDX/eng/openapi.yaml",
"title": "اختبارات",
"opus_in_progressu": true,
"experimentum_est": true,
"noindex": true
},
{
"xdefallo": "/mul-Zyyy/api/UN/reliefweb/",
"xdefallo_est": 1,
"linguam": "mul-Zyyy",
"typum": "api",
"gid": "UN",
"lid": "reliefweb",
"title": "Alternātīvum pāginam: {% _🗣️ 📝eng-Latn📝 Hapi_api_UN_reliefweb_titulum 📝eng-Latn📝 🗣️_ %}"
},
{
"xdefallo": "/mul-Zyyy/api/UN/reliefweb/",
"linguam": "eng-Latn",
"typum": "api",
"gid": "UN",
"lid": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 Hapi_api_UN_reliefweb_slug 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"openapi_filum": "/api/UN/reliefweb/eng/openapi.yaml",
"title": "{% _🗣️ 📝eng-Latn📝 Hapi_api_UN_reliefweb_titulum 📝eng-Latn📝 🗣️_ %}"
},
{
"xdefallo": "/mul-Zyyy/api/UN/reliefweb/",
"linguam": "por-Latn",
"typum": "api",
"gid": "UN",
"lid": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 Hapi_api_UN_reliefweb_slug 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"openapi_filum": "/api/UN/reliefweb/eng/openapi.yaml",
"title": "{% _🗣️ 📝por-Latn📝 Hapi_api_UN_reliefweb_titulum 📝por-Latn📝 🗣️_ %}",
"opus_in_progressu": true,
"experimentum_est": true
},
{
"xdefallo": "/mul-Zyyy/api/UN/CODV2API/",
"xdefallo_est": 1,
"linguam": "mul-Zyyy",
"typum": "api",
"gid": "UN",
"lid": "CODV2API",
"title": "Alternātīvum pāginam: {% _🗣️ 📝eng-Latn📝 Hapi_api_UN_CODV2API_titulum 📝eng-Latn📝 🗣️_ %}",
"opus_in_progressu": true,
"experimentum_est": true
},
{
"xdefallo": "/mul-Zyyy/api/UN/CODV2API/",
"linguam": "eng-Latn",
"typum": "api",
"gid": "UN",
"lid": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 Hapi_api_UN_CODV2API_slug 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"openapi_filum": "/api/UN/CODV2API/eng/openapi.yaml",
"title": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 Hapi_api_UN_CODV2API_titulum 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"opus_in_progressu": true,
"experimentum_est": true
},
{
"xdefallo": "/mul-Zyyy/api/UN/CODV2API/",
"linguam": "por-Latn",
"typum": "api",
"gid": "UN",
"lid": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 Hapi_api_UN_CODV2API_slug 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"openapi_filum": "/api/UN/CODV2API/eng/openapi.yaml",
"title": "{% _🗣️ 📝por-Latn📝 Hapi_api_UN_CODV2API_titulum 📝por-Latn📝 🗣️_ %}",
"opus_in_progressu": true,
"experimentum_est": true
},
{
"xdefallo": "/mul-Zyyy/api/XZ/HXL-Proxy/",
"xdefallo_est": 1,
"linguam": "mul-Zyyy",
"typum": "api",
"gid": "XZ",
"lid": "HXL-Proxy",
"title": "Alternātīvum pāginam: {% _🗣️ 📝eng-Latn📝 Hapi_api_XZ_HXL-Proxy_titulum 📝eng-Latn📝 🗣️_ %}"
},
{
"xdefallo": "/mul-Zyyy/api/XZ/HXL-Proxy/",
"linguam": "eng-Latn",
"typum": "api",
"gid": "XZ",
"lid": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 Hapi_api_XZ_HXL-Proxy_slug 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"openapi_filum": "/api/XZ/HXL-Proxy/eng/openapi.yaml",
"title": "{% _🗣️ 📝eng-Latn📝 Hapi_api_XZ_HXL-Proxy_titulum 📝eng-Latn📝 🗣️_ %}"
},
{
"xdefallo": "/mul-Zyyy/api/XZ/HXL-Proxy/",
"linguam": "por-Latn",
"typum": "api",
"gid": "XZ",
"lid": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 Hapi_api_XZ_HXL-Proxy_slug 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"openapi_filum": "/api/XZ/HXL-Proxy/eng/openapi.yaml",
"title": "{% _🗣️ 📝por-Latn📝 Hapi_api_XZ_HXL-Proxy_titulum 📝por-Latn📝 🗣️_ %}"
},
{
"xdefallo": "/mul-Zyyy/api/BR/portais-ckan-brasil/",
"xdefallo_est": 1,
"linguam": "mul-Zyyy",
"typum": "api",
"gid": "BR",
"lid": "portais-ckan-brasil",
"title": "Alternātīvum pāginam: {% _🗣️ 📝eng-Latn📝 Hapi_api_BR_portais-ckan-brasil_titulum 📝eng-Latn📝 🗣️_ %}"
},
{
"xdefallo": "/mul-Zyyy/api/BR/portais-ckan-brasil/",
"linguam": "eng-Latn",
"typum": "api",
"gid": "BR",
"lid": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 Hapi_api_BR_portais-ckan-brasil_slug 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"openapi_filum": "/api/BR/brazilian-ckan-portals/eng/openapi.yaml",
"title": "{% _🗣️ 📝eng-Latn📝 Hapi_api_BR_portais-ckan-brasil_titulum 📝eng-Latn📝 🗣️_ %}",
"description": "Discussão em https://github.com/HXL-CPLP/COD-Services-API-doc/issues/4\n"
},
{
"xdefallo": "/mul-Zyyy/api/BR/portais-ckan-brasil/",
"linguam": "por-Latn",
"typum": "api",
"gid": "BR",
"lid": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 Hapi_api_BR_portais-ckan-brasil_slug 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"openapi_filum": "/api/BR/portais-ckan-brasil/por/openapi.yaml",
"title": "{% _🗣️ 📝por-Latn📝 Hapi_api_BR_portais-ckan-brasil_titulum 📝por-Latn📝 🗣️_ %}",
"description": "Discussão em https://github.com/HXL-CPLP/COD-Services-API-doc/issues/4\n"
},
{
"xdefallo": "/mul-Zyyy/api/BR/portais-arcgis-brasil/",
"xdefallo_est": 1,
"linguam": "mul-Zyyy",
"typum": "api",
"gid": "BR",
"lid": "portais-arcgis-brasil",
"title": "Alternātīvum pāginam: {% _🗣️ 📝por-Latn📝 Hapi_api_BR_portais-arcgis-brasil_titulum 📝por-Latn📝 🗣️_ %}"
},
{
"xdefallo": "/mul-Zyyy/api/BR/portais-arcgis-brasil/",
"linguam": "eng-Latn",
"typum": "api",
"gid": "BR",
"lid": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 Hapi_api_BR_portais-arcgis-brasil_slug 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"openapi_filum": "/api/BR/portais-arcgis-brasil/por/openapi.yaml",
"title": "{% _🗣️ 📝eng-Latn📝 Hapi_api_BR_portais-arcgis-brasil_titulum 📝eng-Latn📝 🗣️_ %}"
},
{
"xdefallo": "/mul-Zyyy/api/BR/portais-arcgis-brasil/",
"linguam": "por-Latn",
"typum": "api",
"gid": "BR",
"lid": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 Hapi_api_BR_portais-arcgis-brasil_slug 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"openapi_filum": "/api/BR/portais-arcgis-brasil/por/openapi.yaml",
"title": "{% _🗣️ 📝por-Latn📝 Hapi_api_BR_portais-arcgis-brasil_titulum 📝por-Latn📝 🗣️_ %}"
}
]
2 changes: 1 addition & 1 deletion _data/navigationem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ principale:
- nomen: separator

- xdefallo: /mul-Zyyy/schemam/UN/HTCDS/
nomen: '{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_nomen 🗣️_ %}'
nomen: '{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_titulum 🗣️_ %}'
iri: '/{% _🗣️ 🔎🔕🔍 L10N_ego_codicem 🔎🔕🔍 🗣️_ %}/{% _🗣️ 🔎🔕🔍 Hapi_schemam_slug 🔎🔕🔍 🗣️_ %}/UN/{% _🗣️ 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_slug 🔎🔕🔍 🗣️_ %}/'

- nomen: <span lang="en" dir="ltr">UN M49</span>
Expand Down
62 changes: 61 additions & 1 deletion _plugins/hapi/hic_sunt_dracones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,25 @@ module HSD # rubocop:disable Metrics/ModuleLength
module_function

def initiale_after_reset(site)
api_fontem_path = File.join(site.source, '/_data/api.yml')
schemam_fontem_path = File.join(site.source, '/_data/schemam.yml')
hapi_referens_path = File.join(site.source, '/_data/referens.yml')
schemam_expandendum_path = File.join(site.source, '/_data/expandendum/schemam.json')
api_expandendum_path = File.join(site.source, '/_data/expandendum/api.json')

api_referens = YAML.load_file(hapi_referens_path)
api_fontem = YAML.load_file(api_fontem_path)
schemam_fontem = YAML.load_file(schemam_fontem_path)
api_expandendum = Hapi::HSD.expandendum_api_archivum(api_fontem, api_referens['schemam'])
schemam_expandendum = Hapi::HSD.expandendum_schemam_archivum(schemam_fontem, api_referens['schemam'])
# puts "initiale_after_reset #{site.source}"
# puts "initiale_after_reset #{schemam_fontem_path} #{schemam_expandendum_path} #{api_referens['schemam']}"
File.open(api_expandendum_path, 'w') do |f|
f.write(JSON.pretty_generate(api_expandendum))
end
File.open(schemam_expandendum_path, 'w') do |f|
f.write(JSON.pretty_generate(schemam_expandendum))
end

# File.write("public/temp.json",tempHash.to_json)

# puts thing['schemam'].inspect
Expand Down Expand Up @@ -214,6 +220,60 @@ def data!(data)
Jekyll.sites[idx].data = data
end

# _[mul-Zyyy] _data/api.yml => _data/expandendum/api.json [mul-Zyyy]_
# _[lat-Latn] Expandendum schēmam archīvum [lat-Latn]_
def expandendum_api_archivum(api_collectionem, referens_api)
resultatum = []
api_collectionem.each do |item|
if item['farmulam'].nil?
resultatum.append(item)
else
items = Hapi::HSD.expandendum_api_de_farmulam(item['farmulam'], referens_api)
resultatum.concat(items) unless items.empty?
end
end

resultatum
end

# _[lat-Latn] Expandendum schēmam de fōrmulam [lat-Latn]_
def expandendum_api_de_farmulam(schemam_farmulam, referens_api = {}) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
resultatum = []
ref = referens_api.dig('defallo', 'farmulam')

raise "[#{self.class.name}:#{__LINE__}] _data/referens.yml api.defallo.farmulam?" unless ref

# raise "[#{self.class.name}:#{__LINE__}] _data/referens.yml schemam.defallo?" unless ref['']

# puts ''

meta = ref.deep_merge(schemam_farmulam)
paginam_linguam = ref.dig('commendandum', 'paginam_linguam')
paginam_linguam_experimentum = ref.dig('commendandum', 'paginam_linguam_experimentum')

unless paginam_linguam
raise "[#{self.class.name}:#{__LINE__}] _data/referens.yml + _data/api.yml: paginam_linguam?"
end

paginam_linguam.each do |linguam|
# puts "TODO #{linguam}"
resultatum.append(
Hapi::HSD.convertendum_obiectum_linguam(meta['structuram'], "📝#{linguam}📝")
)
end

if paginam_linguam_experimentum # rubocop:disable Style/SafeNavigation
paginam_linguam_experimentum.each do |linguam|
# puts "TODO #{linguam}"
rem = Hapi::HSD.convertendum_obiectum_linguam(meta['structuram'], "📝#{linguam}📝")
rem['experimentum_est'] = true
resultatum.append(rem)
end
end

resultatum
end

# _[mul-Zyyy] _data/schemam.yml => _data/expandendum/schemam.json [mul-Zyyy]_
# _[lat-Latn] Expandendum schēmam archīvum [lat-Latn]_
def expandendum_schemam_archivum(schemam_collectionem, referens_schemam)
Expand Down
1 change: 1 addition & 0 deletions _plugins/hapi/paginam/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class ApiPaginam < Hapi::HapiPaginamCommune
gid
uid
titulum
title
html_body_class
nomen
summarius
Expand Down
13 changes: 5 additions & 8 deletions _plugins/hapi/paginam/commune.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class HapiPaginamCommune < Jekyll::Page # rubocop:disable Metrics/ClassLength
summarius
tags
titulum
title
trivium
uid
url
Expand Down Expand Up @@ -216,19 +217,15 @@ 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

def titulum
@datum['titulum'] || @datum['nomen']
end

# _[eng-Latn] Since we still using Jekyll-SEO-tag, we need to define title [eng-Latn]_
# _[por-Latn] Como ainda estamos usando o Jekyll-SEO-tag, é necessário definir title [por-Latn]_
alias title titulum

# Trivia
# - 'trivium'
# - https://en.wiktionary.org/wiki/trivium#Latin
Expand Down
1 change: 1 addition & 0 deletions _plugins/hapi/paginam/schemam.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class SchemamPaginam < Hapi::HapiPaginamCommune
summarius
tags
titulum
title
trivium
uid
url
Expand Down
1 change: 1 addition & 0 deletions _plugins/hapi/paginam/tm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class TranslationemMemoriamPaginam < Hapi::HapiPaginamCommune
summarius
tags
titulum
title
trivium
uid
url
Expand Down
4 changes: 3 additions & 1 deletion _systema/infrastructuram/site-tmp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ if [ ! -d "${DESTDIR}" ]; then
# exit 0
fi

# (... not finished)

# ln -s /tmp/jekyll_site/ /workspace/git/HXL-CPLP/Auxilium-Humanitarium-API/_site
ln -s /tmp/jekyll_site/ "$DESTDIR"

0 comments on commit ff32eff

Please sign in to comment.