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

Automatically tag backend strings. #8575

Open
1 of 4 tasks
roberthoenig opened this issue Mar 4, 2018 · 0 comments
Open
1 of 4 tasks

Automatically tag backend strings. #8575

roberthoenig opened this issue Mar 4, 2018 · 0 comments

Comments

@roberthoenig
Copy link
Contributor

Issue

Different types of strings are of different importance to be translated. In particular, error-strings (those returned by json_error and JsonableError) are less important than non-error strings. Currently, a translator in Transifex cannot easily differentiate between error and non-error strings, and therefore translates strings regardless of their importance.

Solution

Transifex can tag strings and sort by tags. This allows us to e.g. tag error-strings with "error" and non-error strings with "non-error". Translators could then sort by these tags to prioritize important strings.

Implementation

The tagging of strings can and should be done automatically. A first effort to accomplish this was #6086. #6086 now contains many merge conflicts and will likely not be merged, but it can act as a helpful overview on what files need to be modified, and how they need to be modified. Some commits of #6086 got merged. It follows an overview of things already done, and things that still need to be done:

  • Add script for commnicating with the Transifex API to automatically tag strings. (tools/tagmessages)
  • Have tools/tagmessages not overwrite existing tags
  • There are more error than non-error strings in .py files, so we should by default mark _ translations as error, and implement a way to mark non-error strings in .py files (nonerr_? noterror_?)
  • ways to mark error strings in backend templates, frontend templates, and JS code.

How to get started

To work on this issue, you should create your own test transifex project and test any changes you make there. In particular,

  • create a new "organization" -- this was under one of the dropdown menus in the upper right of the Transifex app, at least on the dashboard page
  • Be sure to check the "this is an open-source project" checkbox, so they don't charge you or limit to a temporary free trial -- I used my fork of the Zulip repo as the repo URL
  • In that organization, have a project, and set its slug to zulip-test
  • I think the "create project" form had a similar "open-source" checkbox and "repo URL" field; same values work
  • Then a tx push just like the one in tools/push-translations, but with s/zulip/zulip-test/g, works for populating it.
    (Thanks @gnprice for these instructions.)

For more details on this, refer to the discussion on #6086 and/or discuss this on chat.zulip.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants