Skip to content

how to properly provide rules for translationsΒ #67

@davidstevenrojas

Description

@davidstevenrojas

Hello!

I am trying to use this tool to help me translate some guides in batch, I have some instructions that I wanted the translator to follow, so I created a pyproject.toml file with rules like:

[tool.gpt-po-translator]
default_context = """

Rules:

Preserve all formatting exactly: \n, spacing, punctuation, quotes, variables {}, code blocks, AsciiDoc syntax, placeholders, href, xref attributes, and any HTML entity as in the original document.

 Do NOT translate parameter names, variable names, annotations, method names, or code-related identifiers (for example: query parameters, field names, function names).

Links rule:
   - If the source has link:https://...[], keep it identical.
   - If the source has a bare URL or text without link:, write the translation using correct AsciiDoc format: link:URL[TEXT].

Maintain URLs and link structures exactly.

"""

However, after translating I am finding the HTML entities are transformed and also the xref attributes are removed and replaced with other characters, here one example:

Image

I am using a command like this to perform the translation, using my Anthropic key:

gpt-po-translator --folder /home/davidstevenrojas/gpt-po-translator --fix-fuzzy --no-ai-comment -v --bulk --bulksize 50

Is the default context a proper place for these rules?
Is there a way to control this output in the translation?
It would be great to know if I am off base with attempting to enforce such rules, they have worked great when applying them manually on small pieces of content from po files in an agentic terminal, I wanted to achieve a similar behavior in batch using gpt-po.

Thanks for any insight you can provide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions