mirror of
https://github.com/flarum/framework.git
synced 2025-05-21 14:22:33 +08:00
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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user