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

Improve robustness of _t() key checks #16

Open
2 tasks
GuySartorelli opened this issue Feb 12, 2025 · 0 comments
Open
2 tasks

Improve robustness of _t() key checks #16

GuySartorelli opened this issue Feb 12, 2025 · 0 comments

Comments

@GuySartorelli
Copy link
Member

silverstripe/silverstripe-framework#11603 was raised in part because there was a scenario where weird variable nonsense turned a key that would ordinarily be ignored (because it's dynamic) into a key that has a period at the end.

That case is being ignored now - but it means if we have a period at the end of a _t() key it'll be ignored, instead of telling us to fix it.

TranslationFunctionRule is intended to catch invalid keys, but it wouldn't catch a scenario where both:

  • The dev forgets to add the first period
  • The dev accidentally adds a period at the end of the key

It's an edge case, but we should avoid it.

Acceptance Criteria

  • Keys cannot start with a period
  • Keys cannot end with a period
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant