#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 1998-2026 Stephane Galland # # This program is free library; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING. If not, # write to the Free Software Foundation, Inc., 59 Temple Place - Suite # 330, Boston, MA 02111-1307, USA. """ Translation engine. """ import re import os from typing import Any from autolatex2.config .configobj import Config from autolatex2.config .translator import TranslatorLevel from autolatex2.translator.readers.abstractreader import AbstractTransdefReader from autolatex2.translator.readers.perlreader import PerlTransdefReader from autolatex2.translator.readers.transdefline import TransdefLine from autolatex2.translator.readers.yamlreader import YamlTransdefReader from autolatex2.utils.i18n import T class Translator: """ Description of a translator. """ def __init__(self, name : str, configuration : Config): """ Parse a complete translator name to extract the components. :param name: The name must have the syntax: