Skip to content

Commit 3550c36

Browse files
authored
Merge pull request #2 from laravelcm/add-locale
Add locale
2 parents 9a11eb4 + bc276cc commit 3550c36

File tree

18 files changed

+1150
-88
lines changed

18 files changed

+1150
-88
lines changed

angular.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
"skipTests": true
1717
}
1818
},
19+
"i18n": {
20+
"sourceLocale": "fr-FR",
21+
"locales": {
22+
"en": {
23+
"translation": "src/locales/messages.en-US.xlf",
24+
"baseHref": "/en/"
25+
}
26+
}
27+
},
1928
"root": "",
2029
"sourceRoot": "src",
2130
"prefix": "admin",
@@ -66,6 +75,9 @@
6675
"extractLicenses": false,
6776
"sourceMap": true,
6877
"namedChunks": true
78+
},
79+
"en": {
80+
"localize": ["en"]
6981
}
7082
},
7183
"defaultConfiguration": "production"
@@ -78,6 +90,9 @@
7890
},
7991
"development": {
8092
"browserTarget": "admin-cpanel:build:development"
93+
},
94+
"en": {
95+
"browserTarget": "admin-cpanel:build:development,en"
8196
}
8297
},
8398
"defaultConfiguration": "development"

package-lock.json

Lines changed: 177 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
7+
"start:en": "ng serve --configuration=en -- --port 4201",
8+
"extract": "ng extract-i18n --output-path src/locales",
79
"build": "ng build",
810
"watch": "ng build --watch --configuration development",
911
"test": "ng test",
@@ -46,6 +48,7 @@
4648
"@angular-eslint/template-parser": "13.5.0",
4749
"@angular/cli": "~13.3.5",
4850
"@angular/compiler-cli": "~13.3.0",
51+
"@angular/localize": "^13.3.11",
4952
"@ngx-env/builder": "^2.2.0",
5053
"@schematics/angular": "^14.2.2",
5154
"@types/jasmine": "~3.10.0",
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div>
22
<logo-svg class="h-auto w-36 text-slate-900 dark:text-white"></logo-svg>
3-
<h2 class="mt-6 text-3xl font-semibold text-slate-900 dark:text-white">Mot de passe oublié?</h2>
4-
<p class="mt-2 text-sm text-slate-500 dark:text-slate-400">
3+
<h2 class="mt-6 text-3xl font-semibold text-slate-900 dark:text-white" i18n>Mot de passe oublié?</h2>
4+
<p class="mt-2 text-sm text-slate-500 dark:text-slate-400" i18n>
55
Saisissez votre adresse e-mail et nous vous enverrons un lien pour réinitialiser votre mot de passe.
66
</p>
77
</div>
@@ -16,23 +16,24 @@ <h2 class="mt-6 text-3xl font-semibold text-slate-900 dark:text-white">Mot de pa
1616
<div>
1717
<input-overlaping-label
1818
label="Adresse E-mail"
19+
i18n-label="attr-email"
1920
name="email"
2021
formControlName="email"
2122
></input-overlaping-label>
2223
</div>
2324

2425
<div class="flex items-center justify-end">
25-
<button-primary type="submit" [loading$]="(loading$)">
26+
<button-primary type="submit" [loading$]="(loading$)" i18n>
2627
Envoyer le lien de réinitialisation
2728
</button-primary>
2829
</div>
2930
</form>
3031

3132
<p class="mt-2 text-right">
3233
<a routerLink="/auth/login" class="inline-flex items-center text-sm font-medium leading-5 text-secondary-500 hover:text-secondary-600 hover:underline">
33-
<svg class="w-5 h-5 mr-1" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
34-
<path d="M6.75 15.75L3 12M3 12L6.75 8.25M3 12H21" />
35-
</svg>
36-
Retournez à la page de connexion
34+
<svg class="w-5 h-5 mr-1" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
35+
<path d="M6.75 15.75L3 12M3 12L6.75 8.25M3 12H21" />
36+
</svg>
37+
<span i18n>Retournez à la page de connexion</span>
3738
</a>
3839
</p>

0 commit comments

Comments
 (0)