First update towards cpl2
This commit is contained in:
@@ -1,33 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-translation CPL Translation
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL translation extension
|
||||
|
||||
:copyright: (c) 2022 - 2023 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_translation"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2022 - 2023 sh-edraft.de"
|
||||
__version__ = "2023.4.0.post1"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
from .translate_pipe import TranslatePipe
|
||||
from .translation_service import TranslationService
|
||||
from .translation_service_abc import TranslationServiceABC
|
||||
from .translation_settings import TranslationSettings
|
||||
|
||||
# build-ignore
|
||||
|
||||
|
||||
def add_translation(self):
|
||||
from cpl_core.console import Console
|
||||
@@ -50,7 +25,3 @@ def init():
|
||||
|
||||
|
||||
init()
|
||||
# build-ignore-end
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2023", minor="4", micro="0.post1")
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
{
|
||||
"ProjectSettings": {
|
||||
"Name": "cpl-translation",
|
||||
"Version": {
|
||||
"Major": "2024",
|
||||
"Minor": "7",
|
||||
"Micro": "0"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
"Description": "CPL Translation",
|
||||
"LongDescription": "CPL translation extension",
|
||||
"URL": "https://www.sh-edraft.de",
|
||||
"CopyrightDate": "2022 - 2023",
|
||||
"CopyrightName": "sh-edraft.de",
|
||||
"LicenseName": "MIT",
|
||||
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||
"Dependencies": [
|
||||
"cpl-core>=2024.6.2024.07.0"
|
||||
],
|
||||
"DevDependencies": [
|
||||
"cpl-cli>=2024.6.2024.07.0"
|
||||
],
|
||||
"PythonVersion": ">=3.10",
|
||||
"PythonPath": {},
|
||||
"Classifiers": []
|
||||
},
|
||||
"BuildSettings": {
|
||||
"ProjectType": "library",
|
||||
"SourcePath": "",
|
||||
"OutputPath": "../../dist",
|
||||
"Main": "",
|
||||
"EntryPoint": "",
|
||||
"IncludePackageData": false,
|
||||
"Included": [],
|
||||
"Excluded": [
|
||||
"*/__pycache__",
|
||||
"*/logs",
|
||||
"*/tests"
|
||||
],
|
||||
"PackageData": {
|
||||
"cpl_translation": [
|
||||
".cpl/*.py"
|
||||
]
|
||||
},
|
||||
"ProjectReferences": []
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,6 @@ class TranslatePipe(PipeABC):
|
||||
def transform(self, value: any, *args):
|
||||
try:
|
||||
return self._translation.translate(value)
|
||||
except KeyError as e:
|
||||
except KeyError:
|
||||
Console.error(f"Translation {value} not found")
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user