[WIP] feat(i18n): integrate internationalization and russian language support#144
[WIP] feat(i18n): integrate internationalization and russian language support#144musienkoyuriy wants to merge 1 commit intoReactiveX:masterfrom
Conversation
Generated by 🚫 dangerJS |
d39ffa8 to
67f1b0c
Compare
|
thx @musienkoyuriy @omfgnuts for this! looking forward to discussing during our meet today. |
xlozinguez
left a comment
There was a problem hiding this comment.
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?
| <h2> {{ 'OPERATOR.ADDITIONAL_RESOURCES' | translate }} </h2> | ||
| <ul class="section-list"> | ||
| <li> | ||
| <a [href]="sourceUrl" target="_blank"> Source Code </a> |
| @@ -1,4 +1,4 @@ | |||
| <h2> Walkthrough </h2> | |||
| <h2> {{ 'OPERATOR.WALKTHROGH' | translate }} </h2> | |||
| @@ -38,7 +44,7 @@ export class OperatorComponent { | |||
| } | |||
There was a problem hiding this comment.
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> | |||
| } | ||
|
|
||
| export const languagesList: Lang[] = [ | ||
| { |
There was a problem hiding this comment.
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'; |
| styleUrls: ['./toolbar.component.scss'] | ||
| }) | ||
| export class ToolbarComponent implements OnInit { | ||
| languagesList: Array<Lang>; |
There was a problem hiding this comment.
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.
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 |
| type: string; | ||
| attribute: string; | ||
| description: string; | ||
| description: any; |
There was a problem hiding this comment.
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-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.
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