Skip to content

Instantly share code, notes, and snippets.

View yigitfindikli's full-sized avatar
🍾
Why is the rum gone?

Yiğit FINDIKLI yigitfindikli

🍾
Why is the rum gone?
View GitHub Profile
@yigitfindikli
yigitfindikli / app.component.html
Created July 23, 2021 14:10
PrimeNG I18N API with ngx-translate
<div class="p-d-flex p-ai-center p-jc-between p-mt-3">
<div class="p-col-6">
<h2 class="p-ml-3">{{ 'demo.greetings' | translate }}</h2>
</div>
<div class="p-d-flex p-col-6 p-jc-end">
<div class="p-mr-3">
<p-radioButton (ngModelChange)="changeLang($event)" name="language" value="en" [(ngModel)]="lang"
inputId="en"></p-radioButton>
<label class="p-ml-1" for="en">{{ 'demo.en' | translate }}</label>
</div>
@yigitfindikli
yigitfindikli / app.component.ts
Created July 23, 2021 14:09
PrimeNG I18N API with ngx-translate
import { Component, OnDestroy } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { ConfirmationService, PrimeNGConfig } from 'primeng/api';
import { Subscription } from 'rxjs';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [ConfirmationService]
@yigitfindikli
yigitfindikli / fr.json
Created July 23, 2021 14:03
PrimeNG I18N API with ngx-translate
{
"demo": {
"greetings": "Bonjour!",
"en": "Anglaise",
"fr": "Français",
"date": "La datte",
"emptyMessage": "Message vide",
"message": "Êtes-vous sûr de vouloir continuer?",
"confirm": "Confirmer",
"name": "Nom"
@yigitfindikli
yigitfindikli / en.json
Created July 23, 2021 14:01
PrimeNG I18N API with ngx-translate
{
"demo": {
"greetings": "Hello!",
"en": "English",
"fr": "French",
"date": "Date",
"emptyMessage": "Empty Message",
"message": "Are you sure that you want to proceed?",
"confirm": "Confirm",
"name": "Name"
@yigitfindikli
yigitfindikli / data-object
Created July 23, 2021 11:59
PrimeNG I18N API with ngx-translate
{
"dayNamesMin": [
"Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa"
],
@yigitfindikli
yigitfindikli / app.component.ts
Created July 23, 2021 11:55
PrimeNG I18N API with ngx-translate
import { Component, OnDestroy } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { ConfirmationService, PrimeNGConfig } from 'primeng/api';
import { Subscription } from 'rxjs';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [ConfirmationService]
@yigitfindikli
yigitfindikli / app.component.html
Created July 23, 2021 11:49
PrimeNG I18N API with ngx-translate
<div class="p-d-flex p-ai-center p-jc-between p-mt-3">
<div class="p-col-6">
<h2 class="p-ml-3">{{ 'demo.greetings' | translate }}</h2>
</div>
<div class="p-d-flex p-col-6 p-jc-end">
<div class="p-mr-3">
<p-radioButton (ngModelChange)="changeLang($event)" name="language" value="en" [(ngModel)]="lang"
inputId="en"></p-radioButton>
<label class="p-ml-1" for="en">{{ 'demo.en' | translate }}</label>
</div>
@yigitfindikli
yigitfindikli / fr.json
Created July 22, 2021 17:49
PrimeNG I18N API with ngx-translate
{
"demo": {
"greetings": "Bonjour!",
"en": "Anglaise",
"fr": "Français",
"date": "La datte"
},
"primeng": {
"dayNamesMin": [
"Di",
@yigitfindikli
yigitfindikli / en.json
Created July 22, 2021 17:48
PrimeNG I18N API with ngx-translate
{
"demo": {
"greetings": "Hello!",
"en": "English",
"fr": "French",
"date": "Date"
},
"primeng": {
"dayNamesMin": [
"Su",
@yigitfindikli
yigitfindikli / app.component.ts
Created July 22, 2021 16:29
PrimeNG I18N API with ngx-translate Doc Example
constructor(private config: PrimeNGConfig) {}
ngOnInit() {
this.config.setTranslation({
accept: 'Accept',
reject: 'Cancel',
//translations
});
}