Source locale is not excluded in target file mappings

Description

Using the maven plugin configured as shown bellow:

And using this config file (zanata.xml):

My project file structure is like this:

src/main/resources/conf/i18n/sourcefile_es.properties <- example source file
src/main/resources/conf/i18n/exampletargetfile_pt.properties <- example target file

The targets (translations) aren't recognized because the filename always contains the source locale. Using "both" pushType, translations are never uploaded

I think that the problem is in this line https://github.com/zanata/zanata-platform/blob/c8173883718b857ff04249ee7fc843c32a173170/client/zanata-client-commands/src/main/java/org/zanata/client/commands/FileMappingRuleHandler.java#L134 because only removes the extension to build the filename placeholder/variable.

Environment

Ubuntu 16.04.1 LTS, java version "1.8.0_45", Apache Maven 3.3.3 (default locale: es_ES, platform encoding: UTF-8)

Activity

Show:
Patrick Huang
April 5, 2017, 6:13 AM

It's a bug introduced by this commit fad3d89d8ce937abda8e1ef9920b69648e8d8fb3
The bug is in file org.zanata.client.commands.pull.PropertiesStrategy
for now looks like the only way is to use the command hook workaround I suggested in previous comment

Carlos Munoz
April 5, 2017, 2:05 AM

Hmm... the rules work like they should work. Patrick what do you think?

DanielO
April 4, 2017, 7:14 AM

here's my config file:

Patrick Huang
April 4, 2017, 1:41 AM

Carlos's suggestion should also work. Can you show us your config file?

Patrick Huang
April 4, 2017, 12:49 AM

Unfortunately we don't support this usage natively. We consider filename being the file without extension, regardless whether you have locale embedded in it or not. In fact, it's hard to tell whether a portion in filename is actually locale. If you don't want to include 'es' in your translation file name, here is a workaround by using command hooks http://docs.zanata.org/en/release/client/command-hook/:

This should give you a relatively clean configuration. You still need to specify '--src-lang es' (if use zanata-cli) or '<srcLang>es</srcLang>' in pom if use maven. Zanata has bugs in the areas where English is not source language. See ZNTA-1587. I will also link this issue to that one.

Ready for Release

Assignee

Patrick Huang

Reporter

DanielO

Labels

None

Tested Version/s

None

Components

Sprint

None

Fix versions

Affects versions

Priority

unspecified