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 replacements of placeholders for non-existing keys #40

Merged
merged 3 commits into from
Apr 19, 2018

Conversation

evrenesat
Copy link

@evrenesat evrenesat commented Apr 18, 2018

Removed an "else" statement to allow replacement of placeholders even when the key not found in the message object. We do not want to prepare messages object for base language, so I need to make placeholder replacement also work for missing keys.

@maranomynet
Copy link
Collaborator

maranomynet commented Apr 18, 2018

Interesting, this would allow for a use case that wasn't originally anticipated – i.e. treating the translation keys themselves as the main/default translation.

I see no harm in allowing this use case. I can't see any possibility of this breaking any reasonable existing code. @StephanHoyer what about you?

@evrenesat, before we merge, would you mind updating the commit to place the if condition on a new line?

@maranomynet
Copy link
Collaborator

...and this has zero impact on performance.

@evrenesat
Copy link
Author

@maranomynet fixed the formatting.

@maranomynet maranomynet merged commit 11a34b5 into StephanHoyer:master Apr 19, 2018
@maranomynet
Copy link
Collaborator

Published as v0.7.1
Thanks @evrenesat

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