User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 Build Identifier: Hello, I have been involved with Mozilla Localization from quite long time now and would like to use Zanata for translating Mozilla Firefox. Mozilla Firefox has well mix of dtds and properties files for translations. So far, I have been able to use utf8properties very well using client, but support for dtds on client side is still not enabled. This is important when you deal with bunch of dtd files, not just few files! If we can support dtds at the client side as well, I think one another major open source project is covered and ready to be captured. Reproducible: Always Actual Results: dtds aren't supported at the client side Expected Results: dtds should be supported at the client side as well (not just UI)
Ankit, we already support the DTD format via the Okapi framework. You should be able to use the Zanata clients to push/pull this type of files. Bear in mind your project needs to be of 'File' type when setting it up. You can look at the following link for a bit more info about this: https://github.com/zanata/zanata-server/wiki/Project-Types
(In reply to Carlos Munoz from comment #1) > Ankit, we already support the DTD format via the Okapi framework. You should > be able to use the Zanata clients to push/pull this type of files. Bear in > mind your project needs to be of 'File' type when setting it up. > > You can look at the following link for a bit more info about this: > https://github.com/zanata/zanata-server/wiki/Project-Types It says, "No Selection allows the upload of all file types other than .properties and .xml via the Website GUI, but will prevent the use of Zanata CLI clients."
The paragraph below that sentence is the key one. It talks about the 'File' project type, which is the one you should use for dtd files. That one fully supports the clients.
(In reply to Carlos Munoz from comment #3) > The paragraph below that sentence is the key one. It talks about the 'File' > project type, which is the one you should use for dtd files. That one fully > supports the clients. Hi Carlos, I have just tried, push/pull using Maven client. It's behaviour is not as expected. If you try to push translations from client side, it assume translations as source too! ------------------------ [ankit@ankit testing]$ mvn -B zanata:push -Dzanata.pushType=both [INFO] Scanning for projects... ...[snip] ... [INFO] Found source documents: [INFO] browser.dtd [INFO] gu/browser.dtd [WARNING] pushType set to 'Both': existing translations on server may be overwritten/deleted [INFO] pushing source document [browser.dtd] to server [INFO] transmitting file [/home/ankit/testing/browser.dtd] as single chunk Done in 2 secs [INFO] pushing gu translation of browser.dtd [INFO] transmitting file [/home/ankit/testing/gu/browser.dtd] as single chunk Done in 9 secs [INFO] pushing source document [gu/browser.dtd] to server [INFO] transmitting file [/home/ankit/testing/gu/browser.dtd] as single chunk Done in 3 secs [WARNING] No translation file found for locale gu mapped by null. Expected at /home/ankit/testing/gu/gu/browser.dtd ... ...[/snip]
(In reply to Ankit Patel from comment #4) > I have just tried, push/pull using Maven client. It's behaviour is not as > expected. > > If you try to push translations from client side, it assume translations as > source too! 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. This is due to the difficulty of automatically distinguishing source from translations when we cannot assume a specific directory structure as in the other project types. In the future we intend to provide a more sophisticated system for identifying source and translations, but that is not on the immediate development horizon.
(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)
(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!
(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@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
(In reply to David Mason from comment #8) This is what I had on the filesystem when I ran the command (it is the same before and after running the command): [damason@damason test]$ ls * test.txt zanata.xml de: test.txt
Thanks David for actively looking into this. Here's what I have gone through. http://pastebin.test.redhat.com/209244
(In reply to Ankit Patel from comment #10) > Thanks David for actively looking into this. > > Here's what I have gone through. > > http://pastebin.test.redhat.com/209244 It looks like your issue is caused by the source directory from the command line not properly overriding the value from pom.xml: <configuration> <srcDir>.</srcDir> </configuration> You may get it working if you change this from '.' to 'build/source' or just remove it so it doesn't override the command line option. I've created a separate bug report for the command line option not taking precedence: https://bugzilla.redhat.com/show_bug.cgi?id=1098351
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-140