Перевод на другие языки#

Хотя английский является официальным языком для всех проектов UBports, пользователь может свободно использовать любой язык.

Мы прилагаем все усилия, чтобы создать действительно качественный продукт, и Вы тоже можете помочь нам. Вы сами решаете, сколько времени потратить на перевод. Несколько минут, несколько часов - нам нужна любая помощь.

How does a text get translated (technical background)#

Большинство приложений для Ubuntu Touch переводятся с помощью GNU gettext. В .pot-файле находятся строки со всеми подписями и текстами из приложения. Из этого файла формируется отдельный .po-файл для каждого языкового раздела. Этот файл можно можно открыть в любом текстовом редакторе. За каждой оригинальной строкой (в большинстве случаев, на английском) следует переведенная строка согласно правилам и синтаксису файлов .po. Некоторые приложения можно перевести с помощью QtLinguist <https://doc.qt.io/qt-5/qtlinguist-index.html>.

Within an app strings are marked either this way i18n.tr("string") when using gettext or like this tr("string") when using QtLinguist. When the app is built those translatable strings are extracted and written into the .pot or .ts template files. The .po and .ts language files then need to be updated from their template.

После завершения перевода, файлы доступны для всех пользователей в новой версии программы.

Способы перевода#

There are three commonly used ways to translate an app:

  • Weblate: A web based translation tool. UBports apps using Weblate can be translated at the UBports translation projects dashboard and the Lomiri translation projects dashboard. There is an automatic transfer of new strings from an apps repo to weblate. Translated strings get back as commits to the repo from weblate.

  • Editor: Translation is done by changing .po files with the editor of your choice, and a GitHub/GitLab account. The .po/.ts files for each project are in their repository on our GitLab organization or on our GitHub organization. After translating the translator commits new translations to an apps repo generally by opening a merge request/pull request.

  • Team translation: We also have a Translation Forum to discuss translating Ubuntu Touch and its core apps. Some projects are using Telegram or Matrix groups too, and some teams are still using the Ubuntu Launchpad framework.

Core apps and some community apps like dekko or TELEports are generally using weblate for translation. This is the preferred way to translate and it does not need any programming skills. Please have a look at the UBports translation projects dashboard and the Lomiri translation projects dashboard. When using weblate do not edit .po files manually. Commiting edited .po files can break the automated process of translation.

Большинство приложений разрабатывается независимыми разработчиками, для переводов используются в основном файлы .pot/.po. В этом случае их нужно редактировать вручную и загружать в репозиторий с приложением.

How-To (Краткие инструкции)#

Hosted Weblate#

You can go to UBports translation projects dashboard or the Lomiri translation projects dashboard, go to a project, and start making anonymous suggestions without being registered. If you want to save your translations, you must be logged in.

Для этого зайдите в раздел UBports Weblate - «Регистрация». На странице регистрации есть две опции:

  • Регистрация через действующий адрес электронной почты. Также потребуется Ваше полное ФИО и имя пользователя на сайте. Нужно будет также придумать секретный вопрос и ответ на него.

  • Регистрация с использованием учётной записи на других ресурсах. На данный момент, можно использовать учётные записи с сайтов openSUSE, GitHub, Fedora и Ubuntu.

Once you’re logged in, the site is self-explanatory and there you’ll find all the options and customization you can do.

Теперь, когда Вы на сайте проекта, проверьте, есть ли Ваш язык в списке переводов. Если в проекте переводов на нём нет, то можно добавить перевод на новый язык самостоятельно.

Редактор файлов .po/.ts#

Если Вы хотите напрямую работать с файлами .po/.ts, нужно точно понимать все принципы работы. Первое, о чём нужно помнить, это:

Предупреждение

**Никогда ** не загружайте файлы * .po * в проекты, которые переведены с помощью weblate. Это может нарушить весь процесс переводов с помощью этого сервиса.

Как уже упоминалось выше, для переводов и работы с файлами .po/.ts подойдёт любой текстовый редактор и учетная запись на сайтах GitHub/GitLab. Идеальный случай, если установлен clickable , и Вы умеете компилировать приложения.

There are online gettext .po editors and those you can install on your computer. You can choose whatever editor you want, but we prefer to work with free software only. There are too many plain text editors and tools to help you translate .po/.ts files to list here.

Примечание

For high quality translations it is recommended to go through all of the steps given below. Although if you are not familiar with building apps using clickable, skip the steps 4. to 6. Although, you may not be able to translate the latest strings and you will not know if the strings fit into the apps layout.

Как продолжить работу над переводом:

  1. Fork the apps repo into your GitHub or GitLab account

  2. Clone the repo locally or use GitLab’s online editor

  3. (optional) Create a new branch for the translation

  4. Build the app using clickable to get up-to-date .pot/.ts template files

  5. Update the desired .po/.ts language file(s) from the template

  6. Translate all strings

  7. Build and install the app on your device and test the translations

  8. (optional) Repeat steps 6. and 7. until you are satisfied with your work

  9. Push the translated .po/.ts file(s) to your forked repo [do NOT commit .pot/.ts template files]

  10. Open a merge/pull request from your fork to the apps repo

Общение с группой по переводам (Translation Team)#

Можно пообщаться с другими пользователями, занимающимися переводами в соответствующем разделе на форуме UBports . Для этого придётся там зарегистрироваться.

Единственное требование - перед тем, как создать тему, укажите язык перед названием. Например, [Spanish] Как создать перевод?

Общение с другими пользователями поможет лучше организовать работу над переводами.

Лицензия#

Все переводы и все работы над проектом ведутся под лицензией Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) <https://creativecommons.org/licenses/by-sa/4.0/> ` _Ваше участие в проекте явно говорит о том, что Вы согласны с условиями этой лицензии.

Чтобы подробнее изучить лицензионные условия, перейдите по ссылке.