-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Expose XLIFF unit IDs in Translation objects #220
Comments
I'd be happy to suggest a PR for this but I'm not sure what the |
Hi, @asmecher This library is heavy inspired in gettext model, so the uniqueness of each translation is defined by the context + original text (here: https://github.com/oscarotero/Gettext/blob/master/src/Translation.php#L79). What is this id for? Is it used to get the translation from the translator (example: |
In our software we embed a synthetic key in the source code (e.g. So rather than changing everything so that English is embedded in the source & we map from there to e.g. Spanish, I'm hoping we can use the unit ID attribute in XLIFF to represent the synthetic key. |
This is a fairly boneless way to add unit ID support for both reading and writing, without otherwise changing the library. It's probably not the best way -- I only submit it for discussion. I'm hesitant to work with the |
#221 was merged so I suppose this issue can be closed, thanks! Unfortunately there's a knock-on issue but I've just filed it separately (see link above). |
XLIFF supports unit IDs:
However, the XLIFF parser doesn't capture/store these IDs in the
Translator
object.Is it possible to add support for representing unit IDs in the
Translator
class?The text was updated successfully, but these errors were encountered: