kmpoppe / noteSolver

JOSM Plugin: Automatically resolve notes after uploading a changeset.
https://wiki.openstreetmap.org/wiki/User:Kmpoppe/Plugins#noteSolver
GNU General Public License v3.0
12 stars 3 forks source link

Add script to extract i18n strings #12

Closed floscher closed 2 years ago

floscher commented 3 years ago

This adds a small sh-script that can extract a *.pot file from the sources, as soon as there are I18n.tr() calls. This requires xgettext to be installed.

The main command is:

xgettext
  --from-code=UTF-8
  --language=Java
  --add-comments
  --sort-output
  -k
  -ktrc:1c,2
  -kmarktrc:1c,2
  -ktr
  -kmarktr
  -ktrn:1,2
  -ktrnc:1c,2,3
  --files-from=build/i18n/srcFileList/josm-plugin_noteSolver.txt
  --output-dir=build/i18n/pot/
floscher commented 3 years ago

Also, just in case you'd be interested:

I could set up the gradle-josm-plugin for you in a pull request.

It can be set up in a way, where you could still build the project as before with Ant, while also being able to do certain tasks with Gradle like generating the *.pot file or starting a certain JOSM instance with the current version of your plugin, or even a full build.

As always the disclaimer: I'm the creator of the gradle-josm-plugin and therefore biased 😉.

kmpoppe commented 2 years ago

Hey @floscher, sorry for not getting back to you in a timely manner - work is cut out for me ;-) I'll see if I find the time during these coming weeks to make Gradle work. Thanks for your patience!

floscher commented 2 years ago

@kmpoppe No problem, it wasn't urgent :wink:. If you need any help with getting everything set up, feel free to reach out.

I think I'll close this pull request then, since the gradle plugin can do the same as this shell script in the task ./gradlew generatePot.