-
Notifications
You must be signed in to change notification settings - Fork 62
[WIP] feat(i18n): integrate internationalization and russian language support #144
base: master
Are you sure you want to change the base?
[WIP] feat(i18n): integrate internationalization and russian language support #144
Conversation
Generated by 🚫 dangerJS |
d39ffa8
to
67f1b0c
Compare
thx @musienkoyuriy @omfgnuts for this! looking forward to discussing during our meet today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, a few comments on forgotten translations mainly.
In order for this to be mergeable, we need to default to English translation if the operator translation doesn't exist for the preferred language.
Do you think you can implement this?
@@ -1,4 +1,4 @@ | |||
<h2> Additional Resources </h2> | |||
<h2> {{ 'OPERATOR.ADDITIONAL_RESOURCES' | translate }} </h2> | |||
<ul class="section-list"> | |||
<li> | |||
<a [href]="sourceUrl" target="_blank"> Source Code </a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need i18n on lines 4, 7 and 10
@@ -1,4 +1,4 @@ | |||
<h2> Walkthrough </h2> | |||
<h2> {{ 'OPERATOR.WALKTHROGH' | translate }} </h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: type OPERATOR.WALKTHROUGH
@@ -38,7 +44,7 @@ export class OperatorComponent { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n needed for shortDescription
on l.39 and shortDescriptionExtras
on l.42
@@ -18,6 +17,7 @@ <h3 mat-subheader class="category-subheader">{{ category }}</h3> | |||
</mat-sidenav> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n for category
needed on l.10
} | ||
|
||
export const languagesList: Lang[] = [ | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this might be easier to import from a separate file in order to avoid mixing data and logic.
import { Component, OnInit, Output, EventEmitter } from "@angular/core"; | ||
import { Component, OnInit, Output, EventEmitter } from '@angular/core'; | ||
import { LanguageService } from '../services/language.service'; | ||
import { Lang } from './../services/language.service'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can concatenate l.2 and l.3
}) | ||
export class ToolbarComponent implements OnInit { | ||
languagesList: Array<Lang>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use Lang[]
as you did previously for consistency?
@@ -1,55 +1,89 @@ | |||
import { OperatorDoc } from '../operator.model'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file will need the missing translations.
@omfgnuts ^^ |
@ladyleet Just letting you know that I'm still working on translations as my background task. atm I have ~13 translated (1st iteration) operators, so once we need em, I'll try to brush them up |
@@ -22,11 +23,11 @@ export interface OperatorParameters { | |||
name: string; | |||
type: string; | |||
attribute: string; | |||
description: string; | |||
description: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it makes sense to replace any with a complex object which holds a property for each supported language. This would make it really easy to see which languages are supported and maybe missing for future PRs.
<div | ||
class="code-example" | ||
*ngFor="let example of operatorExamples" | ||
appHighlightJs> | ||
<div class="code-block mat-elevation-z2"> | ||
<div class="example-header"> | ||
<div class="header-title" [innerHTML]="example.name"></div> | ||
<div class="header-title" [innerHTML]="example.name[currentLang]"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to write a pipe for this behaviour. To get the element at currentLang will be pretty repetiv.
Translation in progress