89 Commits

Author SHA1 Message Date
Steve Kowalik
17011a2620 Add Zanata support for openstack-manuals projects
Building on existing work for supporting pushing translations
to Zanata for other projects, add support for pushing translations
for the four openstack-manuals projects.

Change-Id: Ic18331b7ee402c4c89b6dacdc4edc02c3ef07cdc
2015-07-03 15:23:23 +10:00
Jenkins
eec80fadb5 Merge "Change Zanata project for django_openstack_auth" 2015-06-30 15:58:49 +00:00
Jenkins
0b9dd9d83f Merge "Handle missing pot files in translation proposal" 2015-06-30 15:26:23 +00:00
Steve Kowalik
7222ffe07b Change Zanata project for django_openstack_auth
It turns out that Zanata can not share a project like Transifex
does, the client gets all jealous and removes all other translation
files when you push the second project. To that end, change the
project of django_openstack_auth to its own name rather than horizon.

Change-Id: I8ddcf18f3fd2549ee0d948041bb62da7f669e76b
2015-06-30 17:03:13 +10:00
Steve Kowalik
544eb51c73 Sprinkle in Horizon translations for Zanata
Building on work landed in II3bfb188c8b0c0e65f22d7edc30721b163f084fff,
add support for pushing source documents of Horizon into Zanata.
This has also necessitated adding support for parsing and adding
rules for create-zanata-xml.py.

As a drive-by correct some incorrect docstrings in ZanataUtils, split
some ludicrously long lines calling create-zanata-xml.py, and correct
usage of an undefined variable in setup_django_openstack_auth.

Change-Id: Id7a2c82e979d1f878022b4982f51ef4ef06ecf4b
2015-06-24 18:47:06 +10:00
Andreas Jaeger
cac641f921 Translations: Update horizon
Horizon uses pot files now as all other projects, adjust scripts for the
change.

Add new Javascript translation for openstack_dashboard.

Remove now unused function compress_non_en_po_files.

Change-Id: Ibd7069c68e458d655a879e552f69f7146b47abc9
Depends-On: I2ae68207994ba549b5d8e551a40a468d63e0a4bb
2015-06-22 19:27:36 +02:00
Andreas Jaeger
b2c02a9e52 Handle missing pot files in translation proposal
searchlight project had only one pot file but not the other five that
are expected. The filter_commit function was filtering out the newly
added file and run "git checkout -- NEWFILE" which failed.

Make the script more robust so that it handles newly added files
correctly.

Change-Id: I4a7a8ab9b75f310992b7232920206d4ddc041268
2015-06-20 09:26:38 +02:00
Steve Kowalik
9ec48c03fe Support pushing translations to Zanata
In order to migrate to Zanata for translations, we need to modify
the proposal scripts to also upload translations to the Zanata
server. This commit supports most projects (those that make use of
upstream_translation_update.sh), as well as django_openstack_auth.

This does not impact the existing push and pull of
translations to Transifex, and also untouched are the translations
for Horizon or the manuals, which are all handled in separate scripts.

Co-Authored-By: stephane <stephane@alum.mit.edu>
Change-Id: I3bfb188c8b0c0e65f22d7edc30721b163f084fff
2015-06-19 00:19:51 +10:00
Andreas Jaeger
a0e27a5933 Fix filter_commit in common_translation_update.sh
This fixes a problem with propose_translation_update.sh on
oslo.concurrency:

+ git reset -q oslo.concurrency/locale/en_GB/LC_MESSAGES/oslo.concurrency-log-error.po
fatal: ambiguous argument
'oslo.concurrency/locale/en_GB/LC_MESSAGES/oslo.concurrency-log-error.po': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Add the "--" to separate paths to handle deleted files as well.

Change-Id: Ifbce50bd851ea0028ebbb948e5173bda5777fc43
2015-06-16 20:11:07 +02:00
Steve Kowalik
e2c58de6fe Drop usage of `` in if statements
Subshells are not required for if statements, so remove them. This
also drops all usage of `` in scripts.

Change-Id: I44c476ddfb67e5b3ebd3aaba3b26561f02708477
2015-06-04 15:44:14 +10:00
Steve Kowalik
e3060b094c Switch to using $() for subshells, part 2
Cleanup every use of `` for subshells in the jenkins/scripts
directory, replacing them with $(), and finally making the
scripts consistent.

