Skip to content

Commit c41aeda

Browse files
committed
add example of use of i18n-admin module in Samplest (related to #179)
1 parent 97655d4 commit c41aeda

File tree

6 files changed

+16
-0
lines changed

6 files changed

+16
-0
lines changed

restx-samplest/md.restx.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"io.restx:restx-server-simple:${restx.version}",
2727
"io.restx:restx-apidocs:${restx.version}",
2828
"io.restx:restx-specs-admin:${restx.version}",
29+
"io.restx:restx-i18n-admin:${restx.version}",
2930
"ch.qos.logback:logback-classic:${logback.version}"
3031
],
3132
"runtime": [

restx-samplest/module.ivy

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<dependency org="io.restx" name="restx-server-simple" rev="latest.integration" conf="default" />
2626
<dependency org="io.restx" name="restx-apidocs" rev="latest.integration" conf="default" />
2727
<dependency org="io.restx" name="restx-specs-admin" rev="latest.integration" conf="default" />
28+
<dependency org="io.restx" name="restx-i18n-admin" rev="latest.integration" conf="default" />
2829
<dependency org="ch.qos.logback" name="logback-classic" rev="1.0.13" conf="default" />
2930
<dependency org="io.restx" name="restx-barbarywatch" rev="latest.integration" conf="runtime->default" />
3031
<dependency org="io.restx" name="restx-specs-tests" rev="latest.integration" conf="test->default" />

restx-samplest/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@
8080
<artifactId>restx-specs-admin</artifactId>
8181
<version>${restx.version}</version>
8282
</dependency>
83+
<dependency>
84+
<groupId>io.restx</groupId>
85+
<artifactId>restx-i18n-admin</artifactId>
86+
<version>${restx.version}</version>
87+
</dependency>
8388
<dependency>
8489
<groupId>ch.qos.logback</groupId>
8590
<artifactId>logback-classic</artifactId>

restx-samplest/src/main/java/samplest/AppModule.java

+7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
import restx.admin.AdminModule;
77
import restx.factory.Module;
88
import restx.factory.Provides;
9+
import restx.i18n.SupportedLocale;
910
import restx.security.*;
1011

1112
import javax.inject.Named;
13+
import java.util.Locale;
1214

1315
/**
1416
* Date: 1/12/13
@@ -26,6 +28,11 @@ public String appPackage() {
2628
return "samplest";
2729
}
2830

31+
@Provides
32+
public SupportedLocale french() {
33+
return new SupportedLocale(Locale.FRENCH);
34+
}
35+
2936
@Provides
3037
public BasicPrincipalAuthenticator basicPrincipalAuthenticator(SecuritySettings securitySettings,
3138
final @Named("restx.admin.passwordHash") String adminPasswordHash) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
welcome=Welcome!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
welcome=Bienvenue RESTX !

0 commit comments

Comments
 (0)