Skip to content

Commit

Permalink
Uso de {% _ TERMO _ %} / {% __ TERMO __ %} / {% ___ TERMO ___ %} para…
Browse files Browse the repository at this point in the history
… simplificar uso scripts RLT (Arab, Hebr, ...)

Hapi::Translationem::DeL10n (rascunho):
  Converte '#item +id' da coleção de memórias de tradução para
  o idioma requisitado pelo contexto da página atual.
  Para simplificar documentação com uso em sistemas de escrita
  direita-para-esquerda intencionamente tanto início como
  final do método repetem a função.

HXL-CPLP/forum#58, hapi-t9n-alpha (#13), mvp-l10n-schemas (#7)
  • Loading branch information
fititnt committed May 28, 2021
1 parent 896743f commit a7a103a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 23 deletions.
37 changes: 20 additions & 17 deletions _includes/schema/iso639-3/iso639-3.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "{{ site.url }}{{ page.url }}",
"title": "{% __ ISO_639-3_nomen %}",
"description": "Codes for the representation of names of languages – Part 3: Alpha-3 code for comprehensive coverage of languages",
"title": "{% _ ISO_639-3_nomen _ %}",
"description": "{% _ ISO_639-3_summarius _ %}",
"$comment": "See https://iso639-3.sil.org/code_tables/download_tables \n https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3.tab \n https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso639-3_table_definition.txt",
"type": "object",
"required": [
Expand All @@ -13,41 +13,42 @@
],
"properties": {
"Id": {
"description": "The three-letter 639-3 identifier",
"description": "{% _ ISO_639-3_optionem_Id_summarius _ %}",
"type": "string",
"length": 3,
"example": "por"
"example": "{% _ ISO_639-3_optionem_Id_exemplum _ %}"
},
"Part2B": {
"description": "Equivalent 639-2 identifier of the bibliographic applications code set, if there is one",
"description": "{% _ ISO_639-3_optionem_Part2B_summarius _ %}",
"type": "string",
"length": 3,
"example": "por"
"example": "{% _ ISO_639-3_optionem_Part2B_exemplum _ %}"
},
"Part2T": {
"description": "Equivalent 639-2 identifier of the terminology applications code set, if there is one",
"description": "{% _ ISO_639-3_optionem_Part2T_summarius _ %}",
"type": "string",
"length": 3,
"example": "por"
"example": "{% _ ISO_639-3_optionem_Part2T_exemplum %}"
},
"Part1": {
"description": "Equivalent 639-1 identifier, if there is one",
"description": "{% _ ISO_639-3_optionem_Part1_summarius _ %}",
"type": "string",
"length": 2,
"example": "pt"
"example": "{% _ ISO_639-3_optionem_Part1_exemplum _ %}"
},
"Scope": {
"description": "I(ndividual), M(acrolanguage), S(pecial)",
"description": "{% _ ISO_639-3_optionem_Scope_summarius _ %}",
"type": "string",
"length": 1,
"enum": [
"I",
"M",
"S"
]
],
"example": "{% _ ISO_639-3_optionem_Scope_exemplum _ %}"
},
"Type": {
"description": "A(ncient), C(onstructed), E(xtinct), H(istorical), L(iving), S(pecial)",
"description": "{% _ ISO_639-3_optionem_Type_summarius _ %}",
"type": "string",
"length": 1,
"enum": [
Expand All @@ -57,17 +58,19 @@
"H",
"L",
"S"
]
],
"example": "{% _ ISO_639-3_optionem_Type_exemplum _ %}"
},
"Ref_Name": {
"description": "Reference language name",
"description": "{% _ ISO_639-3_optionem_Ref_Name_summarius _ %}",
"type": "string",
"maxLengh": 150
},
"Comment": {
"description": "Comment relating to one or more of the columns",
"description": "{% _ ISO_639-3_optionem_Ref_Name_summarius _ %}",
"type": "string",
"maxLengh": 150
"maxLengh": 150,
"example": "{% _ ISO_639-3_optionem_Ref_Name_exemplum _ %}"
}
}
}
44 changes: 38 additions & 6 deletions _plugins/jekyll_hapi_translationem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,18 @@ def significationem_incognitum_textum(textum, context)
}
end

def translationem_memoriam_collectionem(contextum)
# puts 'test'
puts contextum['site']['data']['tm'].keys
end

def translationem_memoriam_rememorandum(codicem, linguam, contextum)
tm_collectionem = translationem_memoriam_collectionem(contextum)

# puts 'test'
# puts contextum['site']['data'].keys
end

# rubocop:enable Metrics/MethodLength
# rubocop:enable Metrics/AbcSize

Expand Down Expand Up @@ -346,19 +358,29 @@ def render(context)
end
end

# _[eng] The {% de_lat_codicem_in (...) %} implementation [eng]_
# _[por] A implementação de {% de_lat_codicem_in (...) %} [por]_
# _[por] Converte '#item +id' da coleção de memórias de tradução para
# o idioma requisitado pelo contexto da página atual.
# Para simplificar documentação com uso em sistemas de escrita
# direita-para-esquerda intencionamente tanto início como
# final do método repetem a função.
# Ou seja:
# {% _ TERMO _ %}
# {% __ TERMO __ %}
# {% ___ TERMO ___ %}
# [por]_
#
# @exemplum Primum exemplum
# {% de_lat_codicem_in por-Latn licentiam_nomen %}
# linguam: por-Latn
# ---
# {% _ dominium_publicum_nomen _ %}
# @resultatum Primum exemplum
# Licença
# Domínio público
class DeL10n < Liquid::Tag
def initialize(tag_name, text, tokens)
super

@tokens = text.strip.split
@linguam_fontem = @tokens.shift
# @linguam_fontem = @tokens.shift
@textum = @tokens.shift

# @iso6393 = Translationem.iso6393_de_linguam(@linguam_fontem)
Expand All @@ -370,6 +392,8 @@ def render(context)
# l10nval = Translationem.datum_l10n(@textum, context, @linguam_fontem)
l10nval = nil

Translationem.translationem_memoriam_collectionem(context)

return l10nval if l10nval

return temp[@textum] if temp && temp[@textum]
Expand All @@ -384,7 +408,9 @@ def render(context)
return Translationem.de(temp["#{@textum}#{suffix}"]) if temp && temp["#{@textum}#{suffix}"]
end

"<!--[de_linguam:[#{@linguam_fontem}]]-->#{@textum}<!--[[#{@linguam_fontem}]:de_linguam]-->"
# "<!--[de_linguam:[#{@linguam_fontem}]]-->#{@textum}<!--[[#{@linguam_fontem}]:de_linguam]-->"
# "_[#{@linguam_fontem}]#{@textum}[#{@linguam_fontem}]_"
"#{@textum}"
end
end

Expand Down Expand Up @@ -741,9 +767,15 @@ def render(context)

# Liquid::Template.register_filter(HapiApi::Translationem)

Liquid::Template.register_tag(
'_', Hapi::Translationem::DeL10n
)
Liquid::Template.register_tag(
'__', Hapi::Translationem::DeL10n
)
Liquid::Template.register_tag(
'___', Hapi::Translationem::DeL10n
)

# Liquid::Template.register_tag('gettext', HapiApi::TranslationemDeLatCodicem)
Liquid::Template.register_tag(
Expand Down

0 comments on commit a7a103a

Please sign in to comment.