dryuf-csv-localizer-maven-plugin

Maven plugin for converting CSV files into localize files.

License

License

Categories

Categories

Maven Build Tools Net CSV Data Data Formats
GroupId

GroupId

net.dryuf.maven.plugin
ArtifactId

ArtifactId

dryuf-csv-localizer-maven-plugin
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

dryuf-csv-localizer-maven-plugin
Maven plugin for converting CSV files into localize files.
Project URL

Project URL

https://github.com/dryuf/dryuf-csv-localizer-plugin
Source Code Management

Source Code Management

https://github.com/dryuf/dryuf-csv-localizer-plugin.git

Download dryuf-csv-localizer-maven-plugin

How to add to project

<plugin>
    <groupId>net.dryuf.maven.plugin</groupId>
    <artifactId>dryuf-csv-localizer-maven-plugin</artifactId>
    <version>1.0.0</version>
</plugin>

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.3.3
org.apache.commons : commons-csv jar 1.2

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

maven-csv-localizer-plugin

Maven plugin converting translations provided in single CSV file into properties files which can be easily used by common Java frameworks.

Usage

Typical usage is as follows:

pom.xml looks like:

	<plugin>
		<groupId>net.dryuf.maven.plugin</groupId>
		<artifactId>maven-csv-localizer-plugin</artifactId>
		<version>0.0.1</version>
		<executions>
			<execution>
				<phase>generate-resources</phase>
				<goals>
					<goal>generate-localization</goal>
				</goals>
				<configuration>
					<languages>
						<language>en</language>
						<language>cs</language>
					</languages>
					<sources>
						<source>${project.basedir}/src/main/resources/localize/myproject-translations.csv</source>
					</sources>
					<outputDirectory>${project.build.directory}/generated-resources/localize/</outputDirectory>
					<writers>
						<writer>PropertiesLocalizationWriter</writer>
						<writer>CsvdbLocalizationWriter</writer>
					</writers>
				</configuration>
			</execution>
		</executions>
	</plugin>

And provided src/main/resources/localize/myproject-translations.csv:

,,,en,cs
,net.dryuf.maven.plugin.csvlocalizer.Generator,Hello,Hello,Ahoj
,net.dryuf.maven.plugin.csvlocalizer.Generator,Some # inside,More #,# Another
#commented out,net.dryuf.maven.plugin.csvlocalizer.Generator,Again reasonable,Again reasonable,Again reasonable

This will generate localize/_messages_en.properties and localize/_messages_cs.properties with mapping relevant for respective language.

You can even easily include CSV localizations mappings from dependent jars by using dependency:unpack goal and then refering to unpacked CSV files.

License

The code is released under version 2.0 of the Apache License.

Stay in Touch

Feel free to contact me at [email protected] or http://kvr.znj.cz/software/java/ and http://github.com/kvr000

Versions

Version
1.0.0