Skip to content

Instantly share code, notes, and snippets.

View kutanov's full-sized avatar

Roman Kutanov kutanov

View GitHub Profile
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/devel/cudnn8/Dockerfile
# FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.7.1/ubuntu2204/base/Dockerfile
FROM nvidia/cuda:11.7.1-base-ubuntu22.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip python-is-python3 libcairo2-dev pkg-config python3-dev && rm -rf /var/lib/apt/lists/*
RUN adduser --disabled-password --gecos '' user
RUN mkdir /content && chown -R user:user /content
@Component({
selector: 'app-comp',
templateUrl: './app-comp.component.html',
providers: [
{
provide: TRANSLOCO_LOADING_TEMPLATE,
useValue: '<p>Translation is loading...</p>'
}
]
})
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
import { getTranslocoModule } from './transloco-testing.module';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
getTranslocoModule(),
import { TranslocoMessageFormatModule } from '@ngneat/transloco-messageformat';
@NgModule({
imports: [
TranslocoMessageFormatModule.init()
]
})
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HttpClientModule } from '@angular/common/http';
import { TranslocoRootModule } from './transloco-root.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TranslocoLocaleModule } from '@ngneat/transloco-locale';
onChange(target) {
this.translocoService.setActiveLang(target);
}
<h5>{{ componentVariable }}</h5>
<h5>{{ componentVariableSecond }}</h5>
<label for="lang">Choose a language:</label>
<select (change)="onChange($event.target.value)" id="lang">
<option *ngFor='let l of languages' [value]="l.code">{{l.label | transloco }}</option>
</select>
{
"title": "English title",
"hello": "Welcome",
"containers": "ng-containers are useful when you don't want to have too many html layers",
"dashboard": {
"description": "You may use scopes for structuring translations"
}
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HomeComponent } from './home.component';
import { RouterModule } from '@angular/router';
import { TranslocoRootModule } from '../transloco-root.module';
import { TranslocoLocaleModule } from '@ngneat/transloco-locale';
@NgModule({
declarations: [
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HomeComponent } from './home.component';
import { RouterModule } from '@angular/router';
import { TranslocoRootModule } from '../transloco-root.module';
import { TranslocoLocaleModule } from '@ngneat/transloco-locale';
@NgModule({
declarations: [