diff --git a/sphinx_proof/domain.py b/sphinx_proof/domain.py index 289e51a..02508bc 100644 --- a/sphinx_proof/domain.py +++ b/sphinx_proof/domain.py @@ -24,8 +24,13 @@ from .proof_type import PROOF_TYPES from copy import copy +from sphinx.locale import get_translation + logger = logging.getLogger(__name__) +MESSAGE_CATALOG_NAME = "proof" +_ = get_translation(MESSAGE_CATALOG_NAME) + class ProofIndex(Index): @@ -156,7 +161,8 @@ def resolve_xref( number = ".".join( map(str, env.toc_fignumbers[todocname][typ][target]) ) - title = nodes.Text(f"{match['type'].title()} {number}") + # translate title + title = nodes.Text(f"{_(match['type'].title())} {number}") # builder, fromdocname, todocname, targetid, child, title=None return make_refnode(builder, fromdocname, todocname, target, title) else: diff --git a/sphinx_proof/translations/jsons/Algorithm.json b/sphinx_proof/translations/jsons/Algorithm.json index aec3871..6e20979 100644 --- a/sphinx_proof/translations/jsons/Algorithm.json +++ b/sphinx_proof/translations/jsons/Algorithm.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Algorithm"},{"language":"French","symbol":"fr","text":"Algorithme"},{"language":"Italian","symbol":"it","text":"Algoritmo"},{"language":"Czech","symbol":"cs","text":"Algoritmus"}] +[{"language":"English","symbol":"en","text":"Algorithm"},{"language":"French","symbol":"fr","text":"Algorithme"},{"language":"Italian","symbol":"it","text":"Algoritmo"},{"language":"Czech","symbol":"cs","text":"Algoritmus"},{"language":"Spanish","symbol":"es","text":"Algoritmo"},{"language":"German","symbol":"de","text":"Algorithmus"}] diff --git a/sphinx_proof/translations/jsons/Assumption.json b/sphinx_proof/translations/jsons/Assumption.json index 17e55b3..8bf7d71 100644 --- a/sphinx_proof/translations/jsons/Assumption.json +++ b/sphinx_proof/translations/jsons/Assumption.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Assumption"}] +[{"language":"English","symbol":"en","text":"Assumption"},{"language":"Spanish", "symbol":"es","text":"Supuesto"},{"language":"German","symbol":"de","text":"Annahme"}] diff --git a/sphinx_proof/translations/jsons/Axiom.json b/sphinx_proof/translations/jsons/Axiom.json index a6c667a..0204d4f 100644 --- a/sphinx_proof/translations/jsons/Axiom.json +++ b/sphinx_proof/translations/jsons/Axiom.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Axiom"},{"language":"French","symbol":"fr","text":"Axiome"},{"language":"Italian","symbol":"it","text":"Assioma"},{"language":"Czech","symbol":"cs","text":"Axiom"}] +[{"language":"English","symbol":"en","text":"Axiom"},{"language":"French","symbol":"fr","text":"Axiome"},{"language":"Italian","symbol":"it","text":"Assioma"},{"language":"Czech","symbol":"cs","text":"Axiom"},{"language":"Spanish","symbol":"es","text":"Axioma"},{"language":"German","symbol":"de","text":"Axiom"}] diff --git a/sphinx_proof/translations/jsons/Criterion.json b/sphinx_proof/translations/jsons/Criterion.json index e4bc089..c317a95 100644 --- a/sphinx_proof/translations/jsons/Criterion.json +++ b/sphinx_proof/translations/jsons/Criterion.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Criterion"},{"language":"French","symbol":"fr","text":"Critère"},{"language":"Italian","symbol":"it","text":"Criterio"},{"language":"Czech","symbol":"cs","text":"Kritérium"}] +[{"language":"English","symbol":"en","text":"Criterion"},{"language":"French","symbol":"fr","text":"Critère"},{"language":"Italian","symbol":"it","text":"Criterio"},{"language":"Czech","symbol":"cs","text":"Kritérium"},{"language":"Spanish","symbol":"es","text":"Criterio"},{"language":"German","symbol":"de","text":"Kriterium"}] diff --git a/sphinx_proof/translations/jsons/Example.json b/sphinx_proof/translations/jsons/Example.json index e6b8fe7..641aa13 100644 --- a/sphinx_proof/translations/jsons/Example.json +++ b/sphinx_proof/translations/jsons/Example.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Example"},{"language":"French","symbol":"fr","text":"Exemple"},{"language":"Italian","symbol":"it","text":"Esempio"},{"language":"Czech","symbol":"cs","text":"Příklad"}] +[{"language":"English","symbol":"en","text":"Example"},{"language":"French","symbol":"fr","text":"Exemple"},{"language":"Italian","symbol":"it","text":"Esempio"},{"language":"Czech","symbol":"cs","text":"Příklad"},{"language":"Spanish","symbol":"es","text":"Ejemplo"},{"language":"German","symbol":"de","text":"Beispiel"}] diff --git a/sphinx_proof/translations/jsons/Observation.json b/sphinx_proof/translations/jsons/Observation.json index 201ccb2..79ff459 100644 --- a/sphinx_proof/translations/jsons/Observation.json +++ b/sphinx_proof/translations/jsons/Observation.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Observation"},{"language":"French","symbol":"fr","text":"Observation"},{"language":"Italian","symbol":"it","text":"Osservazione"},{"language":"Czech","symbol":"cs","text":"Pozorování"}] +[{"language":"English","symbol":"en","text":"Observation"},{"language":"French","symbol":"fr","text":"Observation"},{"language":"Italian","symbol":"it","text":"Osservazione"},{"language":"Czech","symbol":"cs","text":"Pozorování"},{"language":"Spanish","symbol":"es","text":"Observación"},{"language":"German","symbol":"de","text":"Beobachtung"}] diff --git a/sphinx_proof/translations/jsons/Property.json b/sphinx_proof/translations/jsons/Property.json index 2543e61..19e0c18 100644 --- a/sphinx_proof/translations/jsons/Property.json +++ b/sphinx_proof/translations/jsons/Property.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Property"},{"language":"French","symbol":"fr","text":"Propriété"},{"language":"Italian","symbol":"it","text":"Proprietà"},{"language":"Czech","symbol":"cs","text":"Vlastnost"}] +[{"language":"English","symbol":"en","text":"Property"},{"language":"French","symbol":"fr","text":"Propriété"},{"language":"Italian","symbol":"it","text":"Proprietà"},{"language":"Czech","symbol":"cs","text":"Vlastnost"},{"language":"Spanish","symbol":"es","text":"Propiedad"},{"language":"German","symbol":"de","text":"Eigenschaft"}] diff --git a/sphinx_proof/translations/jsons/Proposition.json b/sphinx_proof/translations/jsons/Proposition.json index 153e152..2c173af 100644 --- a/sphinx_proof/translations/jsons/Proposition.json +++ b/sphinx_proof/translations/jsons/Proposition.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Proposition"},{"language":"French","symbol":"fr","text":"Proposition"},{"language":"Italian","symbol":"it","text":"Proposizione"}] +[{"language":"English","symbol":"en","text":"Proposition"},{"language":"French","symbol":"fr","text":"Proposition"},{"language":"Italian","symbol":"it","text":"Proposizione"},{"language":"Spanish","symbol":"es","text":"Proposición"},{"language":"German","symbol":"de","text":"Proposition"}] diff --git a/sphinx_proof/translations/jsons/Remark.json b/sphinx_proof/translations/jsons/Remark.json index fc89083..78fa734 100644 --- a/sphinx_proof/translations/jsons/Remark.json +++ b/sphinx_proof/translations/jsons/Remark.json @@ -1,2 +1 @@ -[{"language":"English","symbol":"en","text":"Remark"},{"language":"Arabic","symbol":"ar","text":"ملاحظة"},{"language":"Dutch","symbol":"nl","text":"Opmerking"},{"language":"French","symbol":"fr","text":"Remarque"},{"language":"German","symbol":"de","text":"Anmerkung"},{"language":"Italian","symbol":"it","text":"osservazione"},{"language":"Japanese","symbol":"ja","text":"述べる"},{"language":"Russian","symbol":"ru","text":"Замечание"},{"language":"Spanish","symbol":"es","text":"Observación"}, -{"language":"Czech","symbol":"cs","text":"Poznámka"}] +[{"language":"English","symbol":"en","text":"Remark"},{"language":"Arabic","symbol":"ar","text":"ملاحظة"},{"language":"Dutch","symbol":"nl","text":"Opmerking"},{"language":"French","symbol":"fr","text":"Remarque"},{"language":"German","symbol":"de","text":"Bemerkung"},{"language":"Italian","symbol":"it","text":"osservazione"},{"language":"Japanese","symbol":"ja","text":"述べる"},{"language":"Russian","symbol":"ru","text":"Замечание"},{"language":"Spanish","symbol":"es","text":"Nota"},{"language":"Czech","symbol":"cs","text":"Poznámka"}] diff --git a/sphinx_proof/translations/jsons/Theorem.json b/sphinx_proof/translations/jsons/Theorem.json index 1e7e49c..253b076 100644 --- a/sphinx_proof/translations/jsons/Theorem.json +++ b/sphinx_proof/translations/jsons/Theorem.json @@ -1 +1 @@ -[{"language":"English","symbol":"en","text":"Theorem"},{"language":"Arabic","symbol":"ar","text":"نظرية"},{"language":"Dutch","symbol":"nl","text":"Stelling"},{"language":"French","symbol":"fr","text":"Théorème"},{"language":"German","symbol":"de","text":"Satz"},{"language":"Italian","symbol":"it","text":"Teorema"},{"language":"Japanese","symbol":"ja","text":"定理"},{"language":"Russian","symbol":"ru","text":"Теорема"},{"language":"Spanish","symbol":"es","text":"Věta"}] +[{"language":"English","symbol":"en","text":"Theorem"},{"language":"Arabic","symbol":"ar","text":"نظرية"},{"language":"Dutch","symbol":"nl","text":"Stelling"},{"language":"French","symbol":"fr","text":"Théorème"},{"language":"German","symbol":"de","text":"Satz"},{"language":"Italian","symbol":"it","text":"Teorema"},{"language":"Japanese","symbol":"ja","text":"定理"},{"language":"Russian","symbol":"ru","text":"Теорема"},{"language":"Spanish","symbol":"es","text":"Teorema"}] diff --git a/sphinx_proof/translations/locales/de/LC_MESSAGES/proof.mo b/sphinx_proof/translations/locales/de/LC_MESSAGES/proof.mo index b81403d..c5c20a4 100644 Binary files a/sphinx_proof/translations/locales/de/LC_MESSAGES/proof.mo and b/sphinx_proof/translations/locales/de/LC_MESSAGES/proof.mo differ diff --git a/sphinx_proof/translations/locales/es/LC_MESSAGES/proof.mo b/sphinx_proof/translations/locales/es/LC_MESSAGES/proof.mo index e6c7505..9afc0a8 100644 Binary files a/sphinx_proof/translations/locales/es/LC_MESSAGES/proof.mo and b/sphinx_proof/translations/locales/es/LC_MESSAGES/proof.mo differ