Uploaded image for project: 'Zanata'
  1. ZNTA-1729

Source locale is not excluded in target file mappings

    Details

    • Type: Bug
    • Status: Closed (View workflow)
    • Priority: unspecified
    • Resolution: Ready for Release
    • Affects Version/s: server-3.9.6
    • Fix Version/s: platform-4.2.0
    • Component/s: CLI
    • Labels:
      None
    • 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)
    • Tested Version/s:
      None
    • Sprint:
      17.07

      Description

      Using the maven plugin configured as shown bellow:

      <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):

      <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.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                pahuang Patrick Huang
                Reporter:
                danielortegaufano DanielO
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: