-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb22a56
commit 58bf87d
Showing
12 changed files
with
171 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
apps/transloco-playground/src/app/home/home.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<h6 class="mb-6"></h6> | ||
|
||
<div class="text-center mb-4"> | ||
<h1>Welcome to the Transloco Playground</h1> | ||
<a href="https://jsverse.gitbook.io/transloco/" class="btn btn-primary" | ||
>📖 Read the docs</a | ||
> | ||
</div> | ||
|
||
<div class="flex justify-around"> | ||
<div class="info-container"> | ||
<h4>🎉 Explore Transloco's Capabilities!</h4> | ||
<p> | ||
This playground serves as a showcase of Transloco's powerful features and | ||
flexibility. Dive into real-world examples and see how it can elevate your | ||
localization workflows. | ||
</p> | ||
</div> | ||
|
||
<div class="info-container"> | ||
<h4>📚 Looking for More?</h4> | ||
<p> | ||
For detailed guides, advanced topics, and setup instructions, head over to | ||
the | ||
<a href="https://jsverse.gitbook.io/transloco/" | ||
>official Transloco documentation</a | ||
>. | ||
</p> | ||
</div> | ||
|
||
<div class="info-container"> | ||
<h4>🤿 Dive into the implementation</h4> | ||
<p> | ||
You can find the source code for this app in the | ||
<a | ||
target="_blank" | ||
href="https://github.com/jsverse/transloco/tree/master/apps/transloco-playground" | ||
>transloco repo</a | ||
>. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div class="flex justify-around flex-wrap gap-2"> | ||
<div> | ||
<h3 class="mb-6">Structural Directive</h3> | ||
<ul class="list-group structural"> | ||
<ng-container *transloco="let t; currentLang as currentLang"> | ||
<li class="list-group-item" data-cy="regular"> | ||
<b>Regular: </b>{{ t('home') }} | ||
</li> | ||
<li class="list-group-item" data-cy="with-params"> | ||
<b>With params: </b>{{ t('alert', { value: dynamic }) }} | ||
</li> | ||
<li class="list-group-item" data-cy="with-translation-reuse"> | ||
<b>With translation reuse: </b> {{ t('a.b.c') }} | ||
</li> | ||
<ng-container *transloco="let staticT; lang: 'en|static'"> | ||
<li class="list-group-item" data-cy="static-lang-en"> | ||
<b>Static lang 'en': </b> {{ staticT('home') }} | ||
</li> | ||
</ng-container> | ||
<li class="list-group-item" data-cy="current-lang"> | ||
<b>Current Lang: </b>{{ currentLang }} | ||
</li> | ||
</ng-container> | ||
</ul> | ||
</div> | ||
<div> | ||
<h3 class="my-6">Directive</h3> | ||
<ul class="list-group"> | ||
<li class="list-group-item" data-cy="d-regular"> | ||
<b>Regular: </b><span transloco="home"></span> | ||
</li> | ||
<li | ||
class="list-group-item" | ||
(click)="changeParam()" | ||
data-cy="d-with-params" | ||
> | ||
<b>(click) With params: </b | ||
><span transloco="alert" [translocoParams]="{ value: dynamic }"></span> | ||
</li> | ||
<li class="list-group-item" data-cy="d-with-translation-reuse"> | ||
<b>With translation reuse: </b> <span transloco="a.b.c"></span> | ||
</li> | ||
<li class="list-group-item" (click)="changeKey()" data-cy="d-dynamic-key"> | ||
(click) <b>Dynamic key: </b> <span [transloco]="key"></span> | ||
</li> | ||
<li class="list-group-item" data-cy="d-static-lang-es"> | ||
<b>Static lang 'es': </b | ||
><span transloco="home" translocoLang="es|static"></span> | ||
</li> | ||
</ul> | ||
</div> | ||
<div> | ||
<h3 class="my-6">Pipe</h3> | ||
<ul class="list-group pipe"> | ||
<li class="list-group-item" data-cy="p-regular"> | ||
<b>Regular: </b>{{ 'home' | transloco }} | ||
</li> | ||
<li class="list-group-item" data-cy="p-with-params"> | ||
<b>With params: </b>{{ 'alert' | transloco: { value: dynamic } }} | ||
</li> | ||
<li class="list-group-item" data-cy="p-with-translation-reuse"> | ||
<b>With translation reuse: </b> {{ 'a.b.c' | transloco }} | ||
</li> | ||
<li class="list-group-item" data-cy="p-static-lang-en"> | ||
<b>Static lang 'en': </b>{{ 'home' | transloco: {} : 'en|static' }} | ||
</li> | ||
</ul> | ||
</div> | ||
<div> | ||
<h3 class="my-6">Translation in {{ '@for' }}</h3> | ||
<ul class="list-group"> | ||
@for (key of translateList; track key) { | ||
<li class="list-group-item" data-cy="translation-loop"> | ||
{{ key | transloco }} | ||
</li> | ||
} | ||
</ul> | ||
</div> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
apps/transloco-playground/src/app/home/home.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.info-container { | ||
flex-basis: 28%; | ||
} | ||
|
||
.justify-around { | ||
justify-content: space-around; | ||
} | ||
|
||
.flex-wrap { | ||
flex-wrap: wrap; | ||
} | ||
|
||
.mb-4 { | ||
margin-bottom: 16px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 0 additions & 79 deletions
79
apps/transloco-playground/src/app/on-push/on-push.component.html
This file was deleted.
Oops, something went wrong.
Empty file.
Oops, something went wrong.