Skip to content

Conversation

@chdoc
Copy link
Contributor

@chdoc chdoc commented Jan 4, 2026

The motivation for this change is my current work on German mode, which implements these new actions as follows:

# characters to replace if ASCII punctuation is desired
_ascii_replace = {'–': '-', '„': '"', '“': '"', "‚": "'", "‘": "'", "’": "'"}
_ascii_trans = str.maketrans(_ascii_replace)

@ctx.action_class("user")
class Actions:
    def omit_space_before(text: str) -> bool:
        return bool(not text or text[0] in _no_space_before)

    def omit_space_after(text: str) -> bool:
        return bool(not text or text[-1] in _no_space_after)
    
    def dictation_replace(text: str) -> str:
        if settings.get("user.german_unicode"):
            return text
        return text.translate(_ascii_trans)

Note that the rules regarding spacing around quotes are very different between English and German. In particular, the English opening quote is the German closing quote.

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.

1 participant