Giter VIP home page Giter VIP logo

scala-xgettext's People

Contributors

c0d3r85 avatar colindean avatar fbaierl avatar marcusjoost avatar mlangc avatar ngocdaothanh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scala-xgettext's Issues

Add option to ignore non-literal-constant strings instead of throwing an Exception

The arguments ``singular``, ``plural``, and ``context`` MUST be literal constant string, like in the above examples. Otherwise exception will be thrown during compilation.

Would it be possible to add a configuration option that changes this behavior into ignoring any string that is not a literal constant string instead of throwing an Exception? If you deem this useful, I could look into making a PR that adds this behavior.

Handling interpolated strings?

We're observing a behavior when using interpolated strings. If our code is:

println(t(s"Sending node"))

Then the output in i18n.pot is:

msgid new StringContext(scala.this.Predef.wrapRefArray[String](Array[String]{"Sending node"})).s(immutable.this.Nil)

Where interpolation is actually used:

println(t(s"Sending node ${node.name}"))

we see:

msgid new StringContext(scala.this.Predef.wrapRefArray[String](Array[String]{"Sending node ", ""})).s(scala.this.Predef.genericWrapArray[Any](Array[Any]{StreamOfIndexables.this.channel().getClass().toString()}))

Can we not use interpolation with scala-xgettext?

Allow multiple marker methods

See #3.

Multiple markers for t can be configured like this:

scalacOptions ++= Seq(
  "xitrum.I18n", "t:tr", "t:preparetr", "t:marktr"
).map("-P:xgettext:" + _)

Similar for tn, tc, and tcn.

Make i18n method names configurable

In Java/Scala-land, I would argue, tr, trn, ... are more common, at least in my projects. I currently still use xgettext which accept the method names with the -koption. Using scala-xgettext is not possible because of incompatible hardcoded method names.

Pass project-id-version as parameter

I'd like to "version" the pot files by giving it the project name and the commit hash at which the i18n.pot file was generated. Those aren't really details that xgettext should extract itself, so perhaps let the build system pass that as an option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.