import { MainStateManager } from '../MainStateManager';

export type ILanguageName =
  | 'blank'
  | 'Persian'
  | 'English'
  | 'Arabic'
  | 'France'
  | 'Spanish';
export interface ILanguage {
  id: number;
  name: number;
  rightToLeft: boolean;
}
export class Language {
  public id: number = 0;
  public isRightToLeft: boolean = false;
  public name: ILanguageName = 'blank';
  public caption: string = '';
  public shortCaption: string = '';
  public flag: string = '';

  constructor(
    mainStateManager: MainStateManager,
    id: number,
    name: number,
    rightToLeft: boolean
  ) {
    if (name === 1) {
      this.id = id;
      this.isRightToLeft = rightToLeft;
      this.name = 'English';
      this.caption = 'English';
      this.shortCaption = 'EN';
      this.flag = './images/flag/AM40.png';
    } else if (name === 2) {
      this.id = id;
      this.isRightToLeft = rightToLeft;
      this.name = 'Arabic';
      this.caption = 'العربی';
      this.shortCaption = 'عر';
      this.flag = './images/flag/AR40.png';
    } else if (name === 3) {
      this.id = id;
      this.isRightToLeft = rightToLeft;
      this.name = 'France';
      this.caption = 'France';
      this.shortCaption = 'FR';
      this.flag = './images/flag/FR40.png';
    } else if (name === 4) {
      this.id = id;
      this.isRightToLeft = rightToLeft;
      this.name = 'Spanish';
      this.caption = 'Spanish';
      this.shortCaption = 'SP';
      this.flag = './images/flag/SP40.png';
    } else {
      this.id = id;
      this.isRightToLeft = rightToLeft;
      this.name = 'Persian';
      this.caption = 'فارسی';
      this.shortCaption = 'فا';
      this.flag = './images/flag/IR40.png';
    }
  }
}