semvec/pypi-packages huggingface dataset:
pyfancytranslator 1.1.1
A well built translator with placeholders
Requires Python: >=3.12

# Fancy Translator
![Downloads](https://pepy.tech/badge/pyfancytranslator)
![Downloads](https://pepy.tech/badge/pyfancytranslator/week)
![Downloads](https://pepy.tech/badge/pyfancytranslator/month)  
This library allow you to run setup a translator with ease. Just provide it the translations files and access them when ever you need them

### Having an issue?
You can always find someone on our discord server here:
> https://discord.gg/m8ajAQUput

### Wiki
The official wiki of this library will be available at GitHub
> https://github.com/AGM-Studio/FancyTranslator/wiki

## How to install
To install just use following command
```shell
pip install PyFancyTranslator
```
This library will have dev/beta builds on the GitHub, to install them you can use

```shell
pip install --upgrade git+https://github.com/AGM-Studio/FancyTranslator.git
```
# Example

```python
from FancyTranslator import Translator

# All language files must be in .ini format and be placed in a folder to be accessed
translator = Translator("./translations/")

# To access a language with name "en.ini" just call the method below
language = translator.get('en')

# To get a translation for "MyKey" in section "MySection"
translation = language.translate("MySection", "MyKey")

# To use placeholder:
class MyClass:
    def __init__(self, obj):
        self.obj = obj

my_class = MyClass({"name": "Nested"})

# In file: "This is an example with a normal placeholder: %%value%%"
trans1 = translator.get('en').translate("Target", "trans1", value="My Value")
# returns "This is an example with a normal placeholder: My Value"

# In file: "This is an example with a nested placeholder: %%nested.obj.name%%"
trans2 = translator.get('en').translate("Target", "trans2", nested=my_class)
# returns "This is an example with a nested placeholder: Nested"
```

[![Mine Crypto for FREE](https://static.rollercoin.com/static/img/ref/gen2/w970h90.gif)](https://rollercoin.com/?r=jo4ens5n)
iris-udl-to-xml 0.1
Converts IRIS UDL input to XML export format.
Requires Python: >=3.12

# IRIS XML to UDL

![Tests](https://github.com/gertjanklein/iris-udl-to-xml/actions/workflows/test-matrix.yml/badge.svg)

An attempt at converting InterSystems IRIS source code in UDL format to
the XML export format. The UDL format is easier to read and is what is
shown and edited in Studio and VS Code. The XML export format, however,
can combine multiple source items in a single export. This can make
deployment considerably easier.

The code here is in early stages, but does already create equivalent (or
even equal, see [below](#equivalent-or-equal)) XML compared to IRIS for
many tested source items. Intended purpose is for use in automated build
processes, possibly involving
[iris-export-builder](https://github.com/gertjanklein/iris-export-builder).
The goal is to make using an IRIS Docker image solely for the conversion
unnecessary.

In addition, the only _safe_ way I know to convert UDL to XML in IRIS is
to use an API (`/api/atelier/v1/namespace/cvt/doc/xml`) that is
deprecated by InterSystems, and appears to be broken in version 2024.1.

Parsing UDL is mainly difficult because it can embed XML, HTML, CSS,
JavaScript, ObjectScript, Python, and more, some of which can internally
switch language again. An additional complication is that the VS Code
ObjectScript plugin appears to allow saving improperly formatted code.

## Equivalent or equal

The IRIS XML export format is very loosely defined. Method keywords, for
example, are placed in elements in the export, but may be present in any
order. If an XML file with such elements is loaded into IRIS, the source
will be exactly the same as if they had been in a different order.

Additionally, the export may escape embedded XML in different ways,
e.g., place everything in a CDATA block, or just escape each XML special
character individually.

An export that may differ from what IRIS would have produced, but
results in exactly the same source in IRIS, is referred to as
_equivalent_.

This is enough for most purposes. However, if comparing a combined
export (created by e.g. iris-export-builder mentioned above) with a
different version, it would be nice if elements appear in the same
order, and escaping is done in the same way. This way, only the actual
differences will show up in the comparison. XML output that is exactly
equal to what IRIS would produce is referred to as _equal_.

An effort has been made to achieve _equal_ exports, but for some XData
blocks, this is currently not possible. In this case, _equivalent_ will
have to do.