Conversation
|
Looks like a good approach in principle. It needs some more polishing (using async/await, missing newlines at the end of file, etc.). I think the biggest draw-back is the missing fallback for incomplete translations, but we can implement that when it is requested, which is likely to be soon. Also, but probably at a later date, this will need some extra config for when we are not running at the root of a domain but at |
bereket-WMDE
left a comment
There was a problem hiding this comment.
In the spirit of moving things along, I'd approve this PR.
just fix up the missing "no new line at the end of file" warnings.
we should keep @micgro42 suggestions in mind, though.
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "query-builder-run-query": "Text on the button that runs the query" | |||
| } No newline at end of file | |||
There was a problem hiding this comment.
Missing new-line at the end of file
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "query-builder-run-query": "Run query" | |||
| } No newline at end of file | |||
There was a problem hiding this comment.
Missing new-line at the end of file
| }, | ||
| beforeCreate(): void { | ||
| fetch( 'i18n/en.json' ) | ||
| .then( function ( response ) { |
There was a problem hiding this comment.
This method should use async/await instead.
| messages, | ||
| } ); | ||
| // TODO: Fix the typing warning | ||
| ( this as any ).isi18nLoaded = true; |
There was a problem hiding this comment.
This typing problem might already go away when we use async/await 🤞
This lays the groundwork for i18n using vue-banana-i18n Basically, having the i18n files exposed as public files and downloading them when building the application and showing the results once it's there. Bug: T267730
micgro42
left a comment
There was a problem hiding this comment.
Thanks! We'll figure they types out later
This seems to happen a lot (google says so, one way to fix it is that you need set the return type of all methods but we did that already). Here's an example: vuejs/vetur#2131 |
This lays the groundwork for i18n using vue-banana-i18n
Basically, having the i18n files exposed as public files and downloading
them when building the application and showing the results once it's
there.
Bug: T267730