Closed beeing closed 7 months ago
Thanks for the suggestion, I can see the usefulness of such a mechanism. Proper fallback would need to be handled by the ngx-translate core, not this plugin, however. There is no way for the compiler to say "I see a backtick, so I'll pass this along to the next (default) compiler in line." It could probably get its own instance of the default compiler and use that, but it's a bit messy. I'll try and see what it looks like, but no promises.
@lephyrus thank you for your thoughts, agree that the core may also play apart but (correct me if I'm wrong) this compiler has taken over the default compiler which in a way it has priority to intercept all translate compilation task.
Unless the core allows special syntax to choose which compiler to use. Anyway, looking forward to a solution for this :)
... more than 5 years later: You were right, @beeing. This was easy, and I should have done it a long time ago.
... more than 5 years later: You were right, @beeing. This was easy, and I should have done it a long time ago.
Well, it's never too late. Glad it helps.
Hi, giving this some thoughts, how about adding a feature to allow fallback to original translator or new messageformat.
My idea is to add a special character, say backtick character to the key which then use the messageformat compiler, else it fallbacks to original translator.
Then it is easier to transition over to messageformat for bigger projects.
Thanks!