Skip to content

Commit

Permalink
mvp-tema-i18n (#9), travis-ci, remocao (#8): includes/js/mea-linguam …
Browse files Browse the repository at this point in the history
…importado; criado _data/referens.yml (para versão mais avançada de defaults do Jekyll
  • Loading branch information
fititnt committed May 16, 2021
1 parent 1b90898 commit 804aaaa
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 77 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@
*.graphql linguist-detectable
*.gql linguist-detectable
*.graphqls linguist-detectable
*.liquid linguist-detectable

## Markdown are documentation (this could be changed later)
*.md linguist-documentation

## These files are HTML liquid templates
_includes/fn/* linguist-language=Liquid
_layout/* linguist-language=Liquid

## Files on _systema/, at the moment, will be marked as vendored
## We may change a bit this later
_systema/* linguist-vendored

Gemfile linguist-vendored
robots.txt linguist-vendored
documentum/robots.txt linguist-vendored

## This (test) file on schema needs to be ignored
schema/graphql.schema.mjs linguist-generated
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Auxilium Humanitarium API documentōrum
# Auxilium Humanitarium API documentōrum <sup>(alpha)</sup>

[![Site](https://img.shields.io/badge/Site-hapi.etica.ai-blue)](https://hapi.etica.ai)
[![HXL-CPLP/Auxilium-Humanitarium-API](https://img.shields.io/badge/GitHub-HXL--CPLP%2FAuxilium--Humanitarium--API-lightgrey?logo=github&style=social)](https://github.com/HXL-CPLP/Auxilium-Humanitarium-API)
Expand Down
23 changes: 22 additions & 1 deletion _data/Temporarium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,25 @@ Temp_hapi_api_salvar_como_pdf_por: "Salvar como PDF"
Temp_hapi_api_salvar_como_pdf_eng: "Save as PDF"
Temp_TOC_lat: "Índice de Conteúdo"
Temp_TOC_por: "Índice de Conteúdo"
Temp_TOC_eng: "Table of contents"
Temp_TOC_eng: "Table of contents"

Temp_licença_aviso_lat: |
?!(Temp_licença_aviso_lat)!?
Temp_licença_aviso_eng: |
<!--TODO: This license terms are a draft; Need to be reviewned -->
[![Public Domain Dedication](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://unlicense.org/)
The [HXL-CPLP](https://github.com/HXL-CPLP) has dedicated this work to the
[public domain](https://unlicense.org/) by waiving all of their rights to the work worldwide
under copyright law, including all related and neighboring rights, to the extent
allowed by law.
Temp_licença_aviso_por: |
<!--TODO: o texto em português da licença é um rascunho. Ainda precisa ser revisado -->
[![Dedicação ao domínio publico](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://unlicense.org/)
Na medida do possível sob a lei, as pessoas autoras de
[HXL-CPLP](https://github.com/HXL-CPLP) renunciam todos os direitos autorais e
direitos conexos ou vizinhos a este trabalho para o [domínio público](https://unlicense.org/).
28 changes: 28 additions & 0 deletions _data/referens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# - "referēns"
# - https://en.wiktionary.org/wiki/referens#Latin
# - https://en.wiktionary.org/wiki/reference#English
# - "scopum"
# - https://en.wiktionary.org/wiki/scopus#Latin
# - https://en.wiktionary.org/wiki/scope#English
# - "front-matter-defaults"
# - https://jekyllrb.com/docs/configuration/front-matter-defaults/

linguam:
eng:
locale: en

## Noticia:
## [por] Em geral, vamos usar Português (genérico) e evitar usar pt_BR
## ou pt_PT. Isso faz sentido em outras línguas onde a diferença é
## muito mais significativa, porém português escrito tem pouca
## variações
por:
locale: pt
por-BR:
locale: pt_BR
por-PT:
locale: pt_PT


### Temp
# - https://en.wikipedia.org/wiki/IETF_language_tag
54 changes: 54 additions & 0 deletions _includes/js/mea-linguam.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% comment %}
# @see https://github.com/fititnt/ais-ethics-tags/blob/master/assets/js/ais-ethics-tags.js
# @see https://github.com/EticaAI/HXL-Data-Science-file-formats/blob/main/hxlm-js/bootstrapper/hdpb-l10n.mjs
{% endcomment %}
<script type="module">

/**
* HDPbL10n
*
* Trivia:
* - i18n with lowercase "i"
* - L10n with UPPERCASE "L"
* Fontem:
* - https://github.com/fititnt/ais-ethics-tags/blob/master/assets/js/ais-ethics-tags.js
* - https://github.com/EticaAI/HXL-Data-Science-file-formats/blob/main/hxlm-js/bootstrapper/hdpb-l10n.mjs
*/
class HDPbL10n {

/**
* Who I am
*
* Trivia:
* - 'Quis sum?' is 'who I am' in Latin
* - 'mea linguam' is 'my (natural) language' in Latin
* - 'mea linguam fontem' is 'my source (natural) language' in Latin
* - 'mea linguam et alli' needs revision. (its an array)
* - Code:
* - Based on the English version ais-ethics-tags.js (https://tags.etica.ai)
* @returns {Object}
*/
static quis_sum() {
// TODO: navigator.languages does not work when running with NodeJS.
// we should at least make it not break hard
// (Emerson Rocha, 2021-04-06 00:05 UTC)

let resultatum = {};
resultatum.meaLinguam = navigator.language || navigator.userLanguage;
resultatum.meaLinguamEtAliiFontem = navigator.languages || [resultatum.meaLinguam];
resultatum.meaLinguamEtAlii = [];
resultatum.meaLinguamEtAliiFontem.forEach(function (lang) {
let wdLang = lang.split('-');
if (resultatum.meaLinguamEtAlii.indexOf(wdLang[0]) === -1) {
resultatum.meaLinguamEtAlii.push(wdLang[0]);
}
})
return resultatum
}
}

// debug
console.log(HDPbL10n.quis_sum())

export { HDPbL10n }
</script>
36 changes: 33 additions & 3 deletions _layouts/fiat-lux.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,44 @@

<body>

{%- include caput.html -%}

<main class="page-content" aria-label="Content">
<div class="container">
{{ content }}
<div class="px-4 pt-5 my-5 text-center border-bottom">
<h1 class="display-4 fw-bold">{% include fn/L10n vocab="L10n_HAPI_namen" %} <sup>(alpha)</sup></h1>
<div class="col-lg-6 mx-auto">
<!--
<p class="lead mb-4">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
-->
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center mb-5">
<a href="/eng/" class="btn btn-primary btn-lg px-4 me-sm-3">{% include fn/L10n vocab="L10n_HAPI_linguam_ego" linguam="eng" %}</a>
<br>
<a href="/por/" class="btn btn-primary btn-lg px-4">{% include fn/L10n vocab="L10n_HAPI_linguam_ego" linguam="por" %}</a>
</div>
</div>
</div>

{% comment %}
@TODO: [por] Centralizar esta div que aparece na pagina inicial https://hapi.etica.ai/ (Emerson Rocha, 2021-05-16 16:50 UTC)
{% endcomment %}

<ul class="list-group list-group-horizontal">
<li class="list-group-item">
<a href="https://hapi.etica.ai"><img src="https://img.shields.io/badge/Site-hapi.etica.ai-blue" alt="hapi.etica.ai"></a>
</li>
<li class="list-group-item">
<a href="https://github.com/HXL-CPLP/Auxilium-Humanitarium-API"><img src="https://img.shields.io/badge/GitHub-HXL--CPLP%2FAuxilium--Humanitarium--API-lightgrey?logo=github&style=social" alt="HXL-CPLP/Auxilium-Humanitarium-API"></a>
</li>
<li class="list-group-item">
<a href="https://github.com/HXL-CPLP/Auxilium-Humanitarium-API"><img src="https://img.shields.io/github/stars/HXL-CPLP/Auxilium-Humanitarium-API?style=social" alt="GitHub Repo stars"></a>
</li>
<li class="list-group-item">
<a href="https://github.com/HXL-CPLP/Auxilium-Humanitarium-API/archive/refs/heads/main.zip"><img src="https://img.shields.io/badge/Download-.zip-brightgreen" alt="Download .zip"></a>
</li>
</ul>
</div>
</main>

{%- include js/mea-linguam.html -%}
{%- include pedem.html -%}

</body>
Expand Down
9 changes: 1 addition & 8 deletions documentum/eng/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,4 @@ toc: true

## License

<!--TODO: This license terms are a draft; Need to be reviewned -->

[![Public Domain Dedication](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://unlicense.org/)

The [HXL-CPLP](https://github.com/HXL-CPLP) has dedicated this work to the
[public domain](https://unlicense.org/) by waiving all of their rights to the work worldwide
under copyright law, including all related and neighboring rights, to the extent
allowed by law.
{% include fn/Conatum prefix='Temp_licença_aviso' %}
45 changes: 4 additions & 41 deletions documentum/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,9 @@ locale: la
# linguam: lat
# linguam_alternum: lat
permalink: /
layout: fiat-lux
---

<!--
[![Site](https://img.shields.io/badge/Site-hapi.etica.ai-blue)](https://hapi.etica.ai)
[![HXL-CPLP/Auxilium-Humanitarium-API](https://img.shields.io/badge/GitHub-HXL--CPLP%2FAuxilium--Humanitarium--API-lightgrey?logo=github&style=social)](https://github.com/HXL-CPLP/Auxilium-Humanitarium-API)
[![GitHub Repo stars](https://img.shields.io/github/stars/HXL-CPLP/Auxilium-Humanitarium-API?style=social)](https://github.com/HXL-CPLP/Auxilium-Humanitarium-API)
[![Download .zip](https://img.shields.io/badge/Download-.zip-brightgreen)](https://github.com/HXL-CPLP/Auxilium-Humanitarium-API/archive/refs/heads/main.zip)
> - [Documentation in English language (Latin script) here](/eng/)
> - [Documentação na língua portuguesa (alfabeto latino) aqui](/por/)
-->

<div class="px-4 pt-5 my-5 text-center border-bottom">
<h1 class="display-4 fw-bold">{% include fn/L10n vocab="L10n_HAPI_namen" %}</h1>
<div class="col-lg-6 mx-auto">
<!--
<p class="lead mb-4">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
-->
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center mb-5">
<a href="/eng/" class="btn btn-primary btn-lg px-4 me-sm-3">{% include fn/L10n vocab="L10n_HAPI_linguam_ego" linguam="eng" %}</a>
<br>
<a href="/por/" class="btn btn-primary btn-lg px-4">{% include fn/L10n vocab="L10n_HAPI_linguam_ego" linguam="por" %}</a>
</div>
</div>
</div>

<ul class="list-group list-group-horizontal">
<li class="list-group-item">
<a href="https://hapi.etica.ai"><img src="https://img.shields.io/badge/Site-hapi.etica.ai-blue" alt="hapi.etica.ai"></a>
</li>
<li class="list-group-item">
<a href="https://github.com/HXL-CPLP/Auxilium-Humanitarium-API"><img src="https://img.shields.io/badge/GitHub-HXL--CPLP%2FAuxilium--Humanitarium--API-lightgrey?logo=github&style=social" alt="HXL-CPLP/Auxilium-Humanitarium-API"></a>
</li>
<li class="list-group-item">
<a href="https://github.com/HXL-CPLP/Auxilium-Humanitarium-API"><img src="https://img.shields.io/github/stars/HXL-CPLP/Auxilium-Humanitarium-API?style=social" alt="GitHub Repo stars"></a>
</li>
<li class="list-group-item">
<a href="https://github.com/HXL-CPLP/Auxilium-Humanitarium-API/archive/refs/heads/main.zip"><img src="https://img.shields.io/badge/Download-.zip-brightgreen" alt="Download .zip"></a>
</li>
</ul>
- Notitia:
- [por] Edite diretametne [_layouts/fiat-lux.html](_layouts/fiat-lux.html).
conteúdo aqui não é carregado no layout final.
8 changes: 1 addition & 7 deletions documentum/por/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,4 @@ toc: true

## Licença

<!--TODO: o texto em português da licença é um rascunho. Ainda precisa ser revisado -->

[![Public Domain Dedication](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://unlicense.org/)

Na medida do possível sob a lei, as pessoas autoras de
[HXL-CPLP](https://github.com/HXL-CPLP) renunciam todos os direitos autorais e
direitos conexos ou vizinhos a este trabalho para o [domínio público](https://unlicense.org/).
{% include fn/Conatum prefix='Temp_licença_aviso' %}

0 comments on commit 804aaaa

Please sign in to comment.