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

translations findById #281

Open
ouhman opened this issue Feb 22, 2022 · 2 comments
Open

translations findById #281

ouhman opened this issue Feb 22, 2022 · 2 comments

Comments

@ouhman
Copy link

ouhman commented Feb 22, 2022

Hello,

First of all thanks for the work on this library, highly appreciated :)

Second, I would like to be able to find translations by their ids. Currently it is only possible to search by translations.
https://github.com/php-gettext/Gettext/blob/master/src/Translations.php#L169

May I propose a PR to implement the changes? It should be fairly easy to implement.

Cheers,

@oscarotero
Copy link
Member

Hi. In most cases the id is generated with the context + original text (See here: https://github.com/php-gettext/Gettext/blob/master/src/Translation.php#L34)
But it's possible to use different ids so your proposal is fine. Feel free to create a PR. Thanks!

@ouhman
Copy link
Author

ouhman commented Feb 22, 2022

Thank you for your answer. We don't use context and the id holds the original source language in our case.

I will be submitting a PR in the next days.

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

No branches or pull requests

2 participants