Making localization sync#219
Conversation
jdesrosiers
left a comment
There was a problem hiding this comment.
Let's make it one file per locale like it was, just make it .js instead of .ftl. Then translations.js should import each locale file to construct the map.
| } matched | ||
| not-message = Expected a value that doesn't match the 'not' schema | ||
| `, | ||
| "fx-TR": `test = unsupported locale` |
There was a problem hiding this comment.
You can't put text fixtures here because it will be usable outside of tests as well.
There was a problem hiding this comment.
This is still a problem. You need to handle test fixtures in a way that doesn't make them available to users.
|
Hi @jdesrosiers , I did isolate locales and construct the map in translations.js |
|
Now, It is abstracted as before but using the map to avoid file operations that requires async pipeline |
For #216,
Localization.forLocalecan be synchronous if we get rid of the async reading and this PR solves the problem of relying on ftl files by removing them entirely and replacing them with JS module that has the same content and can be imported and by relying on JS module, we can safely switchingLocalization.forLocaleto synchronous