xitrum | Async and clustered Scala web framework and HTTP server | HTTP library
kandi X-RAY | xitrum Summary
kandi X-RAY | xitrum Summary
Async and clustered Scala web framework and HTTP(S) server
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xitrum
xitrum Key Features
xitrum Examples and Code Snippets
Community Discussions
Trending Discussions on xitrum
QUESTION
We are using the GNU gettext utilities for creating PO files directly from our code base. The problem is - however - that some of our code base is written in Scala (most of it is Java). We are using gradle for building and deployment.
As far as I can see, Scala is not a supported language according to the xgettext documentation:
5.1.3 Choice of input file language
‘-L name’
‘--language=name’ Specifies the language of the input files.
The supported languages are C, C++, ObjectiveC, PO, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Smalltalk, Java, JavaProperties, C#, awk, YCP, Tcl, Perl, PHP, GCC-source, NXStringTable, RST, RSJ, Glade, Lua, JavaScript, Vala, GSettings, Desktop.
Is there any way to use xgettext for Scala files? I have found this sbt compiler plugin that does what we need, but unfortunately we are using gradle instead of sbt.
...ANSWER
Answered 2020-Jan-16 at 21:11The Perl module Locale::XGettext allows you to write your own xgettext variant for pretty much every text format. You only have to supply a parser for the language/format that is able to extract the strings.
It is possible to write the parser in Java with minimal Perl boilerplate code around it. I have described the process in a blog post Extending Xgettext With Locale::XGettext. A sample extractor in Java is available at https://github.com/gflohr/Locale-XGettext/tree/master/samples/Java
Disclaimer: I am the author of all the above-mentioned software and documents!
If interfacing with Perl code sounds too complicated, you can also just write a parser for Scala in a language of your choice, run that parser before xgettext, and dump all translatable strings into a format that your version of xgettext
understands, for example C:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xitrum
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page