Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change files to enable Portuguese support #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionic3-calendar-en",
"version": "1.1.3",
"version": "1.1.4",
"description": "An event calendar component for the Ionic hybrid mobile development platform",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/calendar/calendar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export class Calendar {
if (!this.lang) { this.lang = 'en'; }
if (this.lang === 'es') {
this.weekHead = ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'];
} else if (this.lang === 'pt') {
this.weekHead = ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab']
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/calendar/pipes/month-name.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/calendar/pipes/month-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ import {Pipe} from '@angular/core';
export class monthName {
private lang: string; // (es or en)
transform(value, args) {
if (args === 'es') { this.lang = 'es'; }
if (args === 'es') {
this.lang = 'es';
} else if (args === 'pt') {
this.lang = 'pt';
}
let monthNames = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ];
if (this.lang === 'es') {
monthNames = [ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ];
} else if (this.lang === 'pt') {
monthNames = [ 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ];
}
return monthNames[value - 1];
}
Expand Down