Skip to content
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

feat: allow specifying a translation style guide #61

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Feb 24, 2025

Note: Work in progress, need some backend changes.

Adds the ability for users to specify a style guide. I'll let the readme do the talking:

In some cases you might want/need the translator to follow a certain style guide - for instance you might tell it not to translate certain words, or be more formal or casual. To configure this you can pass a styleguide property under the translation configuration:

assist({
  translate: {
    styleguide: `Be extremely formal and precise. Translate as if you are Spock from Star Trek.`,
  },
})

The style guide is currently limited to 2000 characters, and the translation might get slower the longer your style guide is. If the provided string is longer than the limit, the plugin will throw upon studio startup.

Note that this is currently only available on a global level - it can not be defined per-field for now.

@rexxars rexxars requested a review from snorrees February 24, 2025 23:17
Copy link
Contributor

@snorrees snorrees left a comment

Choose a reason for hiding this comment

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

Nice! Will test this tomorrow 👍

(Some minor nits, nothing blocking)

@snorrees snorrees self-requested a review February 25, 2025 00:00
Copy link
Contributor

@snorrees snorrees left a comment

Choose a reason for hiding this comment

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

Added a "dont touch headless" to the test studio. Looking good!

image

@snorrees snorrees merged commit dd91d61 into main Feb 25, 2025
8 checks passed
@snorrees snorrees deleted the feat/translation-style-guide branch February 25, 2025 10:49
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