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

Allow spaces in locale key #604

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Hassan01-dev
Copy link

This update allows spaces in translation keys.

Previously, keys containing spaces (e.g., "Key with Spaces") were not considered valid and were removed from the results after scanning the file. With this change, translation keys with spaces are now recognized as valid.

Closes #359

@@ -20,7 +20,7 @@ def strip_literal(literal)
literal
end

VALID_KEY_CHARS = %r{(?:[[:word:]]|[-.?!:;À-ž/])}.freeze
VALID_KEY_CHARS = %r{(?:[[:word:]]|[-.?!:;À-ž/]|(?<=\w)\s(?=\w))}.freeze
Copy link
Owner

Choose a reason for hiding this comment

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

Should this perhaps match all Unicode letters in the context rather than just a-z?
https://rubular.com/r/dOnUgvJhli6Il2

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.

Find missing keys that contain spaces
2 participants