-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing javadoc and change pom version to SNAPSHOT
- Loading branch information
Showing
8 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Vraptor flash i18n | ||
|
||
Write your i18n messages with a fluent and easy mode in Vraptor. | ||
|
||
The common way to add a message(without translate) into vraptor is: | ||
|
||
```java | ||
result.include("mensagem", "Vraptor é incrível").redirectTo(this).method(); | ||
``` | ||
|
||
There is some ways to translate this. Basically what this pluggin makes is facilitate within standardized way of internationalize your messages, throught the method chain we could use just: | ||
|
||
```java | ||
flash.use("message").toShow("vraptor_awesome").redirectingTo(this).method(); | ||
``` | ||
|
||
You could use a conditional method to evaluates if a message should be showed up: | ||
|
||
```java | ||
flash.when(true).use("message").toShow("vraptor_awesome").redirectingTo(this).method(); | ||
``` | ||
|
||
## Configure your i18n | ||
|
||
This pluggin works with I18nMessage native Vraptor class. So to create a language support, you should put into (WEB-INF/classes) or (src/main/resources/) files like: | ||
|
||
messages.properties<br/> | ||
messages_en_US.properties | ||
|
||
Each with the logic: | ||
```text | ||
# key = translated_message | ||
vraptor_awesome = Vraptor is awesome! | ||
``` | ||
|
||
Veja também: | ||
|
||
http://www.vraptor.org/pt/docs/guia-de-10-minutos/#arquivo-de-mensagens<br/> | ||
http://blog.caelum.com.br/i18n-internacionalizacao-com-jstl/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
src/main/java/io/github/projecturutau/vraptor/handler/Redirector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
package io.github.projecturutau.vraptor.handler; | ||
|
||
import br.com.caelum.vraptor.validator.Validator; | ||
import br.com.caelum.vraptor.view.Results; | ||
|
||
public interface Redirector { | ||
/** | ||
* Uses {@link Validator#onErrorRedirectTo(Class)} to redirects to another action | ||
* | ||
* @param controller contains action that will be called | ||
* @return {@link br.com.caelum.vraptor.Controller} to calls some action | ||
* @return Controller to calls some action | ||
*/ | ||
<Controller> Controller redirectTo(Class<Controller> controller); | ||
public <Controller> Controller redirectTo(Class<Controller> controller); | ||
|
||
void sendJSON(); | ||
public void sendJSON(); | ||
|
||
/** | ||
* Stay on the current page, this is the default behavior to POST and PUT methods | ||
* | ||
* @see {@link Results#referer()} | ||
* {@link br.com.caelum.vraptor.view.Results#referer()} | ||
*/ | ||
void stay(); | ||
public void stay(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters