Refactor translation and validation

We now use Symfony's Translation component. Yay! We get more powerful pluralisation and better a fallback mechanism. Will want to implement the caching mechanism at some point too. The API is replicated in JavaScript, which could definitely use some testing.

Validators have been refactored so that they are decoupled from models completely (i.e. they simply validate arrays of user input). Language packs should include Laravel's validation messages.

ref #267
This commit is contained in:
Toby Zerner
2015-10-15 22:30:45 +10:30
parent a23180f279
commit c08b62af80
32 changed files with 578 additions and 4096 deletions

View File

@ -125,6 +125,8 @@ export default class App {
* @public
*/
boot() {
this.translator.locale = this.locale;
this.initializers.toArray().forEach(initializer => initializer(this));
}
@ -149,8 +151,6 @@ export default class App {
* Set the <title> of the page.
*
* @param {String} title
* @param {Boolean} [separator] Whether or not to separate the given title and
* the forum's title.
* @public
*/
setTitle(title) {