×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Teun Grinwis
Added: Apr 29, 2015 11:10 AM
Views: 22
  1. // in app.js:
  2. // Declare app level module which depends on views, and components
  3. angular.module('myApp', [
  4.   'ngRoute',
  5.   'myApp.viewGeneral',
  6.   'myApp.viewGprs',
  7.   'myApp.version',
  8.   'pascalprecht.translate'
  9. ]).
  10.  
  11. config(['$routeProvider', function($routeProvider) {
  12.   $routeProvider.otherwise({redirectTo: '/viewGeneral'});
  13. }]).
  14.  
  15. config( function($translateProvider) {
  16.  
  17.     $translateProvider.translations('en', {
  18.         HEADLINE_ID: 'Hello there, This is my awesome app!',
  19.         INTRO_TEXT_ID: 'Intro text in English!'
  20.     });
  21.     $translateProvider.translations('de', {
  22.         HEADLINE_ID: 'Hallo dxxr, Dies ist deutsch!',
  23.         INTRO_TEXT_ID: 'Intro text in Deutsch!'
  24.     });
  25.     $translateProvider.preferredLanguage('de');
  26. } ).
  27.  
  28. // in Html
  29.         <div class="FixedSettings" ng-controller="fixedCtrl">
  30.             <h2 translate="INTRO_TEXT_ID" />
  31.             <h2>{{ 'HEADLINE_ID' | translate }}</h2>
  32.             Mac address: <input type="text" ng-model="mac"><br>
  33.             Serial: <input type="text" ng-model="serial"><br>
  34.             HW type: <input type="text" ng-model="hwtype"><br>
  35.             SW version: <input type="text" ng-model="swversion"><br>
  36.             Settings version: <input type="text" ng-model="settingsPclVersion"><br>
  37.         </div>

1 comment

Sonia Krugers 9 months ago
As a localization management tool for translating Angular apps, I recommend https://poeditor.com

Write a comment