[zanata-users] Zanata Java properties file workflow

Patrick Huang pahuang at redhat.com
Fri Apr 24 05:58:23 UTC 2015


Hi Jasper,

I just did a test case on my local machine and your use case should be supported (and it works for me).
My project structure:
./zanata.xml
./src/messages.properties
./resources/messages_en_US.properties

content of my 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>jasper</project>
  <project-version>master</project-version>
  <project-type>utf8properties</project-type>

  <src-dir>src</src-dir>
  <trans-dir>resources</trans-dir>
  
  <locales>
    <locale>en-US</locale>
  </locales>
</config>

After I run: zanata-cli push --push-type both --src-lang en-US
I got:
[INFO] Loading project config from zanata.xml                                          
[INFO] Loading user config from /home/pahuang/.config/zanata.ini
[INFO] client API version: 3.4.1, server API version: 3.7.0-SNAPSHOT
[WARN] client API version is 3.4.1, but server API version is 3.7.0-SNAPSHOT
[INFO] Server: http://localhost:8080/zanata/
[INFO] Project: jasper
[INFO] Version: master
[INFO] Username: admin
[INFO] Project type: utf8properties
[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 and target documents
[INFO] Locales to push: [en-US]
[INFO] Current directory: /home/pahuang/work/test/jasper
[INFO] Source directory (originals): src
[INFO] Target base directory (translations): resources
[INFO] Found source documents:
[INFO]            messages
[WARN] pushType set to 'Both': existing translations on server may be overwritten/deleted
This will overwrite existing documents AND TRANSLATIONS on the server, and delete obsolete documents.

Are you sure (y/n)? y
[INFO] pushing source doc [name=messages size=2] to server
Done in 1 secs    
[INFO] Pushing target doc [name=messages size=2 client-locale=en-US] to server [locale=en-US]
Done in 0 secs
[INFO] Running Copy Trans for messages
Done in 0 secs

The client version I used is 3.4.0 (latest is 3.6.0). Server version is our current master but it shouldn't matter. Make sure when you push translation, you see a log message like "[INFO] Pushing target doc [name=...". If not, you will need to double check your console output and compare then to your project file structure and make sure it is correct. e.g. from my output,
[INFO] Current directory: /home/pahuang/work/test/jasper
[INFO] Source directory (originals): src
[INFO] Target base directory (translations): resources
This tells me it would expect to find a translation file at /home/pahuang/work/test/jasper/resources/messages_en_US.properties (combination of current dir and target base dir, then source document name plus locale). 

If you still couldn't get it to work, you can send me your files (with sensitive information removed) and I can see what I can do. Hope this helps.

Regards,
Patrick Huang
Senior Software Engineer
Engineering - Internationalisation
Red Hat

----- Original Message -----
> From: "Jasper Siepkes" <siepkes at serviceplanet.nl>
> To: "Patrick Huang" <pahuang at redhat.com>
> Cc: "Zanata User Mailinglist" <zanata-users at redhat.com>
> Sent: Thursday, April 23, 2015 5:30:59 PM
> Subject: Re: [zanata-users] Zanata Java properties file workflow
> 
> Hi Patrick,
> 
> The reason is because we (the "programmers") created the source resource file
> "MessageResources.properties" (which also happens to be in nl-NL). However
> all
> the text in the application needs to be maintained by other people. The
> reason
> that our source language nl-NL also needs to come from Zanata is that we
> programmers make all kinds of horrible spelling and grammar mistakes, even in
> our first language. The highest grade I ever got for Dutch was a 6 (out of 10
> ;-)...
> 
> I realize this maybe not standard usage of Zanata but what would be the best
> way
> to proceed? Create an empty source file with only keys and no translation
> values
> and push that to Zanata? The translation upload from our source file would
> only
> be one time then. After which we would just remove all the translation values
> from it.
> 
> We don't have any trouble with translation files in other languages; The
> normal
> Zanata workflow works fine with that.
> 
> Kind regards,
> 
> Jasper
> 
> > Op 23 april 2015 om 2:32 schreef Patrick Huang <pahuang at redhat.com>:
> > 
> > Hi Jasper,
> > 
> > Glad you like it.
> > 
> > Without going into much debugging details, it seems odd that you have a
> > source
> > using nl-NL and a target using nl-Nl as well. If they are the same, nothing
> > need to be translated. Do you have another sample translation file that is
> > in
> > other languages? Meanwhile I will try to see if I can reproduce the issue
> > locally.
> > 
> > Regards,
> > Patrick Huang
> > Senior Software Engineer
> > Engineering - Internationalisation
> > Red Hat
> > 
> > ----- Original Message -----
> > > From: "Jasper Siepkes" <siepkes at serviceplanet.nl>
> > > To: "Zanata User Mailinglist" <zanata-users at redhat.com>
> > > Sent: Wednesday, April 22, 2015 6:48:45 PM
> > > Subject: [zanata-users] Zanata Java properties file workflow
> > > 
> > > Hi all,
> > > 
> > > I've been playing around with Zanata and I really like it! I've got the
> > > hang
> > > of
> > > most of the basics but one thing eludes me:
> > > 
> > > Let say I have a "MessageResources.properties" file which I consider the
> > > translation source. The base language of this file is Dutch (nl-NL).
> > > 
> > > So my layout is like this:
> > > 
> > > Source translation file: src/main/string/MessageResources.properties
> > > Sample target translation file:
> > > src/main/resources/MessageResources_nl_NL.properties
> > > 
> > > My zanata.xml is configured as follows:
> > > 
> > > ----8<-------------------------------
> > > https://internal.foo.bar/
> > > foo-project
> > > <project-version>master</project-version>
> > > <project-type>utf8properties</project-type>
> > > 
> > > <src-dir>src/main/strings/</src-dir>
> > > <trans-dir>src/main/resources/</trans-dir>
> > > 
> > > 
> > > nl-NL
> > > 
> > > ----8<-------------------------------
> > > 
> > > Now when I run:
> > > $ zanata-cli push --src-lang nl-NL
> > > $ zanata-cli push --push-type trans --src-lang nl-NL
> > > 
> > > I would expect that the keys and translations get added to zanata.
> > > However
> > > all
> > > the keys (and document) get added to Zanata but none of the translations
> > > are
> > > there. Am I making some kind of error in my thinking in the way I should
> > > work
> > > with Zanata or is this a bug?
> > > 
> > > Kind regards,
> > > 
> > > Jasper
> > > 
> > > _______________________________________________
> > > zanata-users mailing list
> > > zanata-users at redhat.com
> > > https://www.redhat.com/mailman/listinfo/zanata-users
> > >
> 
> >
> 




More information about the zanata-users mailing list