We're updating the issue view to help you get more done.Learn more

Source locale is not excluded in target file mappings

Using the maven plugin configured as shown bellow:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <plugin> <groupId>org.zanata</groupId> <artifactId>zanata-maven-plugin</artifactId> <version>4.0.0</version> <configuration> <srcDir>src/main/resources/conf/i18n/</srcDir> <transDir>src/main/resources/conf/i18n/</transDir> <pushType>both</pushType> <logHttp>false</logHttp> <validate>false</validate> <sourceLang>es</sourceLang> </configuration> </plugin>

And using this config file (zanata.xml):

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <config xmlns="http://zanata.org/namespace/config/"> <url>http://10.0.0.2:8080/zanata/</url> <project>test</project> <project-version>test</project-version> <project-type>utf8properties</project-type> <src-dir>src/main/resources/conf/i18n</src-dir> <trans-dir>src/main/resources/conf/i18n</trans-dir> <rules> <!-- Generic (not country deployment specific properties): * Locale "es" is always the source * The target is specified in the same path but with locale as suffix --> <rule pattern="**/*_es.properties">{path}/{filename}_{locale}.{extension}</rule> </rules> </config>

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.

Status

Assignee

Patrick Huang

Reporter

DanielO

Tested Version/s

None

Components

Sprint

None

Fix versions

Affects versions

server-3.9.6

Priority

unspecified