Scalingua Play module

An integration module for Play Framework

License

License

Categories

Categories

Akka Container Microservices Reactive libraries
GroupId

GroupId

ru.makkarpov
ArtifactId

ArtifactId

scalingua-play_2.11
Last Version

Last Version

0.8.1
Release Date

Release Date

Type

Type

jar
Description

Description

Scalingua Play module
An integration module for Play Framework
Project URL

Project URL

https://github.com/makkarpov/scalingua
Project Organization

Project Organization

Maxim Karpov
Source Code Management

Source Code Management

https://github.com/makkarpov/scalingua

Download scalingua-play_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/ru.makkarpov/scalingua-play_2.11/ -->
<dependency>
    <groupId>ru.makkarpov</groupId>
    <artifactId>scalingua-play_2.11</artifactId>
    <version>0.8.1</version>
</dependency>
// https://jarcasting.com/artifacts/ru.makkarpov/scalingua-play_2.11/
implementation 'ru.makkarpov:scalingua-play_2.11:0.8.1'
// https://jarcasting.com/artifacts/ru.makkarpov/scalingua-play_2.11/
implementation ("ru.makkarpov:scalingua-play_2.11:0.8.1")
'ru.makkarpov:scalingua-play_2.11:jar:0.8.1'
<dependency org="ru.makkarpov" name="scalingua-play_2.11" rev="0.8.1">
  <artifact name="scalingua-play_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='ru.makkarpov', module='scalingua-play_2.11', version='0.8.1')
)
libraryDependencies += "ru.makkarpov" % "scalingua-play_2.11" % "0.8.1"
[ru.makkarpov/scalingua-play_2.11 "0.8.1"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
ru.makkarpov : scalingua_2.11 jar 0.8.1
com.typesafe.play : twirl-api_2.11 jar 1.4.2
com.typesafe.play : play_2.11 jar 2.7.3

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.11 jar 3.0.8

Project Modules

There are no modules declared in this project.

Scalingua Build Status Latest version Join the chat at https://gitter.im/makkarpov/scalingua

Have you ever wondered that there is no gettext-like library for Scala? Scalingua is here to fix it! It comes with lightweight runtime library and full-featured compile-time macros and SBT plugin that will combine the powers of gettext and Scala in a single library.

Scalingua consists of four modules:

  • core — a minimal runtime components for internationalization. It's very lightweight (~ 30 kB) and provides basic functions like loading precompiled translations.
  • scalingua itself — library with macros that have these features:
    • String interpolator that makes internationalization of strings as easy as writing one letter before them;
    • Plural string interpolator that adds plural suffixes for you;
    • Macros for strings with contexts (msgctxt) and plural strings;
    • Macros leaves no dependency on scalingua library — you can include it in provided scope and it will not break anything;
    • Macros will extract all your strings to separate *.pot file every compilation run and keep this file up-to-date with during incremental compilation;
    • You can translate more complex formats like HTML — all placeholders will be escaped, so no XSS attacks are possible;
    • You can re-use existing macros from this library to implement custom translation utilities (e.g. create th interpolator that will translate HTML) or move I18n method to your Utils object, but in this case you will have dependency on scalingua
  • scalingua-sbt — SBT plugin with small but important task:
    • Automatically sets compiler parameters so you don't have to remember them;
    • Parses *.po files and compiles them to efficient binary files and Scala classes.
  • scalingua-play — Integration module for Play framework:
    • Dependency injection bindings to summon Messages through DI;
    • HTML output format with ready to use functions and interpolators;
    • Extraction of visitor language from request headers.

Getting started

Versions

Version
0.8.1
0.8
0.7.4
0.7.3
0.7.2
0.7.1
0.7
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.2
0.6.1
0.6
0.5.3
0.5.2
0.5.1
0.5
0.4.1
0.4
0.3