Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

[WIP] feat(i18n): integrate internationalization and russian language support #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

musienkoyuriy
Copy link

@musienkoyuriy musienkoyuriy commented Nov 9, 2017

Translation in progress

@musienkoyuriy musienkoyuriy changed the title feat(i18n): integrate internationalization and russian language support [WIP] feat(i18n): integrate internationalization and russian language support Nov 9, 2017
@rxjs-bot
Copy link

rxjs-bot commented Nov 9, 2017

Warnings
⚠️

❗ Big PR (1)

(1) : Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.

Generated by 🚫 dangerJS

@ladyleet
Copy link
Member

thx @musienkoyuriy @omfgnuts for this! looking forward to discussing during our meet today.

Copy link

@xlozinguez xlozinguez left a 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>

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>

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 {
}

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>

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[] = [
{

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';

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>;

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';

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.

@ladyleet
Copy link
Member

@omfgnuts ^^

@omfgnuts
Copy link

@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;
Copy link
Member

@niklas-wortmann niklas-wortmann Dec 29, 2017

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>
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants