4. Pull translations by:
zanata-cli pull --pull-type both -l ru
5. Correct the headers of Russian translation files, including
horizon/locale/ru/LC_MESSAGES/django.po
horizon/locale/ru/LC_MESSAGES/djangojs.po
openstack_dashboard/locale/ru/LC_MESSAGES/django.po
openstack_dashboard/locale/ru/LC_MESSAGES/djangojs.po
We need to process all the 4 Russian translation files and create the new version with only pluralities translation items.
7. Change the config file - zanata.xml, make sure to use master-fix version.
<project-version>master-fix</project-version>
8. Upload the source file together with the new translation files into Zanata by:
zanata-cli push --push-type both --disable-ssl-cert --copy-trans false -l ru
9. Copy translations from master version into master-fix version.
10. Rename master version into master-old, and set it as ReadOnly.
Please don't delete master-old, because it has the translation contribution statistic data. We can delete it after 6 month, at least.
Hi, all
I have fixed the bug.
I documented the detail comments here, for future reference:
1. Create an empty version named as master-fix in Horizon project in Zanata
2. Install zanata-cli if you haven't.
3. Create the config file - zanata.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> zanata. org/namespace/ config/"> /translate. openstack. org:443/</url> horizon< /project> version> master< /project- version> type>gettext< /project- type> dir>.</ src-dir> dir>.</ trans-dir> "./horizon/ locale/ *.pot"> horizon/ locale/ {locale_ with_underscore }/LC_MESSAGES/ {filename} .po</rule> "./openstack_ dashboard/ locale/ *.pot"> openstack_ dashboard/ locale/ {locale_ with_underscore }/LC_MESSAGES/ {filename} .po</rule> .*/**</ excludes>
<config xmlns="http://
<url>https:/
<project>
<project-
<project-
<src-
<trans-
<rules>
<rule pattern=
<rule pattern=
</rules>
<excludes>
</config>
4. Pull translations by:
zanata-cli pull --pull-type both -l ru
5. Correct the headers of Russian translation files, including locale/ ru/LC_MESSAGES/ django. po locale/ ru/LC_MESSAGES/ djangojs. po dashboard/ locale/ ru/LC_MESSAGES/ django. po dashboard/ locale/ ru/LC_MESSAGES/ djangojs. po
horizon/
horizon/
openstack_
openstack_
The correct header setting should be:
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
6. Generate the new Russian translation files with only pluralities translation items by following commands:
cp django.po django-tmp.po 3./msgstr[ 2]/ django.po /'msgid_ plural "'/ django.po
grep -v msgstr.2. django-tmp.po > django.po
sed -i s/msgstr.
cp django.po django-tmp.po
sed -i s/'msgid_plural "'/'msgid_plural "AAABBB'/ django-tmp.po
msggrep --msgid -F -e 'AAABBB' django-tmp.po -o django.po
sed -i s/'msgid_plural "AAABBB'
rm django-tmp.po
We need to process all the 4 Russian translation files and create the new version with only pluralities translation items.
7. Change the config file - zanata.xml, make sure to use master-fix version. version> master- fix</project- version>
<project-
8. Upload the source file together with the new translation files into Zanata by:
zanata-cli push --push-type both --disable-ssl-cert --copy-trans false -l ru
9. Copy translations from master version into master-fix version.
10. Rename master version into master-old, and set it as ReadOnly.
Please don't delete master-old, because it has the translation contribution statistic data. We can delete it after 6 month, at least.
11. Rename master-fix version into master.
Regards
Daisy