tflori / angular-translator

translation module for angular
https://tflori.github.io/angular-translator/
MIT License
21 stars 6 forks source link

Update the documentation #25

Closed tflori closed 7 years ago

tflori commented 7 years ago

The documentation still uses TranslateService and other things... rewrite documentation

mveroukis commented 7 years ago

In your docs, on the TranslateLoaderJson page, you mention that HTTP_PROVIDERS should be added to the bootstrap to make it work. HTTP_PROVIDERS is now deprecated and replaced with HttpModule. I'm sure most experienced devs know that but a noob like myself does not. It might be helpful to reflect that change in the docs.

Also, on the Dynamize page there is an example listed on how to pass a parameter to the pipe from the html: <p>{{'NEW_MESSAGES'|translate:'{count:42}'}}</p>

This doesn't appear to work. The translate results to blank and the console has the following:

TranslateLogHandler.ts:4 '{' could not be parsed to object

To get it to work I had to do it like so: <p>{{'NEW_MESSAGES'|translate:[{count:42}]}}</p>

tflori commented 7 years ago

thx for this info. I will update this for version 2.

you don't need to add the providers or the module. in new angular versions each module can import the required modules itself.

tflori commented 7 years ago

@mveroukis Thanks again for this info - I don't use the pipes and just found out that you don't get an array of strings anymore..

In Version 2 you will be able to write {{ 'NEW _MESSAGES' | translate : { count: 42 } }}

Your current code will still work for backward compatibility.

The PR for this change is #27