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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clarification on translation of HTML content #120

Conversation

gonzalo-bulnes
Copy link
Contributor

@gonzalo-bulnes gonzalo-bulnes commented Jan 3, 2021

Status

Ready for review

Description of Changes

Clarifies that both alt and title HTML attributes must be translated, and no other attribute should. Add example to demonstrate correct translations for both the alt and title tags in plausible contexts.

Also add a list of currently used HTML attributes which values should not be translated for explicitness. I tried to make clear that the list is not meant to be exhaustive, but listed all attributes currently in use in the SecureDrop Core translations.

Testing

  • Please proof-read, I'm not an native English speaker 馃檪 and don't hesitate to amend or ask me to correct where needed!

Release

I don't think any special considerations are needed before releasing this change.

Checklist (Optional)

  • Doc linting (make docs-lint) passed locally
  • Doc link linting (make docs-linkcheck) passed
  • You have previewed (make docs) docs at http://localhost:8000

@gonzalo-bulnes
Copy link
Contributor Author

Question: Are the SecureDrop Client strings in the same .pot as the strings from SecureDrop Core?

@eloquence eloquence force-pushed the add-translation-clarifications-on-html-content branch from cabe0a0 to 9d1aca3 Compare January 8, 2021 00:22
@eloquence
Copy link
Member

(Rebased.)

@eloquence
Copy link
Member

Question: Are the SecureDrop Client strings in the same .pot as the strings from SecureDrop Core?

The SecureDrop Client is not yet translatable. :( This is tracked in freedomofpress/securedrop-client#239

@eloquence eloquence self-assigned this Jan 8, 2021
Attribute ``alt``
"""""""""""""""""

Image elements (``<img>``) in HTML place a picture on the
page. People with visual impairments rely on a special note on the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would write "Because people with visual impairments rely ..., it is necessary ...".

Right now you say "People with visual impairments rely ..., it is necessary ..." which sounds a bit odd in English because the two clauses of the sentence are not connected.


In particular, please make sure the attributes ``class``, ``id``,
``height``, ``href``, ``rel``, ``src`` and ``width``
are never translated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I defer to @rmol here, but it might be worth qualifying this a little bit for href -- there may be situations where linking to a different URL in the target language would be appropriate. Perhaps simply asking translators to comment in Weblate when in doubt is the way to go here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good point. That will also be highly dependent on the URL.

Thinking aloud: in a case like this, could the localized URLs be given to the translators via string context?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't had coffee yet, but I'm thinking if a URL were to vary like that, it would probably be done via a {url} placeholder, so the translators wouldn't have to worry about it. I'd keep href in the list of things not to touch.

HTML elements (embraced by in ``<``, ``>``, example: ``<strong>``)
can contain multiple so-called *attributes*.

The text of the two attributes called ``alt`` and ``title``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general note, I would suggest changing phrases like "the text of the attribute X" to "the text content of the attribute X", to make it even clearer that we are not talking about the attribute name itself.

Copy link
Member

@eloquence eloquence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional explanatory text is really great, thanks @gonzalo-bulnes. Some nits in the review, and would appreciate a quick visual review from @rmol or @kushaldas on this one.

@eloquence eloquence added this to In Development in SecureDrop Team Board Jan 8, 2021
@gonzalo-bulnes
Copy link
Contributor Author

Thanks for the review @eloquence! I'll address the comments tonight or tomorrow.

@gonzalo-bulnes gonzalo-bulnes force-pushed the add-translation-clarifications-on-html-content branch from 9d1aca3 to 9fd07fc Compare January 8, 2021 13:31
@gonzalo-bulnes
Copy link
Contributor Author

Applied the suggestions and rebased. Waiting for potential href additions 馃檪

@eloquence eloquence moved this from In Development to Under Review in SecureDrop Team Board Jan 11, 2021
Add examples to demonstrate correct translations for
both the 'alt' and 'title' tags in plausible contexts.

Add list of currently used HTML attributes which values
shall not be translated.
@eloquence eloquence force-pushed the add-translation-clarifications-on-html-content branch from 9fd07fc to c43120a Compare January 11, 2021 18:18
@eloquence
Copy link
Member

(Rebased.)

Copy link
Member

@eloquence eloquence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gonzalo-bulnes, per @rmol's comment re: href translation I am merging as-is; we can add further clarification if needed.

@eloquence eloquence merged commit 3c58908 into freedomofpress:main Jan 11, 2021
SecureDrop Team Board automation moved this from Under Review to Done Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Translator documentation needs clarification around HTML content
3 participants