I'm trying to evaluate which one to use so would appreciate any feedback from others who made this decision. It seems there are two big projects for translation:
http://messageformat.meteor.com/
PROS
https://github.com/TAPevents/
notes:
PROS
CONS? - only JSON format, no yaml, so tedious to edit - no webUI for managing strings
There are some other projects such as https://github.com/Nemo64/meteor-translator but the two above seem the most thorough. Have I missed any others?
What other criteria have people use when selecting the right tool? The underlying tech of messageFormat vs. i18next seems a factor.
1) Multiple languages in page
I'm trying to do a bilingual app but:
Tap: "Only the required translations for the current client's language are sent over the wire"
does this mean the language can only be A or B, but not a mixture, switched automagically based on a session?
ie how to provide helpers in a page to have multiple translation
EN: {{tr "string", 'en'}}
FR: {{tr "string", 'fr'}}
2) Extracting dynamic data
At least messageFormat project will capture/extract strings in static pages, but if I have a lot of content already in complex mongo collections, is there a way to capture this?
Thanks for any insight from the package creators or others in this area.
It sounds like you've already made up your mind. ;)
how to provide helpers in a page to have multiple translation
In MessageFormat you don't need to have special helpers for each language. You simply define your key and value once in your template for your 'base' language--let's say English. Then later you can use the MessageFormat web-based translation tool to add additional strings for say French, Spanish, etc.
To select the language, you simple set locale, so you can add a drop-down in your client so this can be done by your user.
See SetLocale: http://messageformat.meteor.com/docs#methods
if I have a lot of content already in complex mongo collections, is there a way to capture this?
I'd really need to know much more detail about the your application to answer how you might be able to do that. MessageFormat just creates a messageformat.js file of functions, so you could maybe directly modify that file, but they it would get overwritten the next time you run mf_extract. So I think you really just need to get the name-value pairs defined in your app i.e. {{mf 'admin.dashboard.title' 'Dashboard'}}. But then if you have some way to map your current 'content' to these my keys, you might be able to load that content into the mfstrings collection, or maybe write code to pull them into mfAll.js . . .
We are using MessageFormat for all our Meteor apps and love it. I don't have experience with TAP i18n, but MessageFormat seems to serve our needs well (we are doing Japanese, English, Chinese).
I suggest just adding it to your project, or using it with a test project to get some experience with it, then you can decision how you like it. Just make sure your read about mf_extract or you'll get stuck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With