Skip to content

FEATURE: Support for glossaries #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 2, 2025
Merged

FEATURE: Support for glossaries #63

merged 8 commits into from
Jul 2, 2025

Conversation

mficzel
Copy link
Member

@mficzel mficzel commented Jun 27, 2025

Glossaries are created and uploaded to DeepL via the Lost in Translation Backend Module. When node-translations are created the matching glossary for the language combination at hand is chosen automatically.

Glossary names are internally prefixed with a configurable identifier that ensures that different Neos instances that share a DeepL account will not interfere by cleaning up each others glossaries.

By default the prefix is the FLOW_CONTEXT as this is already configured in all Neos Instances and is often used to seperate multiple environments.

⚠️ If you use multiple environments with the same FLOW_CONTEXT and DeepL Account you should ensure that the glossaryLabelPrefix is configured differently for each environment.

Sitegeist:
  LostInTranslation:
    DeepLApi:
      #
      # Glossary management
      #
      glossary:
        #
        # The label prefix can be used to prevent different instances overwriting or deleting each others
        # glossaries. The default value is the FLOW_CONTEXT but this may need adjustment based on your use case
        #
        labelPrefix: '%env:FLOW_CONTEXT%'
        #
        # The number of outdated remote glossaries to keep to reduce problems when systems are cloned
        #
        keepNumber: 10

The commands ./flow glossary:uploadall and ./flow glossary:cleanupall allow to automate those tasks and may be integrated in backup and restore or synchronization scripts.

resolves: #5

Glossaries are created and uploaded to DeepL via the Lost in Translation Backend Module.
When node-translations are created the matching glossary for the language combination at hand
is chosen automatically.

Glossary names are internally prefixed with a configurable identifier that ensures that different Neos instances
that share a DeepL account will not interfere by cleaning up each others glossaries.

By default the prefix is the `FLOW_CONTEXT` as this is already configured in all Neos Instances and is often used to
seperate multiple environments.

**:warning: If you use multiple environments with the same FLOW_CONTEXT and DeepL Account you should ensure that the
glossaryLabelPrefix is configured differently for each environment.**

```yaml
Sitegeist:
  LostInTranslation:
    DeepLApi:
      #
      # The label prefix can be used to prevent different instances overwriting or deleting each others
      # glossaries. The default value is the FLOW_CONTEXT but this may need adjustment based on your use case
      #
      glossaryLabelPrefix: '%env:FLOW_CONTEXT%'
```

The commands `./flow glossary:uploadall` and `./flow glossary:cleanupall` allow to automate those tasks and may
be integrated in backup and restore or synchronization scripts.
@mficzel mficzel force-pushed the feature/glossarySupport branch from 4863b25 to 5e2ae39 Compare June 30, 2025 14:54
@mficzel mficzel force-pushed the feature/glossarySupport branch from 80a0079 to 3a76337 Compare July 2, 2025 12:59
@mficzel mficzel merged commit 38c541e into 2.0 Jul 2, 2025
3 checks passed
@mficzel mficzel mentioned this pull request Jul 2, 2025
/**
* @phpstan-var Collection<int, GlossaryEntry>
* @var Collection<GlossaryEntry>
* @ORM\OneToMany(targetEntity="Sitegeist\LostInTranslation\Domain\Model\GlossaryEntry", mappedBy="glossary", cascade={"persist"})
Copy link
Collaborator

@gradinarufelix gradinarufelix Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are missing cascade={"all"} here. This is why, after updating a glossary entry, it would still show the old content.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm ... i would expect cascade=persist to have this effect. Is that wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants