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

context storage #65

Open
bryghtlabs-richard opened this issue Aug 26, 2024 · 2 comments
Open

context storage #65

bryghtlabs-richard opened this issue Aug 26, 2024 · 2 comments

Comments

@bryghtlabs-richard
Copy link
Contributor

It's often useful to be able to give a translator a short description of the context needed for a particular translation. Especially when translating from English, which has a lot of different meanings with the same spelling. It would be useful for us if lv_i18n could store context descriptions alongside in the yml file somehow. Ex:

de:
   Close: schließe #An action, close a window or close the door
de:
   Close: in der Nähe #adverb, nearby, not far away

Currently lv_i18n extract discards comments though, I saw Puzrin mentioned js-yaml doesn't have an AST, so there's not a good way to update just the values and keep the comments and formatting. I wanted to mention the idea of storing context since it has always been useful to supply to translators for a number of projects, perhaps others also would use it.

@puzrin
Copy link
Collaborator

puzrin commented Aug 26, 2024

If you need advanced metadata management, it's probably better to select more advanced projects for translation. This one was done to be compact for "small projects," and having no metadata support is a trade-off.

Also, you can partially dim the problem by embedding context into variables:

  • "schedule_close__door_or_window".
  • "Close## An action, close a window or close the door" - cut str after ## in translation at post-processor.

That will also require a translation file for English, but the content will be descriptive.

@bubeck
Copy link
Contributor

bubeck commented Oct 8, 2024

I issued this PR #52 as another solution to this problem. It gives translators a hint, where the source string comes from. This could help him understanding the context.

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

3 participants