Skip to content

Commit 246b2a5

Browse files
committed
setup localization
1 parent 30e58af commit 246b2a5

7 files changed

Lines changed: 58 additions & 3 deletions

File tree

angular.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@
9999
]
100100
}
101101
}
102+
},
103+
"i18n": {
104+
"sourceLocale": {
105+
"code": "en",
106+
"subPath": ""
107+
},
108+
"locales": {
109+
"pt-BR": {
110+
"translation": "src/locale/messages.pt-BR.xlf"
111+
}
112+
}
102113
}
103114
}
104115
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
7-
"build": "ng build",
7+
"build": "ng build --localize",
88
"watch": "ng build --watch --configuration development",
99
"test": "ng test",
1010
"serve:ssr:appoutlet.github.io": "node dist/appoutlet.github.io/server/server.mjs"

src/app/component/blog/blog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h2 class="title is-2 has-text-centered mt-6">Latest Insights & Updates</h2>
2828
<p>{{ post.brief }}</p>
2929
</div>
3030

31-
<a [href]="post.url" target="_blank" class="button">
31+
<a [href]="post.url" target="_blank" class="button" i18n>
3232
<i class="ph ph-arrow-up-right mr-2"></i>
3333
Read the full article
3434
</a>

src/app/component/hero/hero.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<h1 class="title is-1 has-text-centered block">AppOutlet</h1>
1111

12-
<p class="title is-4 has-text-centered block pt-3 px-3">
12+
<p class="title is-4 has-text-centered block pt-3 px-3" i18n>
1313
Crafting exceptional mobile and desktop applications that work everywhere with <span class="brand-gradient-text">stunning design</span>
1414
</p>
1515

src/locale/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h

src/locale/messages.pt-BR.xlf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file source-language="en" datatype="plaintext" original="ng2.template">
4+
<body>
5+
<trans-unit id="5591821559397741895" datatype="html">
6+
<source><x id="START_ITALIC_TEXT" ctype="x-i" equiv-text="&lt;i class=&quot;ph ph-arrow-up-right mr-2&quot;&gt;"/><x id="CLOSE_ITALIC_TEXT" ctype="x-i" equiv-text="&lt;/i&gt;"/> Read the full article </source>
7+
<target><x id="START_ITALIC_TEXT" ctype="x-i" equiv-text="&lt;i class=&quot;ph ph-arrow-up-right mr-2&quot;&gt;"/><x id="CLOSE_ITALIC_TEXT" ctype="x-i" equiv-text="&lt;/i&gt;"/> Leia o artigo completo </target>
8+
<context-group purpose="location">
9+
<context context-type="sourcefile">src/app/component/blog/blog.html</context>
10+
<context context-type="linenumber">32,34</context>
11+
</context-group>
12+
</trans-unit>
13+
<trans-unit id="4579298714588691402" datatype="html">
14+
<source> Crafting exceptional mobile and desktop applications that work everywhere with <x id="START_TAG_SPAN" ctype="x-span" equiv-text="&lt;span class=&quot;brand-gradient-text&quot;&gt;"/>stunning design<x id="CLOSE_TAG_SPAN" ctype="x-span" equiv-text="&lt;/span&gt;"/></source>
15+
<context-group purpose="location">
16+
<context context-type="sourcefile">src/app/component/hero/hero.html</context>
17+
<context context-type="linenumber">13,16</context>
18+
</context-group>
19+
</trans-unit>
20+
</body>
21+
</file>
22+
</xliff>

src/locale/messages.xlf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file source-language="en" datatype="plaintext" original="ng2.template">
4+
<body>
5+
<trans-unit id="5591821559397741895" datatype="html">
6+
<source><x id="START_ITALIC_TEXT" ctype="x-i" equiv-text="&lt;i class=&quot;ph ph-arrow-up-right mr-2&quot;&gt;"/><x id="CLOSE_ITALIC_TEXT" ctype="x-i" equiv-text="&lt;/i&gt;"/> Read the full article </source>
7+
<context-group purpose="location">
8+
<context context-type="sourcefile">src/app/component/blog/blog.html</context>
9+
<context context-type="linenumber">32,34</context>
10+
</context-group>
11+
</trans-unit>
12+
<trans-unit id="4579298714588691402" datatype="html">
13+
<source> Crafting exceptional mobile and desktop applications that work everywhere with <x id="START_TAG_SPAN" ctype="x-span" equiv-text="&lt;span class=&quot;brand-gradient-text&quot;&gt;"/>stunning design<x id="CLOSE_TAG_SPAN" ctype="x-span" equiv-text="&lt;/span&gt;"/></source>
14+
<context-group purpose="location">
15+
<context context-type="sourcefile">src/app/component/hero/hero.html</context>
16+
<context context-type="linenumber">13,16</context>
17+
</context-group>
18+
</trans-unit>
19+
</body>
20+
</file>
21+
</xliff>

0 commit comments

Comments
 (0)