Change-Id: Id3e45fb873c1ebeae6ab63a0caa4c427a7ccbb62
2015-06-04 15:33:48 +10:00
Jenkins
34f35f003a Merge "Switch to using test -n" 2015-06-01 23:18:20 +00:00
Jenkins
5dc343c2c0 Merge "Don't repeat the commit message" 2015-06-01 23:18:13 +00:00
Jenkins
cc44e097d8 Merge "Move git config to a common function/file" 2015-06-01 23:16:23 +00:00
Jenkins
16b4dc7ba9 Merge "Ignore last-translator for translation update trigger" 2015-06-01 22:31:47 +00:00
Andreas Jaeger
7166dc85d8 Sort PO files to avoid random reorder
Changes like
https://review.openstack.org/#/c/185848/1/horizon/locale/ca/LC_MESSAGES/djangojs.po
just reordered entries with no content change. Pass --sort-output to
msgattrib to filter the entries in alphabetical order so that any
rearrangements of the source files will not have an effect on the order
of the entries.

Change-Id: I2d9c91f3d1fbcf61ae21521758836793742389ed
2015-05-27 16:43:11 +02:00
Steve Kowalik
f4a2c9802d Switch to using test -n
Using the construct of x$var != x is unnecessary, and has been
unnecessary for quite some time. We trust our shell, so switch to
using test -n.

Change-Id: I8eea943e5b641ba3d8781212877da7ddec167a6c
2015-05-21 13:39:55 -07:00
Steve Kowalik
c7ac961329 Move git config to a common function/file
There are a number of calls to git config in the slave scripts are
all the same, and we should use a shell function to not repeat
ourselves.

Change-Id: Ib2fa3d5ca12d5d08e2d21a734fea13aa9848b19e
2015-05-20 14:17:05 -07:00
Steve Kowalik
1201673176 Don't repeat the commit message
When we edit the commit message for sending the patch for updating
translations, we repeat the entire text of the commit message,
rather than using the existing variable (which is fine, because the
shell will expand the variable before assigning it).

Change-Id: I2840935d2174b1931de0cb782e52cfed4c049312
2015-05-20 11:53:52 -07:00
Andreas Jaeger
05b95e5434 Ignore last-translator for translation update trigger
Do not import a file if the Last-Translator line has changed (together
with other ignored lines).

This will ignore imports like
https://review.openstack.org/#/c/183771/1/doc/glossary/locale/ja.po

If there are other changes, including real translations, the file will
get imported as usual.

Change-Id: I6f56f64c107e4f93b92460612e656b91341a8338
2015-05-16 10:00:48 +02:00
Andreas Jaeger
a848b7e577 Propose translations: Fix handling of deleted files
Today's propose_translation_update.sh run failed for ceilometer since
files were deleted but the loop in filter_commit considered these
as zero changing lines. Change the loop to check only new and modified
files.

Change-Id: I94f5389b9fe0c16d529860f57bb63ef8a3c5c64a
2015-05-11 09:16:44 +02:00
Jenkins
fb9472006b Merge "Only import files if there are new translations" 2015-05-08 14:31:27 +00:00
Jenkins
ee71a44768 Merge "Decrease PO files for imports (horizon+friends)" 2015-05-07 19:01:36 +00:00
Andreas Jaeger
fe09040a32 Minor translation cleanups
Remove .tx file at the end to have a clean repository.

Run setup.py with parameter --quiet, the long list of "extracting
messages from file XXX" are not needed.

Change-Id: I735f02a968aed8b362803781498ccc8085fa0e03
2015-05-03 09:55:00 +02:00
Andreas Jaeger
f2a7e45591 Only import files if there are new translations
Do not import files if only content is deleted but no new translation
added. If there's at least one file with added translations, files with
removed content are also imported.

This should reduce the number of imports, since a project should see an
import only if new strings are in transifex.

Change-Id: Id521a2209bf9cad3b90acf81447db027beed7b64
2015-05-02 13:39:07 +02:00
Andreas Jaeger
c294627405 Decrease PO files for imports (horizon+friends)
Remove untranslated strings and location information from PO files
for horizon and django_openstack_auth. For horizon, the
location information is still in the English PO files as reference for easy
regeneration using "msgmerge EnglishPOFILE POFILE -o COMPLETEPOFILE".

Change-Id: Ibb440320e0fd882c86ff79ec295411c3d062a521
2015-04-29 16:09:18 +02:00
Andreas Jaeger
9ee5653f21 Fix translation compress for manuals
Not all manual repositories have a doc directory, adjust the paths.
Not all files should be compressed, we need to exclude in all
repositories - besides openstack-manuals - the glossary.

