[zanata-bugs] [Bug 1096494] dtd import export support using Zanata Client (Maven)

bugzilla at redhat.com bugzilla at redhat.com
Wed May 14 00:47:54 UTC 2014


https://bugzilla.redhat.com/show_bug.cgi?id=1096494

David Mason <damason at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ankit at redhat.com
              Flags|                            |needinfo?(ankit at redhat.com)



--- Comment #8 from David Mason <damason at redhat.com> ---
(In reply to Ankit Patel from comment #7)
> (In reply to David Mason from comment #6)
> > (In reply to David Mason from comment #5)
> > > The requirement for 'File' project type at the moment is that the source
> > > directory and translation directory must be completely separate - they
> > > cannot be the same directory or one nested within the other.
> > 
> > Note that a workaround at the moment to avoid changing project structure
> > would be to add a before-push command to zanata.xml that will copy source
> > and translation files to separate temporary directories, and an after-push
> > command to clean them up. Similar for pull.
> > 
> > This can be done using command hooks:
> > https://github.com/zanata/zanata-server/wiki/Client-Command-Hooks
> > 
> > e.g. something like this in zanata.xml may work:
> > 
> > <hooks>
> >   <hook command="push">
> >       <before>mkdir -p build/source</before>
> >       <before>cp browser.dtd build/source</before>
> >       <before>mkdir -p build/trans</before>
> >       <before>cp -r gu build/trans</before>
> >       <after>rm -rf build</after>
> >   </hook>
> > </hooks>
> > 
> > (you would need to set your source and translation directories to match
> > build/source and build/trans created in the commands)
> 
> Sorry, but not working as I was expecting!

Can you provide details about what you were expecting and about what happened?
I've tried tried this set of command hooks on my machine with zanata cli client
and it behaves as I expect (it is a slightly older client, but command hooks
have not changed since):

Contents of zanata.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config xmlns="http://zanata.org/namespace/config/">
  <url>http://localhost:8080/zanata/</url>
  <project>html-test</project>
  <project-version>6</project-version>
  <project-type>file</project-type>

  <hooks>
    <hook command="push">
        <before>mkdir -p build/source</before>
        <before>cp test.txt build/source</before>
        <before>mkdir -p build/trans</before>
        <before>cp -r de build/trans</before>
        <after>rm -rf build</after>
    </hook>
  </hooks>

  <locales>
    <locale>de</locale>
  </locales>
</config>


Command output:

[damason at damason test]$ zanata-cli push -s build/source -t build/trans
--file-types txt
[INFO] Loading project config from zanata.xml
[INFO] Loading user config from /home/damason/.config/zanata.ini
[INFO] client API version: 3.3.1-SNAPSHOT, server API version: 3.3.1-SNAPSHOT
[WARN] client API SCM id is git-api-3.3.0-15-g47c404d, but server API SCM id is
unknown
[INFO] [Running command]$ mkdir -p build/source
[INFO]     Completed with exit value: 0
[INFO] [Running command]$ cp test.txt build/source
[INFO]     Completed with exit value: 0
[INFO] [Running command]$ mkdir -p build/trans
[INFO]     Completed with exit value: 0
[INFO] [Running command]$ cp -r de build/trans
[INFO]     Completed with exit value: 0
[INFO] Server: http://localhost:8080/zanata/
[INFO] Project: html-test
[INFO] Version: 6
[INFO] Username: admin
[INFO] Project type: file
[INFO] Source language: en-US
[INFO] Copy previous translations: true
[INFO] Merge type: AUTO
[INFO] Enable modules: false
[INFO] Include patterns: 
[INFO] Exclude patterns: 
[INFO] Case sensitive: true
[INFO] Default excludes: true
[INFO] Exclude locale filenames: true
[INFO] Pushing source documents only
[INFO] Current directory: /tmp/hookly
[INFO] Source directory (originals): build/source
[WARN] Using EXPERIMENTAL project type 'file'.
[WARN] Obsolete document removal is not yet implemented, no documents will be
removed from the server.
[INFO] Found source documents:
[INFO]            test.txt
This will overwrite existing documents on the server.

Are you sure (y/n)? y
[INFO] pushing source document [test.txt] to server
[INFO]     transmitting file [/tmp/hookly/build/source/test.txt] as single
chunk
Done in 0 secs
[INFO] [Running command]$ rm -rf build
[INFO]     Completed with exit value: 0

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=CFbLVcyUha&a=cc_unsubscribe




More information about the zanata-bugs mailing list