2020-08-11 01:47:54 +02:00
|
|
|
# Translation guidelines
|
2016-04-29 06:55:09 +02:00
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
Zulip's has full support for Unicode (and partial support for RTL
|
|
|
|
languages), so you can use your preferred language everywhere in
|
2021-05-10 04:02:09 +02:00
|
|
|
Zulip.
|
|
|
|
|
|
|
|
Additionally, the Zulip UI is translated into more than a dozen major
|
2019-05-27 23:24:26 +02:00
|
|
|
languages, including Spanish, German, Hindi, French, Chinese, Russian,
|
2021-08-20 21:53:28 +02:00
|
|
|
and Japanese, and we're always excited to add more. If you speak a
|
2022-02-08 00:13:33 +01:00
|
|
|
language other than English, your help with translating Zulip would be
|
2019-05-27 23:24:26 +02:00
|
|
|
greatly appreciated!
|
|
|
|
|
2019-06-05 02:12:56 +02:00
|
|
|
If you are interested in knowing about the technical end-to-end
|
|
|
|
tooling and processes for tagging strings for translation and syncing
|
|
|
|
translations in Zulip, read about [Internationalization for
|
2022-02-24 00:17:21 +01:00
|
|
|
Developers](internationalization.md).
|
2019-06-05 02:12:56 +02:00
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
## Translators' workflow
|
|
|
|
|
|
|
|
These are the steps you should follow if you want to help translate
|
|
|
|
Zulip:
|
|
|
|
|
2021-05-10 04:02:09 +02:00
|
|
|
1. Join [#translation][translation-stream] in the [Zulip development
|
2021-12-09 20:15:18 +01:00
|
|
|
community server](https://zulip.com/development-community/), and say hello.
|
2021-08-20 22:54:08 +02:00
|
|
|
That stream is also the right place for any questions, updates on your
|
|
|
|
progress, reporting problematic strings, etc.
|
2021-05-10 04:02:09 +02:00
|
|
|
|
2021-04-01 20:18:25 +02:00
|
|
|
1. Sign up for [Transifex](https://www.transifex.com) and ask to join the [Zulip
|
2021-08-20 22:54:08 +02:00
|
|
|
project on Transifex](https://www.transifex.com/zulip/zulip/), requesting access
|
|
|
|
to any languages that you'd like to contribute to (or add new ones).
|
2019-05-27 23:24:26 +02:00
|
|
|
|
2021-08-10 07:55:12 +02:00
|
|
|
:::{note}
|
|
|
|
Unless you plan to contribute country-specific translations, do not
|
|
|
|
select a country-specific language in the **Languages** menu when you sign
|
|
|
|
up. E.g. use **English (United Kingdom)** if you plan to translate Zulip
|
|
|
|
into UK English, but select **Russian** rather than **Russian (Russia)** for
|
|
|
|
general Russian translations.
|
|
|
|
:::
|
2021-04-01 20:18:25 +02:00
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
1. Wait for a maintainer to approve your Transifex access; this
|
|
|
|
usually takes less than a day. You should then be able to access
|
|
|
|
Zulip's dashboard in Transifex.
|
|
|
|
|
2021-08-20 21:53:28 +02:00
|
|
|
1. Translate the strings for your language in Transifex. Zulip has
|
2021-05-05 01:39:27 +02:00
|
|
|
several resource files:
|
2021-08-20 22:54:08 +02:00
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- `mobile.json` is for the iOS/Android mobile apps.
|
|
|
|
- `desktop.json` is for the parts of the Zulip desktop apps that
|
2021-05-14 00:16:30 +02:00
|
|
|
are not shared with the Zulip web app.
|
2021-08-20 21:45:39 +02:00
|
|
|
- `django.po` and `translations.json` have strings for the next
|
2021-05-14 00:16:30 +02:00
|
|
|
major release of the Zulip server and web app (which is what we
|
2021-05-05 01:39:27 +02:00
|
|
|
run on chat.zulip.org and Zulip Cloud).
|
2021-08-20 21:45:39 +02:00
|
|
|
- The variants of `django.po` and `translations.json` with names
|
2021-05-05 01:39:27 +02:00
|
|
|
starting with a version, like, `4-x--`, are strings for Zulip's
|
|
|
|
current [stable release series](../overview/release-lifecycle.md).
|
|
|
|
|
|
|
|
Transifex is smart about only asking you to translate a string once
|
2021-08-20 21:53:28 +02:00
|
|
|
even if it appears in multiple resources. The `4-x--` type variants
|
2021-05-05 01:39:27 +02:00
|
|
|
allow translators to get a language to 100% translated for the
|
|
|
|
current release.
|
2019-05-27 23:24:26 +02:00
|
|
|
|
|
|
|
1. If possible, test your translations (details below).
|
|
|
|
|
|
|
|
1. Ask in Zulip for a maintainer to sync the strings from Transifex,
|
2021-09-01 03:13:20 +02:00
|
|
|
merge them to `main`, and deploy the update to chat.zulip.org so
|
2019-05-27 23:24:26 +02:00
|
|
|
you can verify them in action there.
|
|
|
|
|
|
|
|
Some useful tips for your translating journey:
|
|
|
|
|
|
|
|
- Follow your language's [translation guide](#translation-style-guides).
|
2021-08-20 21:53:28 +02:00
|
|
|
Keeping it open in a tab while translating is very handy. If one
|
2019-05-27 23:24:26 +02:00
|
|
|
doesn't exist one, write one as you go; they're easiest to write as
|
|
|
|
you go along and will help any future translators a lot.
|
|
|
|
|
2021-04-16 04:14:36 +02:00
|
|
|
- Don't translate variables or code (usually preceded by a `%`, inside
|
|
|
|
HTML tags `<...>`, or enclosed in braces like `{variable}`); just
|
|
|
|
keep them verbatim.
|
2019-05-27 23:24:26 +02:00
|
|
|
|
2021-02-16 01:48:40 +01:00
|
|
|
- When context is unclear, you may find [GitHub
|
|
|
|
search](https://github.com/search?q=org%3Azulip+%22alert+word+already+exists%22&type=code)
|
|
|
|
helpful for finding the code using a given string (ignore `.po` and
|
|
|
|
`.json` matches, and note the search box is semi-invisible in the
|
2021-04-25 22:54:23 +02:00
|
|
|
upper-left corner of the page), or looking at the "Occurrences"
|
2021-02-16 01:48:40 +01:00
|
|
|
section in the Transifex UI, browsing to the file on
|
|
|
|
[GitHub](https://github.com/zulip/zulip/), and then searching for
|
|
|
|
the string with `Ctrl+F` in your browser.
|
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
- When in doubt, ask for context in
|
|
|
|
[#translation](https://chat.zulip.org/#narrow/stream/58-translation) in
|
2021-12-09 20:15:18 +01:00
|
|
|
the [Zulip development community server](https://zulip.com/development-community/).
|
2019-05-27 23:24:26 +02:00
|
|
|
|
|
|
|
- If there are multiple possible translations for a term, search for it in
|
2021-08-20 22:54:08 +02:00
|
|
|
the _Concordance_ tool (the button with a magnet in the top right corner).
|
2019-05-27 23:24:26 +02:00
|
|
|
|
|
|
|
It will show if anyone translated that term before, so we can achieve good
|
|
|
|
consistency with all the translations, no matter who makes them.
|
|
|
|
|
|
|
|
- Pay attention to capital letters and punctuation. Details make the
|
|
|
|
difference!
|
|
|
|
|
|
|
|
- Take advantage of the hotkeys the Transifex Web Editor provides, such as
|
|
|
|
`Tab` for saving and going to the next string.
|
|
|
|
|
2021-05-29 17:49:36 +02:00
|
|
|
- While one should definitely prioritize translating
|
|
|
|
`translations.json`, since the most prominent user-facing strings
|
|
|
|
are there, API error messages in `django.po` are presented to users,
|
|
|
|
so a full translation should include them.
|
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
### Testing translations
|
|
|
|
|
|
|
|
This section assumes you have a
|
2019-09-30 19:37:56 +02:00
|
|
|
[Zulip development environment](../development/overview.md) set up;
|
2019-05-27 23:24:26 +02:00
|
|
|
if setting one up is a problem for you, ask in chat.zulip.org and we
|
|
|
|
can usually just deploy the latest translations there.
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- First, download the updated resource files from Transifex using the
|
2021-08-20 22:54:08 +02:00
|
|
|
`tools/i18n/sync-translations` command (it will require some [initial
|
2022-02-16 01:39:15 +01:00
|
|
|
setup](internationalization.md#transifex-cli-setup)). This
|
2021-08-20 22:54:08 +02:00
|
|
|
command will download the resource files from Transifex and replace
|
|
|
|
your local resource files with them, and then compile them. You can
|
|
|
|
now test your translation work in the Zulip UI.
|
2019-05-27 23:24:26 +02:00
|
|
|
|
|
|
|
There are a few ways to see your translations in the Zulip UI:
|
|
|
|
|
2021-08-20 21:53:28 +02:00
|
|
|
- You can insert the language code as a URL prefix. For example, you
|
2019-05-27 23:24:26 +02:00
|
|
|
can view the login page in German using
|
2021-08-20 21:53:28 +02:00
|
|
|
`http://localhost:9991/de/login/`. This works for any part of the
|
2019-05-27 23:24:26 +02:00
|
|
|
Zulip UI, including portico (logged-out) pages.
|
2021-08-20 21:45:39 +02:00
|
|
|
- For Zulip's logged-in UI (i.e. the actual web app), you can [pick the
|
2020-06-08 23:04:39 +02:00
|
|
|
language](https://zulip.com/help/change-your-language) in the
|
2019-05-27 23:24:26 +02:00
|
|
|
Zulip UI.
|
2021-08-20 21:45:39 +02:00
|
|
|
- If your system has languages configured in your OS/browser, Zulip's
|
2019-05-27 23:24:26 +02:00
|
|
|
portico (logged-out) pages will automatically use your configured
|
2021-08-20 21:53:28 +02:00
|
|
|
language. Note that we only tag for translation strings in pages
|
2019-05-27 23:24:26 +02:00
|
|
|
that individual users need to use (e.g. `/login/`, `/register/`,
|
|
|
|
etc.), not marketing pages like `/features/`.
|
2021-08-20 21:45:39 +02:00
|
|
|
- In case you need to understand how the above interact, Zulip figures
|
2019-05-27 23:24:26 +02:00
|
|
|
out the language the user requests in a browser using the following
|
|
|
|
prioritization (mostly copied from the Django docs):
|
|
|
|
|
2020-10-23 02:43:28 +02:00
|
|
|
1. It looks for the language code as a URL prefix (e.g. `/de/login/`).
|
2020-12-23 13:45:24 +01:00
|
|
|
1. It looks for the cookie named 'django_language'. You can set a
|
2019-05-27 23:24:26 +02:00
|
|
|
different name through the `LANGUAGE_COOKIE_NAME` setting.
|
2020-12-23 13:45:24 +01:00
|
|
|
1. It looks for the `Accept-Language` HTTP header in the HTTP request
|
2019-05-27 23:24:26 +02:00
|
|
|
(this is how browsers tell Zulip about the OS/browser language).
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- Using an HTTP client library like `requests`, `cURL` or `urllib`,
|
2019-05-27 23:24:26 +02:00
|
|
|
you can pass the `Accept-Language` header; here is some sample code to
|
|
|
|
test `Accept-Language` header using Python and `requests`:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```python
|
2019-05-27 23:24:26 +02:00
|
|
|
import requests
|
|
|
|
headers = {"Accept-Language": "de"}
|
|
|
|
response = requests.get("http://localhost:9991/login/", headers=headers)
|
|
|
|
print(response.content)
|
|
|
|
```
|
|
|
|
|
2020-03-17 13:57:10 +01:00
|
|
|
This can occasionally be useful for debugging.
|
2019-05-27 23:24:26 +02:00
|
|
|
|
|
|
|
### Translation style guides
|
|
|
|
|
|
|
|
We maintain translation style guides for Zulip, giving guidance on how
|
|
|
|
Zulip should be translated into specific languages (e.g. what word to
|
|
|
|
translate words like "stream" to), with reasoning, so that future
|
|
|
|
translators can understand and preserve those decisions:
|
2016-11-30 04:34:32 +01:00
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- [Chinese](chinese.md)
|
|
|
|
- [French](french.md)
|
|
|
|
- [German](german.md)
|
|
|
|
- [Hindi](hindi.md)
|
|
|
|
- [Polish](polish.md)
|
|
|
|
- [Russian](russian.md)
|
|
|
|
- [Spanish](spanish.md)
|
2016-11-30 04:34:32 +01:00
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
Some translated languages don't have these, but we highly encourage
|
|
|
|
translators for new languages (or those updating a language) write a
|
2021-01-28 09:05:45 +01:00
|
|
|
style guide as they work , since it's easy to take notes as you
|
|
|
|
translate, and doing so greatly increases the ability of future
|
2021-08-20 21:53:28 +02:00
|
|
|
translators to update the translations in a consistent way. See [our
|
2021-01-28 09:05:45 +01:00
|
|
|
docs on this documentation](../documentation/overview.md) for how to
|
|
|
|
submit your changes.
|
2017-03-03 12:42:07 +01:00
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
### Capitalization
|
2017-03-03 12:42:07 +01:00
|
|
|
|
|
|
|
We expect that all the English translatable strings in Zulip are
|
|
|
|
properly capitalized in a way consistent with how Zulip does
|
2021-08-20 21:53:28 +02:00
|
|
|
capitalization in general. This means that:
|
2017-03-03 12:42:07 +01:00
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- The first letter of a sentence or phrase should be capitalized.
|
2021-08-20 22:54:08 +02:00
|
|
|
- Correct: "Manage streams"
|
|
|
|
- Incorrect: "Manage Streams"
|
2021-08-20 21:45:39 +02:00
|
|
|
- All proper nouns should be capitalized.
|
2021-08-20 22:54:08 +02:00
|
|
|
- Correct: "This is Zulip"
|
|
|
|
- Incorrect: "This is zulip"
|
2021-08-20 21:45:39 +02:00
|
|
|
- All common words like URL, HTTP, etc. should be written in their
|
2017-03-03 12:42:07 +01:00
|
|
|
standard forms.
|
2021-08-20 22:54:08 +02:00
|
|
|
- Correct: "URL"
|
|
|
|
- Incorrect: "Url"
|
2017-03-03 12:42:07 +01:00
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
The Zulip test suite enforces these capitalization guidelines in the
|
2021-05-14 00:16:30 +02:00
|
|
|
web app codebase [in our test
|
2022-02-16 01:39:15 +01:00
|
|
|
suite](../testing/testing.md#other-test-suites)
|
2019-05-27 23:24:26 +02:00
|
|
|
(`./tools/check-capitalization`; `tools/lib/capitalization.py` has
|
|
|
|
some exclude lists, e.g. `IGNORED_PHRASES`).
|
2016-06-30 13:56:04 +02:00
|
|
|
|
2019-05-27 23:24:26 +02:00
|
|
|
[translation-stream]: https://chat.zulip.org/#narrow/stream/58-translation
|