Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add example of use of i18n-admin module in Samplest (related to #179)
  • Loading branch information
xhanin committed Mar 31, 2015
1 parent 97655d4 commit c41aeda
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions restx-samplest/md.restx.json
Expand Up @@ -26,6 +26,7 @@
"io.restx:restx-server-simple:${restx.version}",
"io.restx:restx-apidocs:${restx.version}",
"io.restx:restx-specs-admin:${restx.version}",
"io.restx:restx-i18n-admin:${restx.version}",
"ch.qos.logback:logback-classic:${logback.version}"
],
"runtime": [
Expand Down
1 change: 1 addition & 0 deletions restx-samplest/module.ivy
Expand Up @@ -25,6 +25,7 @@
<dependency org="io.restx" name="restx-server-simple" rev="latest.integration" conf="default" />
<dependency org="io.restx" name="restx-apidocs" rev="latest.integration" conf="default" />
<dependency org="io.restx" name="restx-specs-admin" rev="latest.integration" conf="default" />
<dependency org="io.restx" name="restx-i18n-admin" rev="latest.integration" conf="default" />
<dependency org="ch.qos.logback" name="logback-classic" rev="1.0.13" conf="default" />
<dependency org="io.restx" name="restx-barbarywatch" rev="latest.integration" conf="runtime->default" />
<dependency org="io.restx" name="restx-specs-tests" rev="latest.integration" conf="test->default" />
Expand Down
5 changes: 5 additions & 0 deletions restx-samplest/pom.xml
Expand Up @@ -80,6 +80,11 @@
<artifactId>restx-specs-admin</artifactId>
<version>${restx.version}</version>
</dependency>
<dependency>
<groupId>io.restx</groupId>
<artifactId>restx-i18n-admin</artifactId>
<version>${restx.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions restx-samplest/src/main/java/samplest/AppModule.java
Expand Up @@ -6,9 +6,11 @@
import restx.admin.AdminModule;
import restx.factory.Module;
import restx.factory.Provides;
import restx.i18n.SupportedLocale;
import restx.security.*;

import javax.inject.Named;
import java.util.Locale;

/**
* Date: 1/12/13
Expand All @@ -26,6 +28,11 @@ public String appPackage() {
return "samplest";
}

@Provides
public SupportedLocale french() {
return new SupportedLocale(Locale.FRENCH);
}

@Provides
public BasicPrincipalAuthenticator basicPrincipalAuthenticator(SecuritySettings securitySettings,
final @Named("restx.admin.passwordHash") String adminPasswordHash) {
Expand Down
1 change: 1 addition & 0 deletions restx-samplest/src/main/resources/labels.properties
@@ -0,0 +1 @@
welcome=Welcome!
1 change: 1 addition & 0 deletions restx-samplest/src/main/resources/labels_fr.properties
@@ -0,0 +1 @@
welcome=Bienvenue RESTX !

0 comments on commit c41aeda

Please sign in to comment.