To allow translation of release notes, we need to change the srcdir
argument for zanata. The locale files stay the same, just the way they
are referenced is different now.
First, we disable syncing of master for projects with one module
(most projects, exceptions include horizon and keystone) temporarily.
Then, a manual update of resources is done.
And finally syncing is enabled again.
This change disables syncing and lays the ground work for how the setup
will be later:
* stable/mitaka will use old setup.
* master for *all* projects will use same settings, so this unifies
current django and python projects, independent of number of modules.
Change-Id: I9719e256bbd213d9b9265faaf4e4e32632c5d8d7
Looking at today's django imports for horizon like
https://review.openstack.org/#/c/303695 and
https://review.openstack.org/303807 , a lot of strings are removed
from pot files - which looks wrong. There was just a Babel 2.3.2
release, let's go back to 2.2.0 that does not remove these strings.
We need some more time to investigate this and fixing the version to
2.2.0 will give us this time. I fear the translated strings are already
removed from zanata but we might be able to get them back from git.
Change-Id: I952d842e4406b33257e8d715b7ac774a5f6c4f4f
Keystone has now two modules and our extraction generates the same
content for both modules.
To confirm, check current keystone directory, it contains the same
locale files:
$ l keystone_tempest_plugin/locale/keystone_tempest_plugin.pot \
keystone/locale/keystone.pot
-rw-r--r-- 1 aj users 44265 Apr 9 19:46 keystone/locale/keystone.pot
-rw-r--r-- 1 aj users 44265 Apr 9 19:46 keystone_tempest_plugin/locale/keystone_tempest_plugin.pot
Fix the extraction so that only the module directory is scanned for input,
and not anything outside of it. This will generate in this case file
with just the boilerplate in it since the plugin is not translated.
Change-Id: I1d19d8f5172fc44b686fd9f1912af2e88a769d7e
Since Zanata client has an option "--srcdir $modulename/locale
--txdir $modulename/locale", we need "../../" prefix.
Change-Id: If196556581c0033262330a96fee28da1dd523cf6
releasenotes are in the top-level directory, so no need to add
ZanataDocFolder (which is doc for most projects) here. Remove
it so that translation import works.
Change-Id: I1d192098670bd149b102a2be2f1541de252c4714
As first step, extract translation resource,
upload it to Zanata for release notes on openstack-manuals.
Change-Id: I277ab4e8424f09994ec09b1cb83b2a515a71873d
Implements: blueprint release-notes-translation
Zanata supports comments for translators and Horizon previously
honors comments for translators. This can be done by passing
--add-comments Translators: option.
Change-Id: I1986d14587ef7128dc0317e37786b4d23169fb5d
Borrowing from common_translation_update.sh, the config file
proposal should behave the same way. if there is already an
approved job, then we can wait to propose a new revision once it
has been merged.
Moved the original code that perfoms the check into common.sh
and named it check_already_approved.
Change-Id: I48180f8580a54749248a25505edbc1303457e2e4
At now, horizon repo has two python modules and we have
special handling in the translation job scripts.
This commit handles multiple python modules per repository
and locale directory will be prepared per python module.
After this we no longer need to have dedicated functions
for horizon.
Change-Id: Id32fbf37489c0056e5d7722fc3e7c71a95213e08
Remove now unused functions and rename new functions:
* Removed setup_project, renamed setup_django to setup_project
* Removed extract_messages, renamed extract_messages_new to
extract_messages
* Removed extract_messages_log, renamed extract_messages_log_new to
extract_messages_log.
Remove quotation marks around 0/1 for integer comparisons.
Change-Id: Iacdd8bd3a1f715bda14b402af7ba36044c345465
Also, remove liberty jobs for these so that we do not need to backport
or handle them extra.
Backporting would break packaging by third parties, therefore not an
option.
Designate-dashboard setup is broken in liberty anyhow, so no need to
handle it extra. django_openstack_auth is good translated, and we're at
the end of translation.
Besides re-enabling the translations using the new setup, we can now
remove the old function setup_django_openstack_auth since it's not used
anymore.
Story: 2000452
Change-Id: I8b72a148d0f0e89d61807eee50a772e1fbcecaa2
We do not need to handle empty django*pot files. Check in
extract_messages_django whether files are empty and remove them.
This is the same logic that is done in extract_messages.
Story: 2000452
Change-Id: I8e36609d7286dc90393f02b0e7bf229a2e1f4420
Test imported files whether those are valid (can be compiled by
gettext) and do not propose them if they are invalid.
If there are invalid files, a proposal of valid files will still happen.
The script will fail at the end so that these invalid files can be
detected.
Change-Id: Ia48181bc79903dd47be054a6f7c7ee535506d282
python-neutronclient and python-novaclient repos should work with
the new scripts
(though the current locale files still exist in the repo).
The current script will be replaced after the migration completes.
This script supports $modulename/locale/$modulename.pot as POT filename.
Part of infra-spec Improve Translation Setup
Story: 2000452
Change-Id: I67bfab533a8fd48f038c10e82509a2e626205a33
New generic django translation functions can be used with magnum-ui.
magnum-ui specific functions are no longer required.
Also add a note on django_openstack_auth.
Change-Id: I71a1bc78612adefa5f81b89d9fe7e0a1517e08d5
- Create a new extract_django function that can be used
for all django repositories.
- Create a new setup_django function to setup translation server
for django repositories.
- Create a new propose_django function to propose translations.
- Extra a module name from setup.cfg.
Use these functions for murano-dashboard.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I75c61ca709e05740c8932218b132752828b90b91
Story: 2000452
In case of new projects, the locale directory might not exist. Create it
so that the jobs do not fail.
Change-Id: I9b8af9ae61a026d351d00ae93f1d74877e5925b2
Use function setup_commit_message everywhere to avoid duplication of
these lines.
Also, document the side effects of the function in the invocation.
Change-Id: I3b77a232467b536b62b5c61d30705deeb11e725e
Create new function setup_commit_message in common.sh that sets the
commit message after checking for its existance. This check is
currently done in four places, the code has been copied around for this.
Let's unify this so that we only have a single piece of this code block.
For this change, use the new function only for translation update.
The next change will update all other places. We're doing this in steps
in case of problems.
Change-Id: I80c7f81b0b7f225fbf1e1564239f40b5df8537d9
setup_training_guides was written assuming that the project would be
passed as the first argument, but it wasn't called like that. Change
the function to match others to hardcode the project, and look for the
version as the first argument.
Correct the path to the locale directory so that the Zanata client can
read and write translation files correctly.
Change-Id: Iacfd2e831d18af5870fc70a2a54e569d0924474e
This fixes a problem on stable/liberty for openstack-manuals where only
2 out of 12 directories should be translated. But we currently push all
12 source files to the server.
If we have directories that contain locale files, we need to explicitly
exclude them. Add the skip directories to the exclude list for
manual projects.
Change-Id: I1eb481772545261c293baa0eb35731a8ac92d53c
Two functions defined in common_translation_update set $PERC variables,
which are no longer referenced since Transifex support was dropped,
remove them.
Change-Id: I32044abffca0321d31f21f63b2f97d5e78fe8dce
magnum-ui is a special snowflake in that its project name is magnum-ui,
but the directory base for source and translations is magnum_ui. Since
it's a Django project, it also isn't treated like a general Python
project anyway, so treat it like django_openstack_auth, by performing
a little refactoring.
Since the repo now contains files, and is marked for translations in
projects.yaml anyway, enable it for translations jobs.
Change-Id: I7eb73181cccae6d4bfb81848d39099d3502a044c
We do not need to store any empty source translation files in git or in
Zanata. There are many empty LOG source translation files, so let's
remove them.
Note we always keep the "main" files, the "main" files should always
have content.
The change tests after generation of LOG source translation files
whether these are empty and deletes them from filesystem and git.
Change-Id: I0957c66fca5aa5ded93c858766a4c0a93f963032
Today's import includes some files where only the Generated-By line
changes since Babel updated from 2.0 to 2.1.1. Add line to blacklist so
that a review is not generated for files with just this single line
changed.
Change-Id: I8bd477882ca621ece95faa90b4edf2da39925785
To support multiple translation versions in Zanata we need to make the
reverse push into Gerrit branch aware as well. Do this by setting up the
existing propose translation jobs to accept a branch parameter which
tells them which version to pull from Zanata and where to push into
Gerrit.
This will add a new periodic jenkins job for each release/branch.
Change-Id: Ia206bfaa7dd6eaad6aa1f6e5ddbbbf9cdadf8db0
Merge the two pull_from_zanata functions. We do not need the special
50 % rule for manuals anymore.
Change-Id: I80ed31b5d59020ece3abcfc4bd9e6f8145dd566a
Create extract_messages function that can be used by both python and
django_openstack_auth repositories.
This enables the extra keywords for django_openstack_auth as well.
Change-Id: Ica998700215db5a0eae6aa88f4462ae416af2bdd
Update comments for switch to Zanata.
Remove special handling for glossary that was needed by transifex and is
now a nop.
Change-Id: I74b40d15b652de036dd94a0c024aeee828d31236
Remove all invocations of transifex client "tx".
This removes also the script populate-zanata-project.sh that is not
needed anymore, since we have switch to Zanata and started translating
there. The script is broken with the removal of "tx" support in other
places and not needed anymore.
Change-Id: I74350c92da425a6bf32ea1debd217a531dc2f400
With the exception of openstack-manuals, we don't want glossary
changes proposed to Gerrit. Adjust common_translation_update.sh
to add the glossary directories to the excluded files.
Change-Id: Id732c048200f241f160188969737bd38b679ecf6
Add X-Generator header to ignore list: If this variable changes, there's
no need to update the translations.
Refactor to write regex only once.
Change-Id: Ic4d1ef140c1419bf14e43bd89b371d8324c79193