Adding a Language – Додання Мови¶
Preparations – Приготування¶
If the language you want to translate has not been started by someone else already and you wish to create a set of new files for the desired language, say „fr“ (French), then you must first use the environment you have created, as guided in Getting Started, in particular Installing Dependencies – Інсталювання Залежностей and Building the Manual – Вибудування цього Підручника sections.
Це дасть вам основоположне середовище для:
Створення нового набору для мови перекладу з Англомовного джерела.
Виконання команди
makeдля перетворення перекладених текстів у файлах po у файли html для тестування локально.Оновлення змін в Англомовних текстах, які були додані іншими внескодавцями.
Нижче приклади показують процес створення нового набору файлів для французької мови French, код мови fr, на платформі Linux. З іншими платформами це може злегка варіюватися, але повинно бути головно так само.
Create a Blender ID if you have not done so already.
Log into projects.blender.org and Create an Issue requesting for commit access in order to transfer changes to the central repository of the translation team.
Open an instance of a console application.
Change the current working directory to the directory of
blender-manual, where the instance ofMakefileresides.
Пробування процесу вибудування для створення файлів HTML англійською – Trying the Make Process to Create HTML Files in English¶
Переконайтеся, що попередній примірник каталогу
buildвилучено, якщо такий існує:make cleanКонвертуйте усі файли
rstу файли перекладуpot:make gettextСтворіть файли
html:make htmlAfter this, you can actually view the created html files locally by opening the
blender-manual/build/html/index.htmlfile.
Генерування набору файлів для цільової мови – Generating the Set of Files for the Target Language¶
Перевірте поточний репозиторій перекладу, використовуючи команду:
git clone https://projects.blender.org/blender/blender-manual-translations.git locale
This will download all language sets available in the repository into the
localedirectory of your drive. You can go to thelocaledirectory to see the hidden subdirectory.gitwithin it, together with directories of languages. You’ll need to add your own set of files for the language you are trying to translating to.From the
blender-manualdirectory to generate a set of files forfrlanguage:make update_poЦі файли будуть ще лише англійською English з порожніми записами
msgstr.Надішліть новий набір файлів у центральний репозиторій:
cd locale git add fr git commit -m "Initial commit language set of files for French"
Порада
Рекомендується вам створити дві змінні середовища для цих каталогів у
.bashrc, щоб зробити більш зручним змінювання та скриптування команд пакета/оболонки для процесу перекладу та перегляду результатів:export BLENDER_MAN_EN=$HOME/<directory to make file directory above>/blender-manual export BLENDER_MAN_FR=$BLENDER_MAN_EN/locale
Newly generated files will contain some placeholders for authors and revision dates etc. If you find the job of replacing them repetitive, make use of the script
change_placeholders.shin the subdirectory~/blender-manual/tools/util_maintenance, make a copy of that to your localbindirectory and replace all values that were mentioned in the file with your specific details, then after each change to a file, you would do following commands to update the file with your personal details, revision date and time, plus generating the html files for your language, which you can view using your internet browser:$HOME/bin/change_placeholders.sh $BLENDER_MAN_FR make -d --trace -w -B -e SPHINXOPTS="-D language='fr'" 2>&1