From e7f3e27f4a2ca7b5e0f167d2013ccba4ca35a003 Mon Sep 17 00:00:00 2001 From: Emerson Rocha Date: Thu, 13 May 2021 15:38:59 -0300 Subject: [PATCH] mvp-tema-i18n (#9): l10n-corpus.liquid --- .gitattributes | 3 +++ _config.yml | 1 + _data/l10n.csv | 2 +- _includes/fn/l10n | 1 + _includes/fn/l10n-corpus.liquid | 15 +++++++++++++++ _includes/l10n.html | 5 ----- documentum/README.md | 1 + index.md | 9 ++++++--- 8 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 _includes/fn/l10n create mode 100644 _includes/fn/l10n-corpus.liquid delete mode 100644 _includes/l10n.html diff --git a/.gitattributes b/.gitattributes index 61c13b9..500d955 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,6 +13,9 @@ ## Markdown are documentation (this could be changed later) *.md linguist-documentation +## These files are HTML liquid templates +_includes/fn/* linguist-language=Liquid + ## Files on systema/, at the moment, will be marked as vendored ## We may change a bit this later systema/* linguist-vendored diff --git a/_config.yml b/_config.yml index 1fd3d3b..a293d6a 100644 --- a/_config.yml +++ b/_config.yml @@ -56,6 +56,7 @@ defaults: values: layout: "defallo" linguam: "lat" + linguam_alternum: "lat" - scope: path: "api/*/*/*/html" values: diff --git a/_data/l10n.csv b/_data/l10n.csv index 73458b7..c570a03 100644 --- a/_data/l10n.csv +++ b/_data/l10n.csv @@ -1,4 +1,4 @@ -#vocab+code,#vocab+l10n+i_lat,#vocab+l10n+i_eng,#vocab+l10n+i_por +#item+code,#item+l10n+i_lat,#item+l10n+i_eng,#item+l10n+i_por l10n_API,API,API,API l10n_API_UN,API UN 🇺🇳,API UN 🇺🇳,API UN 🇺🇳 l10n_openapi_filum,OpenAPI Fīlum,OpenAPI file,Arquivo OpenAPI diff --git a/_includes/fn/l10n b/_includes/fn/l10n new file mode 100644 index 0000000..0d528f2 --- /dev/null +++ b/_includes/fn/l10n @@ -0,0 +1 @@ +{% capture vocab_no_spaces %}{% include fn/l10n-corpus.liquid vocab="l10n_API" %}{% endcapture %}{{ vocab_no_spaces | strip }} \ No newline at end of file diff --git a/_includes/fn/l10n-corpus.liquid b/_includes/fn/l10n-corpus.liquid new file mode 100644 index 0000000..13fc0ad --- /dev/null +++ b/_includes/fn/l10n-corpus.liquid @@ -0,0 +1,15 @@ +{% capture hxl_col %}{{ '#item+l10n+i_' | append: page.linguam }}{% endcapture %} +{% capture hxl_col_alt %}{{ '#item+l10n+i_' | append: page.linguam_alternum }}{% endcapture %} +{% capture vocab_errorem %}{{ include.vocab | append: '!!' | prepend: '!!' }}{% endcapture %} + +{% for vocab in site.data.l10n %} + {% if vocab['#item+code'] == include.vocab %} + {{ vocab[hxl_col] | default: vocab[hxl_col_alt] | default: vocab[hxl_col_alt] | default: vocab_errorem }} + {% assign resultatum_ok = true %} + {% break %} + {% endif %} +{% endfor %} + +{% if resultatum_ok != true %} + {{ vocab_errorem }} +{% endif %} \ No newline at end of file diff --git a/_includes/l10n.html b/_includes/l10n.html deleted file mode 100644 index 808f987..0000000 --- a/_includes/l10n.html +++ /dev/null @@ -1,5 +0,0 @@ -{% for item in site.data.l10n %} -{% if item['#vocab+code'] == include._ %} -{{ item }} -{% endif %} -{% endfor %} \ No newline at end of file diff --git a/documentum/README.md b/documentum/README.md index c4ce65c..90054db 100644 --- a/documentum/README.md +++ b/documentum/README.md @@ -17,4 +17,5 @@ published: false - https://github.com/GingerBear/vscode-liquid - https://marketplace.visualstudio.com/items?itemName=neilding.language-liquid - https://github.com/siteleaf/liquid-syntax-mode + - https://marketplace.visualstudio.com/items?itemName=neilding.language-liquid --> \ No newline at end of file diff --git a/index.md b/index.md index 9a69e47..ca6b270 100644 --- a/index.md +++ b/index.md @@ -4,7 +4,8 @@ description: | English: Augmented documentation for Humanitarian APIs; Português: Documentação interativa para APIs humanitárias locale: la -linguam: lat +# linguam: lat +# linguam_alternum: lat permalink: / --- @@ -35,7 +36,9 @@ permalink: / + \ No newline at end of file