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

String descriptions and other metadata #135

Closed
wereHamster opened this issue Jan 17, 2020 · 6 comments
Closed

String descriptions and other metadata #135

wereHamster opened this issue Jan 17, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@wereHamster
Copy link

Sometimes it's not clear from the string and its ID in what context it is used, especially if the strings are short and seem generic. Some file formats support comments in more or less structured fashion. We are using react-intl in our projects and it supports optional description for each string. We also sometimes include the path to the file where the string is used in the metadata (gives the translator additional context when filenames are somewhat meaningful). Do you have plans to allow some kind of description or metadata that would be displayed next to the string in the Accent UI?

@lukasluecke
Copy link

Adding to this, I've uploaded a gettext / PO file with comments / metadata, and upon export this metadata is missing. If it could at least be preserved, until there is a nice way to show it in the UI, that would be great.

@alexanderadam
Copy link

alexanderadam commented Mar 24, 2020

Indeed, maybe even a screenshot/URL where this translation is used would be nice.
It seems that weblate is also doing this.

@simonprev simonprev added the enhancement New feature or request label Apr 8, 2020
@tvb
Copy link

tvb commented Oct 7, 2020

@simonprev I would really like to see the Source string location which is available as metadata in the .po files

@simonprev
Copy link
Member

Gettext comments have been added recently in the UI and are preserved in the export.

## From Ecto.Changeset.cast/4
msgid "can't be blank"
msgstr "ne peut être vide"

image

If there are other formats that we can extract comments and metadata, a new issue can be opened so we track progress 😃
And screenshots are a long time feature that we needs more thinking since Accent does not have a "storage" requirement yet, so no S3 or persisted filesystem to keep images.

@alexanderadam
Copy link

And screenshots are a long time feature that we needs more thinking since Accent does not have a "storage" requirement yet, so no S3 or persisted filesystem to keep images.

Should I open a dedicated issue then where the thinking and discussing can be done?

@wereHamster
Copy link
Author

I'm using react-intl / formatjs. By default it extract into a slightly extended JSON format like so:

{
  "this-is-the-message-id": {
    "defaultMessage": "foo",
    "description": "helpful information for translators"
  }
}

The format can be adjusted as needed, or even fully customized. I'm thinking of also outputting the path to the source file + lines where the string is, or even a link to GitHub, to make it easier to access the context.

Sadly Accent doesn't support this kind of JSON format yet. Would Accent be open to supporting such a flat format where values are not simple strings (as in simple_json) but objects that contain the message and associated metadata?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants