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
Switch the translation scripts to only pull from Zanata, no matter
what extra arguments they are passed on the command line. This does
not completly remove support for Transifex, which will be cleaned up
in a future commit.
Change-Id: I21bd54d4205693315da1152a310ff4faf22531a5
Translations proposals are being moved to being submitted by Zanata rather than
Transifex, reflect this in the Gerrit topic.
Change-Id: I9bd7dc8c6cd761cdcd50b7ec0dcd34e57b253f47
Since Zanata has trouble mapping .pot files that don't start with ./
for projects that set trans-dir and src-dir to ., make use of a new
variable to set them correctly for all manuals projects.
Change-Id: I729633db3e76cc07e0ec3d5083c15fa73770a21c
The default rule for django_openstack_auth does not match anything since
the .po files are not named the same as the .pot file, set the rule
manually.
Change-Id: I32971259531ed18141a2011621b69d12085cbe5f
The rule pattern for finding .pot files within Horizon is far too
locked down, and will not match anything. Correct it to use paths
that will match.
Change-Id: I7ca45dec0ea4067d8d88a6ac99f11cf9da4a8b35
The existing function pull_from_zanata would only work for the simple
Python project case of pulling translations from Zanata -- with only
locales directory and trivial rules to apply, with no real hope of
working for Horizon or OpenStack Manuals, given the current
functionality of the Zanata CLI utility.
Rewrite it to download every translation from Zanata and perform some
checks by hand if we keep the file or remove it. This also required
refactoring a large portion of cleanup_po_files so both functions could
leverage the same code. OpenStack Manuals treats downloaded
translations sufficiently different that a similar function was required.
This also adds full support for Horizon and OpenStack Manuals projects,
including jobs, as well as new job templates to make it easier to
transition projects to pulling from Zanata. Adding -zanata jobs for the
Python projects and django_openstack_auth is not required, they are
already present.
Change-Id: I5b9f2eca7f099c56057fc5d09b4bbfe5ea5c596d
This causes the Zanata CLI utility to print an error message about
accepted variables, and it may cause problems for the parser.
Change-Id: If46bd2baf8ee12394b61a9d505fd9f7e690f1b23
Since we're getting closer to switching over to Zanata, we want to
be notified of problems, and most, if not all projects do not fail
when generating the zanata.xml file, no longer mask the exit status
by using an if block.
Change-Id: I0e013df1048ab564ce72124dbdacce2065807d52
*/source/common/* will only match one path element either side, so
we need to open the glob a little wider to match correctly. It also
appears that the other manuals repos also have source/common as a
symlink, so remove the openstack-manuals guard.
Change-Id: Id6e883ec388d9d5f6d471fa8b23f8e3f2ed1885a
*/source/common in the openstack-manuals repository is a symbolic
link to common-rst, which results in pushing the files twice, and
may result in confusion. Add that path to the excludes for
openstack-manuals only.
Change-Id: I6067d94d71d3d025fc81cf331c84d5b214752218
Zanata 3.7.1 has moved much of the locale logic to the server, which
means we can no longer make use of client side transforms, such as
map-from, so set the locale to locale_with_underscore so dashes are
replaced with underscores.
Change-Id: I0bde5b84388f2be39c85600870ec530e8b5c07a5
To help move to Zanata, we should pull down translations from
the server. Add a function that should behave the same way as
the existing Transifex function, as well as changing two existing
scripts to call it based on a command-line parameter. Add two new
jobs with a -zanata suffix so we can switch projects one at a time.
This change deals with all of the Python projects and
django_openstack_auth. Horizon and OpenStack manuals will be dealt with
in a future patch.
Change-Id: I8003ac37aeb89d59ceeba2e75eed2f8100b82367
Fix last change to be applied at proper place.
The glossary test needs to be in the !RST case, move it over.
Change-Id: Ib629ad85edd7f57288c94056154d1359126a4eac
Transifex now reserves glossary as part of the name, so rename it (as
done in transifex) to glossary-1.
Glossary is only used for openstack-manuals, so we do this change only
at that place.
Change-Id: I6e0e678b9c19c3a5fec882ede40679a7c8b73c5a
For projects such as Manuals and Horizon, the source directory in
zanata.xml is set to '.', which may have the unintended side-effect
of the Zanata client finding .po or .pot files under dot directories.
Add a new option to create-zanata-xml, and use it for those two
projects.
Change-Id: I5fc26069c288eca130a45c6e9c5e3dd00ad2c784
In preperation for switching projects one at a time to pulling
translations from Zanata, refactor the two calls to tx pull into
a common function.
Change-Id: I21051fbdcf7bd210606333ba46e5abb0c64e7540