Skip to content

Commit

Permalink
implementation new languages spain, russian, chinese and french
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasferreiralimax committed Jun 14, 2024
1 parent 8878738 commit f3e0f27
Show file tree
Hide file tree
Showing 11 changed files with 478 additions and 36 deletions.
66 changes: 55 additions & 11 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@
"sourceRoot": "src",
"prefix": "app",
"i18n": {
"sourceLocale": "pt",
"sourceLocale": "pt-BR",
"locales": {
"en": {
"translation": "src/locale/messages.en.xlf"
"en-US": {
"translation": "src/locale/messages.en-US.xlf"
},
"es-ES": {
"translation": "src/locale/messages.es-ES.xlf"
},
"ru-RU": {
"translation": "src/locale/messages.ru-RU.xlf"
},
"zh-CN": {
"translation": "src/locale/messages.zh-CN.xlf"
},
"fr-FR": {
"translation": "src/locale/messages.fr-FR.xlf"
}
}
},
Expand Down Expand Up @@ -70,14 +82,34 @@
],
"outputHashing": "all"
},
"pt": {
"pt-BR": {
"localize": [
"pt-BR"
]
},
"en-US": {
"localize": [
"en-US"
]
},
"es-ES": {
"localize": [
"pt"
"es-ES"
]
},
"en": {
"ru-RU": {
"localize": [
"en"
"ru-RU"
]
},
"zh-CN": {
"localize": [
"zh-CN"
]
},
"fr-FR": {
"localize": [
"fr-FR"
]
},
"development": {
Expand All @@ -97,11 +129,23 @@
"production": {
"buildTarget": "slidecontent-angular:build:production"
},
"pt": {
"buildTarget": "slidecontent-angular:build:development,pt"
"pt-BR": {
"buildTarget": "slidecontent-angular:build:development,pt-BR"
},
"en-US": {
"buildTarget": "slidecontent-angular:build:development,en-US"
},
"es-ES": {
"buildTarget": "slidecontent-angular:build:development,es-ES"
},
"ru-RU": {
"buildTarget": "slidecontent-angular:build:development,ru-RU"
},
"zh-CN": {
"buildTarget": "slidecontent-angular:build:development,zh-CN"
},
"en": {
"buildTarget": "slidecontent-angular:build:development,en"
"fr-FR": {
"buildTarget": "slidecontent-angular:build:development,fr-FR"
},
"development": {
"buildTarget": "slidecontent-angular:build:development"
Expand Down
26 changes: 21 additions & 5 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,34 @@
],
"rewrites": [
{
"source": "/en/**",
"destination": "/en/index.html"
"source": "/en-US/**",
"destination": "/en-US/index.html"
},
{
"source": "/pt/**",
"destination": "/pt/index.html"
"source": "/pt-BR/**",
"destination": "/pt-BR/index.html"
},
{
"source": "/es-ES/**",
"destination": "/es-ES/index.html"
},
{
"source": "/ru-RU/**",
"destination": "/ru-RU/index.html"
},
{
"source": "/zh-CN/**",
"destination": "/zh-CN/index.html"
},
{
"source": "/fr-FR/**",
"destination": "/fr-FR/index.html"
}
],
"redirects": [
{
"source": "/",
"destination": "/en",
"destination": "/pt-BR",
"type": 301
}
]
Expand Down
16 changes: 4 additions & 12 deletions src/app/components/base/app-language/app-language.component.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<section class="language">
<button (click)="changeLanguage('en')">English</button>
<button (click)="changeLanguage('pt')">Português</button>
<a href="/en/">
English
</a>
<a href="/pt/">
Português
</a>
<!-- @for (language of languages; track language) {
<button>
@for (language of languages; track language) {
<a href="/{{language}}/" (click)="changeLanguage(language)">
<img [src]="getImageUrl(language)" [alt]="language" />
{{language}}
</button>
} -->
</a>
}
</section>
26 changes: 26 additions & 0 deletions src/app/components/base/app-language/app-language.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.language {
a {
flex: 1;
margin: 0.5rem;
cursor: pointer;
border: 0;
background: #eee;
padding: 0.5rem;
border-radius: 5px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 1), 0 2px 5px rgba(0, 0, 0, 0.2);
font-size: 0;
text-decoration: none;
font-size: 0;
display: inline-flex;

&.actived {
color: #fff;
background: #2c3e50;
}
}

img {
width: 20px;
pointer-events: none;
}
}
12 changes: 6 additions & 6 deletions src/app/views/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ <h2 class="slide-title">
<span i18n="@@slide_infinity">Slide infinito</span>
</h2>
<app-slide-content name="Exemplo 1" type="infinite" [nav]="true" [animation]="{ 'disabled': true }">
<app-slide-item class="favela" [actived]="true" i18n-title="@@god_faith" img="/assets/faveladascriancas.jpg"
<app-slide-item class="favela" [actived]="true" i18n-title="@@god_faith" img="assets/faveladascriancas.jpg"
url="https://github.com/lucasferreiralimax/slidecontent-angular" target="_blank"></app-slide-item>
<app-slide-item i18n-title="@@city" img="/assets/ermelino.jpg"
<app-slide-item i18n-title="@@city" img="assets/ermelino.jpg"
url="https://github.com/lucasferreiralimax/slidecontent-angular" target="_blank"></app-slide-item>
</app-slide-content>
</div>
Expand All @@ -28,9 +28,9 @@ <h2 class="slide-title">
<span i18n="@@slide_no_navigation">Slide sem navegação</span>
</h2>
<app-slide-content name="Exemplo 2" [nav]="false">
<app-slide-item class="favela" i18n-title="@@god_faith" img="/assets/faveladascriancas.jpg"
<app-slide-item class="favela" i18n-title="@@god_faith" img="assets/faveladascriancas.jpg"
url="https://github.com/lucasferreiralimax/slidecontent-angular" target="_blank"></app-slide-item>
<app-slide-item [actived]="true" i18n-title="@@city" img="/assets/ermelino.jpg"
<app-slide-item [actived]="true" i18n-title="@@city" img="assets/ermelino.jpg"
url="https://github.com/lucasferreiralimax/slidecontent-angular" target="_blank"></app-slide-item>
</app-slide-content>
</div>
Expand All @@ -43,9 +43,9 @@ <h2 class="slide-title">
<span i18n="@@slide_fix_time">Slide com duração de 10 segundos</span>
</h2>
<app-slide-content name="Exemplo 3" type="simple" [nav]="true" [animation]="{ direction: 'prev', time: 10000 }">
<app-slide-item class="favela" i18n-title="@@god_faith" img="/assets/faveladascriancas.jpg"
<app-slide-item class="favela" i18n-title="@@god_faith" img="assets/faveladascriancas.jpg"
url="https://github.com/lucasferreiralimax/slidecontent-angular" target="_blank"></app-slide-item>
<app-slide-item [actived]="true" i18n-title="@@city" img="/assets/ermelino.jpg"
<app-slide-item [actived]="true" i18n-title="@@city" img="assets/ermelino.jpg"
url="https://github.com/lucasferreiralimax/slidecontent-angular" target="_blank"></app-slide-item>
</app-slide-content>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="ng2.template" target-language="en">
<file source-language="pt-BR" datatype="plaintext" original="ng2.template" target-language="en-US">
<body>
<trans-unit id="title" datatype="html">
<source>SlideContentAngular</source>
Expand Down
91 changes: 91 additions & 0 deletions src/locale/messages.es-ES.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="pt-BR" datatype="plaintext" original="ng2.template" target-language="es-ES">
<body>
<trans-unit id="title" datatype="html">
<source>SlideContentAngular</source>
<target>SlideContentAngular</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/base/app-footer/app-footer.component.html</context>
<context context-type="linenumber">7</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/base/app-header/app-header.component.html</context>
<context context-type="linenumber">3</context>
</context-group>
</trans-unit>
<trans-unit id="nav.home" datatype="html">
<source>Início</source>
<target>Inicio</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/base/app-navigation/app-navigation.component.html</context>
<context context-type="linenumber">6</context>
</context-group>
</trans-unit>
<trans-unit id="nav.about" datatype="html">
<source>Informações</source>
<target>Información</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/base/app-navigation/app-navigation.component.html</context>
<context context-type="linenumber">18</context>
</context-group>
</trans-unit>
<trans-unit id="version" datatype="html">
<source>Versão <x id="INTERPOLATION" equiv-text="{{ appVersion }}"/></source>
<target>Versión <x id="INTERPOLATION" equiv-text="{{ appVersion }}"/></target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/base/app-version/app-version.component.html</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="to_left" datatype="html">
<source>Ir para a esquerda</source>
<target>Ir a la izquierda</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/slide-content/slide-content.component.html</context>
<context context-type="linenumber">7</context>
</context-group>
</trans-unit>
<trans-unit id="to_right" datatype="html">
<source>Ir para a direita</source>
<target>Ir a la derecha</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/slide-content/slide-content.component.html</context>
<context context-type="linenumber">8</context>
</context-group>
</trans-unit>
<trans-unit id="about" datatype="html">
<source>Um slide de conteúdo simples desenvolvido em Angular com botões de navegação e um timer na animação de transição</source>
<target>Una diapositiva de contenido simple desarrollada en Angular con botones de navegación y un temporizador en la animación de transición</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/views/about/about.component.html</context>
<context context-type="linenumber">2</context>
</context-group>
</trans-unit>
<trans-unit id="slide_infinity" datatype="html">
<source>Slide infinito</source>
<target>Diapositiva infinita</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/views/home/home.component.html</context>
<context context-type="linenumber">11</context>
</context-group>
</trans-unit>
<trans-unit id="slide_no_navigation" datatype="html">
<source>Slide sem navegação</source>
<target>Diapositiva sin navegación</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/views/home/home.component.html</context>
<context context-type="linenumber">28</context>
</context-group>
</trans-unit>
<trans-unit id="slide_fix_time" datatype="html">
<source>Slide com duração de 10 segundos</source>
<target>Diapositiva con una duración de 10 segundos</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/views/home/home.component.html</context>
<context context-type="linenumber">43</context>
</context-group>
</trans-unit>
</body>
</file>
</xliff>
Loading

0 comments on commit f3e0f27

Please sign in to comment.