Change-Id: I358db42585699b05e893b66e1ac6d2927fb43ee3
2015-04-24 08:51:56 +02:00
Andreas Jaeger
41fe0097a4 Decrease PO files for Doc team imports
Remove untranslated strings and location information from PO files. The
location information is still in the POT files as reference for easy
regeneration using "msgmerge POTFILE POFILE -o COMPLETEPOFILE".

Our tools handle the smaller PO files just fine.

Enable this for Documentation projects.

Also, quote file name arguments in cleanup_po_files.

Change-Id: I4649314f68332d9db46a10aac0d7550bddc46d0e
2015-04-23 07:24:08 +02:00
Andreas Jaeger
8e31e6cd26 Fix path of RST locale file
locale files in RST folders are under $DOCNAME/source/locale/, fix one
error.

Also, small refactor of an condition.

Change-Id: I9a61b2d0e26bd19e2b0c1b8b95b2369530b05fcf
2015-03-09 18:38:17 +01:00
Andreas Jaeger
e8e61d6107 Support translation of RST files
The OpenStack manuals are switching to some RST files. Enhance our
scripts so that they can handle RST files in manual projects.

Change-Id: Ie3e9591d2aad88aced3092aa2a8919af186ce83d
Depends-On: I3124cf65b254c1c5aefce59447bb94240d96a742
2015-03-06 22:23:42 +01:00
Andreas Jaeger
886467a9ac Ignore playground directories for translation
Skip playground directories, those are for testing and will not get
translated at all.
Use regex for skipping of directories instead of long or list.

Change-Id: I9dd04c3a28e7824d8c4be4301beff1cb8257f013
2014-11-18 16:40:04 -05:00
Andreas Jaeger
66a995645a Unbreak translation proposals
The whole script is run with "-e", disable exit on error during the
read. Otherwise the script will fail directly.

Change-Id: I24e16eea58d1c5a7bec3e630b72306a5a32418a4
2014-10-21 09:11:15 +02:00
Andreas Jaeger
b3441ee6ad Add link to translation proposals
Add simple link to our workflow page to inform people what's going on.

Change-Id: I1b884e5101aedea10b51a26fb0c7c89f77dc4a17
2014-10-15 08:49:18 +02:00
Andreas Jaeger
7ddd7b74d0 Fix common_translation_update
Use "git rm -f" to force removal. We might have files that were changed by
the previous steps and then "git rm" will fail with:
$ git rm heat/locale/fr/LC_MESSAGES/heat-log-warning.po
error: 'heat/locale/fr/LC_MESSAGES/heat-log-warning.po' has changes
 staged in the index
| (use --cached to keep the file, or -f to force removal)

This change is needed to fix propose_translation_update.sh for a few
repositories including heat.

Change-Id: Ia5887a0442a25d6bd66351f266cb392cb46ca4d5
2014-10-03 08:37:33 +02:00
Jenkins
c61c597c68 Merge "Cleanup translation files" 2014-10-02 15:03:04 +00:00
K Jonathan Harker
2f03cf35e5 Clean up bashate failures
Also create tools/run-bashate.sh to wrap a find command to search for
files to run bashate on, and use it in tox.

Change-Id: I5ab07425f566a556f158a4b76b00aa35f9fb4385
2014-09-30 12:39:48 -07:00
Andreas Jaeger
ccbb011210 Cleanup translation files
Translations might become stale and obsolete over time, let's cleanup
slowly:
* Remove empty translations files (those were added by accident in the
  past or content gets removed over time)
* Remove files that have less than 20 per cent translated content.

Change-Id: I0c3f6de436d342d032fa38ce2df8a90dd878ea08
2014-09-29 21:30:20 +02:00
Andreas Jaeger
103970ddf9 Fix wrong check for empty files
The condition needs to be negated, we want to remove files
where the grep for non-empty lines does not succeed.

Change-Id: I0111bedcd3bb4affde8b9bd7cd2a21e6849c1513
2014-09-26 10:45:00 +02:00
Anita Kuno
1d21cd635f Reorganizes project-config
This repo was created from filter branching the openstack-infra/
config repo. This process brought a lot of cruft with it in the
form of directories that we no longer need. This patch removes
that cruft so we begin with a tidier repo.

Change-Id: Ibffad1b11c0c5f84eedfb0365369f60c4961a0f3
2014-09-25 11:41:04 -04:00