I added a t9n folder under lib. On that folder I put a file called pt.coffee and put the entire portuguese structure available on the project’s github.
KEEP IN MIND THIS IS MY ONLY COFFESCRIPT FILE - I’M WANT TO USE JAVASCRIPT
Still nothing. What am I missing? What is the appropriate usage of the package in order to translate the accounts-ui loginButtons form?
I also have gotten this error on the client-side: “Uncaught Error: No such function: t9n” when I attempt to directly convert a string returned by a helper function with {{t9n textReturned}}
T9n.setLanguage("pt"); should be done in the top level, shared lib/ folder, in top-level code (i.e. not in Meteor.startup).
No need to put any of their files from Github directly into your project. Adding their package is enough for the standard translations. The example that they give with the lib/t9n folder and the coffeescript file in there is for if you’d like to add some of your own, non-standard texts. You can also use Javascript for that. Here’s what it should look like, if you ever need that:
This works, I’m using it like that on multiple projects. So in case you still get errors or nothing, then make sure you got all (simple) steps correct and you’ll be fine! HTH!
Start over, try getting it to work in a completely fresh app, just to exclude everything that might go wrong – which I don’t know specifically what that could be, but it’s a good idea anyway to eliminate variables from the equation of “Y U NO WORK?!”.
All I can think of for now.
Except… what do you mean by “I tried mapping the words”? We’re talking about setting the language used for accounts-password, right? Actually I’m even using the useraccounts:core package on top, not plain accounts-password.
# accounts
accounts-password
softwarerero:accounts-t9n
useraccounts:core
# plus those, but those should not matter
semantic:ui-css
useraccounts:semantic-ui
That’s probably the issue. Another user on stackoverflow also said he is using that package (useraccounts:core) instead of accounts-ui (I see you are not using it as well, only accounts-password).