Issue 43 in gettext-commons: allow general options

2 views
Skip to first unread message

codesite...@google.com

unread,
Apr 30, 2010, 9:55:25 PM4/30/10
to gettext-co...@googlegroups.com
Status: New
Owner: bergerfx

New issue 43 by bergerfx: allow general options
http://code.google.com/p/gettext-commons/issues/detail?id=43

I’ve been using the maven plugin for some time and found it quite
useful. The point is that now I would need to pass a couple of
parameters to the xgettext application that are not included in the
configuration parameters, so I wonder if you’re thinking on adding any
way of doing that.

I modified the source code to fit my current needs but I find that
adding one more parameter that allows to pass more options to the GNU
applications would be a nice feature.

Something like the following would be great

<plugin>
<groupId>org.xnap.commons</groupId>
<artifactId>maven-gettext-plugin</artifactId>
<version>1.2.0</version>
<executions>
<execution>
<id>distribute-properties-files</id>
<configuration>
<poDirectory>src/main/po</poDirectory>
<targetBundle>com.kinamik.vault.Messages</
targetBundle>
<outputFormat>properties</outputFormat>
<options>--no-location –add-comments=///</options>
</configuration>
<goals>
<goal>dist</goal>
</goals>
</execution>
</executions>
</plugin>




--
You received this message because you are subscribed to the Google Groups "Gettext Commons Development Discussion" group.
To post to this group, send email to gettext-co...@googlegroups.com.
To unsubscribe from this group, send email to gettext-commons-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gettext-commons-devel?hl=en.

codesite...@google.com

unread,
Jan 24, 2011, 9:10:26 AM1/24/11
to gettext-co...@googlegroups.com

Comment #1 on issue 43 by pvdis...@gmail.com: allow general options
http://code.google.com/p/gettext-commons/issues/detail?id=43

That's already possible with the <keywords> configurations, I do this as
following for my webapp with Freemarker templating:
<properties>
<!-- Gettext -->
<gettext.sourceLocale>en</gettext.sourceLocale>
<gettext.keysFile>messages.pot</gettext.keysFile>
<!--
Add the keywords:
_ = 1st param is singular form
_p = plural, 1st param is singular, 2nd param is plural form
_noop = 1st param is singular form, this one is a special-case
@see
http://www.gnu.org/software/gettext/manual/gettext.html#Special-cases
Set extra options to the xgettext command (without the backslashes!):
\-\-no-location = do not write '#: filename:line' lines in PO files
\-\-add-comments[=TAG] = place comment block with TAG (or those preceding
keyword lines) in PO file
-->
<gettext.keywords>-k_ -k_p:1,2 -k_noop --no-location
--add-comments=///</gettext.keywords>

<gettext.poDirectory>${project.build.resourceDirectory}/locale</gettext.poDirectory>
</properties>

<build>
<plugins>
<plugin>
<!-- http://code.google.com/p/gettext-commons/

http://gettext-commons.googlecode.com/svn/maven2-plugins-site/index.html
-->


<groupId>org.xnap.commons</groupId>
<artifactId>maven-gettext-plugin</artifactId>

<version>${gettext.version}</version>
<configuration>
<targetBundle>Messages</targetBundle>

<sourceDirectory>${project.basedir}/src</sourceDirectory>
<sourceLocale>${gettext.sourceLocale}</sourceLocale>
<extraSourceFiles>
<!-- Use build specific templates directory -->

<directory>${freemarker.templates.dir}</directory>
<includes>
<!-- Include FreeMarker templates -->
<include>**/*.ftl</include>
</includes>
</extraSourceFiles>
<keysFile>${gettext.keysFile}</keysFile>
<keywords>${gettext.keywords}</keywords>
<poDirectory>${gettext.poDirectory}</poDirectory>
</configuration>
<executions>
<execution>
<id>merge</id>
<phase>generate-sources</phase>
<goals>
<goal>merge</goal>
</goals>
</execution>
<execution>
<id>dist</id>
<phase>compile</phase>


<goals>
<goal>dist</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

codesite...@google.com

unread,
Sep 29, 2011, 9:27:16 AM9/29/11
to gettext-co...@googlegroups.com

Comment #2 on issue 43 by hankipa...@gmail.com: allow general options
http://code.google.com/p/gettext-commons/issues/detail?id=43

Awesome, this is helping me tremendously.

Would you be so kind to show some examples in your freemarker templates,
ideally including a case with plural text? Much appreciated!

Hank

Reply all
Reply to author
Forward
0 new messages