This plugin allows Maven projects to be translated using crowdin.
Add a server to your ~/.m2/settings.xml (keeping your API key private)
<settings>
<!-- ... -->
<servers>
<!-- ... -->
<server>
<id>crowdin-myproject</id>
<username>myproject<username>
<password>API key</password>
<server>
<!-- ... -->
</servers>
<!-- ... -->
<pluginGroups>
<!-- ... -->
<pluginGroup>com.googlecode.crowdin-maven</pluginGroup>
<!-- ... -->
</pluginGroups>
<!-- ... -->
</settings>
Configure your build for crowdin usage in your project's pom.xml :
<project>
<!-- ... -->
<build>
<!-- ... -->
<plugins>
<!-- ... -->
<plugin>
<groupId>com.googlecode.crowdin-maven</groupId>
<artifactId>crowdin-plugin</artifactId>
<version>LATEST</version>
<executions>
<execution>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
<configuration>
<crowdinServerId>crowdin-myproject</crowdinServerId>
</configuration>
</plugin>
<!-- ... -->
</plugin>
<!-- ... -->
</build>
<!-- ... -->
</project>
Put your messages files in properties format in src/main/messages.
Goal | Description |
---|---|
mvn crowdin:push |
Push the messages files on crowdin. It is a Maven first, files or keys not in Maven will be erased on crowdin. |
Goal | Description |
---|---|
mvn crowdin:export |
Ask crowdin to update the translations on their side. There is a limit of 30 minutes between two exports. |
mvn crowdin:pull |
Retrieve messages from crowdin in src/main/crowdin .src/main/crowdin must be considered as a derived resource. Do not edit those files. |
mvn crowdin:aggregate |
This goal should be executed when the project is built. It aggregates the properties from src/main/crowdin in regular Java properties files.Those files are attached to the build, included in the packaging next to the classes. Using the configuration above in project's pom.xml, this goal is executed on Maven generate-resources . |