Run ./gradlew generatePot
and you will find a *.pot
file in the directory $buildDir/i18n
.
After the translators did their work, they will give you a file back, probably in one of the three formats below.
*.po
and *.mo
are file formats of GNU gettext, while *.lang
files are in a custom format created for JOSM.
If you wanted, you could even mix these formats, but that's not recommended.
Put the files in the directory src/$sourceSetName/po
(e.g. src/main/po
), then build normally and the files should be picked up.
Note: If you use
*.po
files, you'll needxgettext
to build your JOSM plugin with internationalisation. Everyone who does not havexgettext
installed can still build the project, but these builds are then not internationalised.
Put the files in the directory src/$sourceSetName/mo
, then build normally and the files should be picked up.
Put the files in the directory src/$sourceSetName/lang
, then build normally and the files should be picked up.
If you want to put your translated files in another location, add the relevant parts of the following snippet to your build.gradle
and modify it according to your needs:
sourceSets {
main { // you can do that for any source set, doesn't have to be `main`
po {
setSrcDirs(setOf("new/po/source/directory"))
}
mo {
setSrcDirs(setOf("new/mo/source/directory"))
}
lang {
setSrcDirs(setOf("new/lang/source/directory"))
}
}
}