Знакомство с интернационализацией¶
У вас есть проект и вы хотите перевести его на несколько языков? Это руководство вам в этом поможет. В нём приведены несколько типовых ситуаций, но большинство примеров достаточно общие, так что они могут быть применены и в других случаях.
Перед тем, как переводить какое-либо программное обеспечение, вы должны осознать, что языки в мире сильно отличаются друг от друга, так что вы не должны делать никаких предположений, основанных на вашем опыте. Если вы попытаетесь собрать предложение из отдельно переведённых сегментов, в большинстве языков оно будет выглядеть очень странно. Также вы должны правильно обрабатывать множественные формы, поскольку во многих языках они строятся по сложным правилам, а используемая вами среда интернационализации должна их поддерживать.
Last but not least, sometimes it might be necessary to add some context to the
translated string. Imagine a translator would get string Sun to translate.
Without context most people would translate that as our closest star, but it
might be actually used as an abbreviation for Sunday.
Выбор среды интернационализации¶
Выбирайте ту среду, которая является стандартом для вашей платформы, постарайтесь не изобретать заново колесо, создавая свою собственную среду для работы с локализациями. Weblate поддерживает большинство широко используемых сред, подробнее смотрите раздел Форматы файлов локализации (особенно его подраздел Возможности типов переводов).
Наши личные рекомендации для некоторых платформ приведены в следующей таблице. Эти рекомендации основаны на нашем опыте, но он не всеобъемлющ, поэтому, когда делаете выбор, всегда учитывайте своё окружение.
Платформа |
Рекомендуемый формат |
|---|---|
Android |
|
iOS |
|
Qt |
|
Python |
|
PHP |
|
C/C++ |
|
C# |
|
Perl |
|
Ruby |
|
Расширения браузеров |
|
Java |
|
JavaScript |
Более подробно рабочий процесс для некоторых форматов описан в следующих главах:
См. также
Educating developers for proper internationalization¶
Software internationalization is not just about being able to translate strings but about making the whole software look native to a user from another country. This also includes things like date or number formatting, currency display, or inputting text in the right direction. Most software frameworks have good support for this, so please follow their instructions for all these areas.
The string translation might not be a straightforward task as well. This is especially true for short strings like captions or button labels. Different languages have different rules, and it is not reasonable to expect that the same string will always be translated the same. In many situations it also might not be clear how to translate, and it is even challenging to distinguish whether the word is a verb or a noun.
All developers should understand this and uniquely identify strings used in
different scopes. For example, None meaning «no users» might be translated
differently from None meaning «no items». Use different keys or contexts to
distinguish these terms for translators. You can provide additional context in
Weblate, such as Screenshots and visual context or Пояснение.
The technical side is only part of the work. Translators also notice the project workflow around strings, releases, and communication. A few practices make collaboration much easier:
Respond to translator questions and comments, and make sure the advertised contact channel is actually monitored.
Avoid unnecessary churn in source strings. Rewording or replacing existing strings without a user-visible reason creates avoidable translation work.
Add enough context for translators to understand short or ambiguous strings. Avoid concatenating sentences from fragments, use placeholders that can be reordered, and rely on built-in plural handling.
Ship translations regularly so completed work does not stay unused in Weblate for long periods.
Communicate workflow or policy changes, and keep contribution requirements realistic for smaller language teams.
If a project is no longer maintained, reflect that in the translation workflow instead of leaving components open indefinitely.
Weblate can help with some of these issues. In particular, regular automatic commits from Weblate make translation progress visible in the source code history and reduce the risk that finished work is forgotten before a release. See Непрерывный перевод for automation options.
См. также