Browse Source

internalization

master
Krishna Nanda 4 years ago
parent
commit
5ed1cffdca
7 changed files with 220 additions and 12 deletions
  1. 8
      Angular-UrbanBazaar/angular.json
  2. 40
      Angular-UrbanBazaar/locale/messages.fr.xlf
  3. 34
      Angular-UrbanBazaar/locale/messages.xlf
  4. 127
      Angular-UrbanBazaar/package-lock.json
  5. 3
      Angular-UrbanBazaar/package.json
  6. 16
      Angular-UrbanBazaar/src/app/auth/login/login.component.html
  7. 4
      Angular-UrbanBazaar/src/polyfills.ts

8
Angular-UrbanBazaar/angular.json

@ -10,6 +10,10 @@
"strict": true
}
},
"i18n": {"sourceLocale":"en-US",
"locales": {"fr":"locale/messages.fr.xlf"}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
@ -53,6 +57,8 @@
}
],
"outputHashing": "all"
},"fr":{
"localize":["fr"]
},
"development": {
"buildOptimizer": false,
@ -72,6 +78,8 @@
"browserTarget": "Angular-UrbanBazaar:build:production",
"proxyConfig": "proxy.config.json"
},
"fr":{"browserTarget": "Angular-UrbanBazaar:build:fr"},
"development": {
"browserTarget": "Angular-UrbanBazaar:build:development",
"proxyConfig": "proxy.config.json"

40
Angular-UrbanBazaar/locale/messages.fr.xlf

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en-US" datatype="plaintext" original="ng2.template" target-language="fr">
<body>
<trans-unit id="8294911973689652107" datatype="html">
<source>Welcome to Urban Bazaar !!!</source>
<target>Bienvenue au bazar urbain !!! </target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/auth/login/login.component.html</context>
<context context-type="linenumber">5</context>
</context-group>
<note priority="1" from="description">greeting@homecomp</note>
<note priority="1" from="meaning">home</note>
</trans-unit>
<trans-unit id="1467387290176103524" datatype="html">
<source>Username</source>
<target>Nom d'utilisateur </target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/auth/login/login.component.html</context>
<context context-type="linenumber">14</context>
</context-group>
<note priority="1" from="description">username text.@username</note>
<note priority="1" from="meaning">username</note>
</trans-unit>
<trans-unit id="7672030737171300385" datatype="html">
<source>Password</source>
<target> Mot de passe
</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/auth/login/login.component.html</context>
<context context-type="linenumber">17</context>
</context-group>
<note priority="1" from="description">password text.@password</note>
<note priority="1" from="meaning">password</note>
</trans-unit>
</body>
</file>
</xliff>

34
Angular-UrbanBazaar/locale/messages.xlf

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en-US" datatype="plaintext" original="ng2.template">
<body>
<trans-unit id="8294911973689652107" datatype="html">
<source>Welcome to Urban Bazaar !!!</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/auth/login/login.component.html</context>
<context context-type="linenumber">5</context>
</context-group>
<note priority="1" from="description">greeting@homecomp</note>
<note priority="1" from="meaning">home</note>
</trans-unit>
<trans-unit id="1467387290176103524" datatype="html">
<source>Username</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/auth/login/login.component.html</context>
<context context-type="linenumber">14</context>
</context-group>
<note priority="1" from="description">username text.@username</note>
<note priority="1" from="meaning">username</note>
</trans-unit>
<trans-unit id="7672030737171300385" datatype="html">
<source>Password</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/auth/login/login.component.html</context>
<context context-type="linenumber">17</context>
</context-group>
<note priority="1" from="description">password text.@password</note>
<note priority="1" from="meaning">password</note>
</trans-unit>
</body>
</file>
</xliff>

127
Angular-UrbanBazaar/package-lock.json

@ -371,6 +371,127 @@
"tslib": "^2.2.0"
}
},
"@angular/localize": {
"version": "12.1.5",
"resolved": "https://registry.npmjs.org/@angular/localize/-/localize-12.1.5.tgz",
"integrity": "sha512-61ErLHJ7jceWb2T+PLtf2b9GoWuJEM1yMMeW4BTaEXOhzh1+mo9Xv3iYc27Ok4zkbOaL3MQhU4MZq7tUXcqrjQ==",
"dev": true,
"requires": {
"@babel/core": "7.8.3",
"glob": "7.1.7",
"yargs": "^17.0.0"
},
"dependencies": {
"@babel/core": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.3.tgz",
"integrity": "sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.8.3",
"@babel/generator": "^7.8.3",
"@babel/helpers": "^7.8.3",
"@babel/parser": "^7.8.3",
"@babel/template": "^7.8.3",
"@babel/traverse": "^7.8.3",
"@babel/types": "^7.8.3",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.1",
"json5": "^2.1.0",
"lodash": "^4.17.13",
"resolve": "^1.3.2",
"semver": "^5.4.1",
"source-map": "^0.5.0"
}
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"dev": true,
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
},
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
},
"y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"dev": true
},
"yargs": {
"version": "17.2.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.2.1.tgz",
"integrity": "sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q==",
"dev": true,
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
},
"yargs-parser": {
"version": "20.2.9",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
"dev": true
}
}
},
"@angular/material": {
"version": "12.2.6",
"resolved": "https://registry.npmjs.org/@angular/material/-/material-12.2.6.tgz",
@ -10445,9 +10566,9 @@
}
},
"socks-proxy-agent": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.0.0.tgz",
"integrity": "sha512-FIgZbQWlnjVEQvMkylz64/rUggGtrKstPnx8OZyYFG0tAFR8CSBtpXxSwbFLHyeXFn/cunFL7MpuSOvDSOPo9g==",
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz",
"integrity": "sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg==",
"dev": true,
"requires": {
"agent-base": "^6.0.2",

3
Angular-UrbanBazaar/package.json

@ -27,8 +27,9 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^12.1.4",
"@angular/cli": "~12.1.1",
"@angular/cli": "^12.1.4",
"@angular/compiler-cli": "~12.1.1",
"@angular/localize": "^12.1.5",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.7.0",

16
Angular-UrbanBazaar/src/app/auth/login/login.component.html

@ -1,20 +1,20 @@
<body>
<div class="main-div">
<div class="main-div" >
<mat-card>
<mat-card-header>
<mat-card-title>Welcome to Urban Bazaar !!!</mat-card-title>
<mat-card-header >
<mat-card-title i18n="home|greeting@homecomp">Welcome to Urban Bazaar !!!</mat-card-title>
</mat-card-header>
<div style="text-align: center">
<div style="text-align: center" >
<img src="/assets/Images/Logo.png" alt="Logo" />
</div>
<mat-card-content fxLayout="column">
<mat-form-field>
<input matInput placeholder="Username" [formControl]="username" />
<mat-form-field >
<input i18n-placeholder="username|username text.@username" matInput placeholder="Username" [formControl]="username" />
</mat-form-field>
<mat-form-field>
<input type="password" matInput placeholder="Password" [formControl]="password" />
<mat-form-field >
<input i18n-placeholder="password|password text.@password" type="password" matInput placeholder="Password" [formControl]="password" />
</mat-form-field>
<span style="color: red;">{{errorMessage}}</span>
<button mat-raised-button color="primary" (click)="userLogin()">

4
Angular-UrbanBazaar/src/polyfills.ts

@ -1,3 +1,7 @@
/***************************************************************************************************
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
*/
import '@angular/localize/init';
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.

Loading…
Cancel
Save