Ninjagoat-translations
Ninjagoat bindings for react-intl. Exposes some components to translate messages inside views and a service to do that for the viewmodel side.
Installation
$ npm install ninjagoat-translations
Add this code to the bootstrapper.ts file:
;application.registernew TranslationsModule;
Point to the translations endpoint in one of your modules.
container.bind"ITranslationsConfig".toConstantValue;
Usage
To translate a message inside a view use a FormattedMessage.
To translate a message inside a viewmodel use the TranslationsManager.
Custom language
By default the language is taken from the one in the browser settings. If you need a different mechanism you can implement your own LanguageRetriever and register it.
container.unbind"ILanguageRetriever";container.bind"ILanguageRetriever".toMyLanguageRetriever;
License
Copyright 2016 Tierra SpA
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.