From 12992df3c27404ef12759fe087cc7417b77e6271 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Fri, 13 Jul 2018 13:10:55 +0200 Subject: [PATCH] MOBILE-2493 ionic: Translate back button in iOS --- .../pages/issued-badge/issued-badge.html | 2 +- .../badges/pages/user-badges/user-badges.html | 2 +- src/addon/calendar/pages/event/event.html | 2 +- src/addon/calendar/pages/list/list.html | 2 +- .../calendar/pages/settings/settings.html | 2 +- .../pages/settings/settings.module.ts | 2 + .../pages/competencies/competencies.html | 2 +- .../pages/competencies/competencies.module.ts | 2 + .../pages/competency/competency.html | 2 +- .../competencysummary/competencysummary.html | 2 +- .../coursecompetencies.html | 2 +- .../coursecompetencies.module.ts | 2 + src/addon/competency/pages/plan/plan.html | 2 +- .../competency/pages/planlist/planlist.html | 2 +- .../pages/planlist/planlist.module.ts | 2 + .../coursecompletion/pages/report/report.html | 2 +- src/addon/files/pages/list/list.html | 2 +- .../airnotifier/pages/devices/devices.html | 2 +- .../pages/devices/devices.module.ts | 2 + .../messages/pages/discussion/discussion.html | 2 +- src/addon/messages/pages/index/index.html | 2 +- .../messages/pages/index/index.module.ts | 2 + .../messages/pages/settings/settings.html | 2 +- .../edit-feedback-modal.html | 2 +- src/addon/mod/assign/pages/edit/edit.html | 2 +- src/addon/mod/assign/pages/index/index.html | 2 +- .../submission-list/submission-list.html | 2 +- .../submission-review/submission-review.html | 2 +- src/addon/mod/book/pages/index/index.html | 2 +- src/addon/mod/chat/pages/chat/chat.html | 2 +- src/addon/mod/chat/pages/index/index.html | 2 +- src/addon/mod/chat/pages/users/users.html | 2 +- src/addon/mod/choice/pages/index/index.html | 2 +- src/addon/mod/data/pages/edit/edit.html | 2 +- src/addon/mod/data/pages/entry/entry.html | 2 +- src/addon/mod/data/pages/index/index.html | 2 +- src/addon/mod/data/pages/search/search.html | 2 +- .../mod/feedback/pages/attempt/attempt.html | 2 +- src/addon/mod/feedback/pages/form/form.html | 2 +- src/addon/mod/feedback/pages/index/index.html | 2 +- .../pages/nonrespondents/nonrespondents.html | 2 +- .../pages/respondents/respondents.html | 2 +- src/addon/mod/folder/pages/index/index.html | 2 +- .../forum/pages/discussion/discussion.html | 2 +- src/addon/mod/forum/pages/index/index.html | 2 +- .../pages/new-discussion/new-discussion.html | 2 +- src/addon/mod/glossary/pages/edit/edit.html | 2 +- src/addon/mod/glossary/pages/entry/entry.html | 2 +- src/addon/mod/glossary/pages/index/index.html | 2 +- src/addon/mod/imscp/pages/index/index.html | 2 +- src/addon/mod/lesson/pages/index/index.html | 2 +- .../lesson/pages/menu-modal/menu-modal.html | 2 +- .../pages/password-modal/password-modal.html | 2 +- src/addon/mod/lesson/pages/player/player.html | 2 +- .../lesson/pages/user-retake/user-retake.html | 2 +- src/addon/mod/lti/pages/index/index.html | 2 +- src/addon/mod/page/pages/index/index.html | 2 +- src/addon/mod/quiz/pages/attempt/attempt.html | 2 +- src/addon/mod/quiz/pages/index/index.html | 2 +- .../navigation-modal/navigation-modal.html | 2 +- .../navigation-modal.module.ts | 2 + src/addon/mod/quiz/pages/player/player.html | 2 +- .../preflight-modal/preflight-modal.html | 2 +- .../preflight-modal/preflight-modal.module.ts | 2 + src/addon/mod/quiz/pages/review/review.html | 2 +- src/addon/mod/resource/pages/index/index.html | 2 +- src/addon/mod/scorm/pages/index/index.html | 2 +- src/addon/mod/scorm/pages/player/player.html | 2 +- src/addon/mod/survey/pages/index/index.html | 2 +- src/addon/mod/url/pages/index/index.html | 2 +- src/addon/mod/wiki/pages/edit/edit.html | 2 +- src/addon/mod/wiki/pages/index/index.html | 2 +- .../workshop/pages/assessment/assessment.html | 2 +- .../edit-submission/edit-submission.html | 2 +- src/addon/mod/workshop/pages/index/index.html | 2 +- src/addon/mod/workshop/pages/phase/phase.html | 2 +- .../workshop/pages/submission/submission.html | 2 +- src/addon/notes/pages/add/add.html | 2 +- src/addon/notifications/pages/list/list.html | 2 +- .../pages/settings/settings.html | 2 +- .../recaptcha/core-recaptchamodal.html | 2 +- .../placeholder/core-placeholder.html | 2 +- src/core/comments/pages/viewer/viewer.html | 2 +- .../pages/choose-site/choose-site.html | 2 +- .../section-selector/section-selector.html | 2 +- src/core/course/pages/section/section.html | 2 +- .../unsupported-module.html | 2 +- .../available-courses/available-courses.html | 2 +- .../available-courses.module.ts | 2 + .../courses/pages/categories/categories.html | 2 +- .../pages/course-preview/course-preview.html | 2 +- .../courses/pages/my-courses/my-courses.html | 2 +- .../pages/my-courses/my-courses.module.ts | 2 + .../pages/my-overview/my-overview.html | 2 +- src/core/courses/pages/search/search.html | 2 +- .../courses/pages/search/search.module.ts | 2 + .../self-enrol-password.html | 2 +- .../pages/capture-media/capture-media.html | 2 +- .../capture-media/capture-media.module.ts | 2 + src/core/grades/pages/course/course.html | 2 +- src/core/grades/pages/course/course.module.ts | 2 + src/core/grades/pages/courses/courses.html | 2 +- .../grades/pages/coursesplit/coursesplit.html | 2 +- .../pages/coursesplit/coursesplit.module.ts | 2 + src/core/grades/pages/grade/grade.html | 2 +- .../login/pages/credentials/credentials.html | 2 +- .../pages/email-signup/email-signup.html | 2 +- .../forgotten-password.html | 2 +- src/core/login/pages/reconnect/reconnect.html | 2 +- .../login/pages/site-error/site-error.html | 2 +- src/core/login/pages/site-help/site-help.html | 2 +- .../login/pages/site-policy/site-policy.html | 2 +- src/core/login/pages/site/site.html | 2 +- src/core/login/pages/sites/sites.html | 2 +- src/core/mainmenu/pages/more/more.html | 2 +- src/core/settings/pages/about/about.html | 2 +- src/core/settings/pages/general/general.html | 2 +- src/core/settings/pages/list/list.html | 2 +- .../pages/space-usage/space-usage.html | 2 +- .../synchronization/synchronization.html | 2 +- src/core/settings/settings.module.ts | 2 + .../pages/choose-site/choose-site.html | 2 +- src/core/sharedfiles/pages/list/list.html | 2 +- src/core/sitehome/pages/index/index.html | 2 +- src/core/sitehome/pages/index/index.module.ts | 2 + .../pages/module-index/module-index.html | 2 +- .../pages/module-index/module-index.module.ts | 2 + .../pages/plugin-page/plugin-page.html | 2 +- .../pages/plugin-page/plugin-page.module.ts | 2 + src/core/user/pages/about/about.html | 2 +- .../user/pages/participants/participants.html | 2 +- .../pages/participants/participants.module.ts | 2 + src/core/user/pages/profile/profile.html | 2 +- src/core/viewer/pages/iframe/iframe.html | 2 +- src/core/viewer/pages/iframe/iframe.module.ts | 2 + src/core/viewer/pages/image/image.html | 2 +- src/core/viewer/pages/text/text.html | 2 +- src/directives/back-button.ts | 63 +++++++++++++++++++ src/directives/directives.module.ts | 7 ++- 139 files changed, 225 insertions(+), 119 deletions(-) create mode 100644 src/directives/back-button.ts diff --git a/src/addon/badges/pages/issued-badge/issued-badge.html b/src/addon/badges/pages/issued-badge/issued-badge.html index 9d9f5dc2c..73746a741 100644 --- a/src/addon/badges/pages/issued-badge/issued-badge.html +++ b/src/addon/badges/pages/issued-badge/issued-badge.html @@ -1,5 +1,5 @@ - + {{badge.name}} diff --git a/src/addon/badges/pages/user-badges/user-badges.html b/src/addon/badges/pages/user-badges/user-badges.html index 9768f7901..5bcdc3e32 100644 --- a/src/addon/badges/pages/user-badges/user-badges.html +++ b/src/addon/badges/pages/user-badges/user-badges.html @@ -1,5 +1,5 @@ - + {{ 'addon.badges.badges' | translate }} diff --git a/src/addon/calendar/pages/event/event.html b/src/addon/calendar/pages/event/event.html index dfa30e593..8f68f8c46 100644 --- a/src/addon/calendar/pages/event/event.html +++ b/src/addon/calendar/pages/event/event.html @@ -1,5 +1,5 @@ - + diff --git a/src/addon/calendar/pages/list/list.html b/src/addon/calendar/pages/list/list.html index 04e0d3e8a..5b8dfd808 100644 --- a/src/addon/calendar/pages/list/list.html +++ b/src/addon/calendar/pages/list/list.html @@ -1,5 +1,5 @@ - + {{ 'addon.calendar.calendarevents' | translate }} diff --git a/src/addon/mod/glossary/pages/entry/entry.html b/src/addon/mod/glossary/pages/entry/entry.html index 117741895..65d021f8e 100644 --- a/src/addon/mod/glossary/pages/entry/entry.html +++ b/src/addon/mod/glossary/pages/entry/entry.html @@ -1,5 +1,5 @@ - + diff --git a/src/addon/mod/glossary/pages/index/index.html b/src/addon/mod/glossary/pages/index/index.html index 02c599875..f33735512 100644 --- a/src/addon/mod/glossary/pages/index/index.html +++ b/src/addon/mod/glossary/pages/index/index.html @@ -1,5 +1,5 @@ - + diff --git a/src/addon/mod/imscp/pages/index/index.html b/src/addon/mod/imscp/pages/index/index.html index d45932fcf..8d8662c3d 100644 --- a/src/addon/mod/imscp/pages/index/index.html +++ b/src/addon/mod/imscp/pages/index/index.html @@ -1,5 +1,5 @@ - + diff --git a/src/addon/mod/lesson/pages/index/index.html b/src/addon/mod/lesson/pages/index/index.html index 80022b30e..e09f2c477 100644 --- a/src/addon/mod/lesson/pages/index/index.html +++ b/src/addon/mod/lesson/pages/index/index.html @@ -1,5 +1,5 @@ - + diff --git a/src/addon/mod/lesson/pages/menu-modal/menu-modal.html b/src/addon/mod/lesson/pages/menu-modal/menu-modal.html index 1bb5c72ed..068490b8d 100644 --- a/src/addon/mod/lesson/pages/menu-modal/menu-modal.html +++ b/src/addon/mod/lesson/pages/menu-modal/menu-modal.html @@ -1,5 +1,5 @@ - + {{ pageInstance.lesson.name }} diff --git a/src/core/emulator/pages/capture-media/capture-media.module.ts b/src/core/emulator/pages/capture-media/capture-media.module.ts index c849d91f4..aea07d2a5 100644 --- a/src/core/emulator/pages/capture-media/capture-media.module.ts +++ b/src/core/emulator/pages/capture-media/capture-media.module.ts @@ -17,6 +17,7 @@ import { IonicPageModule } from 'ionic-angular'; import { CoreEmulatorCaptureMediaPage } from './capture-media'; import { TranslateModule } from '@ngx-translate/core'; import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives/directives.module'; @NgModule({ declarations: [ @@ -24,6 +25,7 @@ import { CoreComponentsModule } from '@components/components.module'; ], imports: [ CoreComponentsModule, + CoreDirectivesModule, IonicPageModule.forChild(CoreEmulatorCaptureMediaPage), TranslateModule.forChild() ] diff --git a/src/core/grades/pages/course/course.html b/src/core/grades/pages/course/course.html index 73a7ecdc2..5dbeb4f6c 100644 --- a/src/core/grades/pages/course/course.html +++ b/src/core/grades/pages/course/course.html @@ -1,5 +1,5 @@ - + {{ 'core.grades.grades' | translate }} diff --git a/src/core/grades/pages/course/course.module.ts b/src/core/grades/pages/course/course.module.ts index 903241e3b..629df2410 100644 --- a/src/core/grades/pages/course/course.module.ts +++ b/src/core/grades/pages/course/course.module.ts @@ -15,6 +15,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; +import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreGradesCoursePage } from './course'; import { CoreGradesComponentsModule } from '../../components/components.module'; @@ -23,6 +24,7 @@ import { CoreGradesComponentsModule } from '../../components/components.module'; CoreGradesCoursePage ], imports: [ + CoreDirectivesModule, CoreGradesComponentsModule, IonicPageModule.forChild(CoreGradesCoursePage), TranslateModule.forChild() diff --git a/src/core/grades/pages/courses/courses.html b/src/core/grades/pages/courses/courses.html index f3de49188..b4b021aa0 100644 --- a/src/core/grades/pages/courses/courses.html +++ b/src/core/grades/pages/courses/courses.html @@ -1,5 +1,5 @@ - + {{ 'core.grades.grades' | translate }} diff --git a/src/core/grades/pages/coursesplit/coursesplit.html b/src/core/grades/pages/coursesplit/coursesplit.html index de279c1f7..62c794b83 100644 --- a/src/core/grades/pages/coursesplit/coursesplit.html +++ b/src/core/grades/pages/coursesplit/coursesplit.html @@ -1,5 +1,5 @@ - + {{ 'core.grades.grades' | translate }} diff --git a/src/core/grades/pages/coursesplit/coursesplit.module.ts b/src/core/grades/pages/coursesplit/coursesplit.module.ts index 18775db1d..175aaf3d5 100644 --- a/src/core/grades/pages/coursesplit/coursesplit.module.ts +++ b/src/core/grades/pages/coursesplit/coursesplit.module.ts @@ -17,6 +17,7 @@ import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreGradesCourseSplitPage } from './coursesplit'; import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreGradesComponentsModule } from '../../components/components.module'; @NgModule({ @@ -26,6 +27,7 @@ import { CoreGradesComponentsModule } from '../../components/components.module'; imports: [ CoreGradesComponentsModule, CoreComponentsModule, + CoreDirectivesModule, IonicPageModule.forChild(CoreGradesCourseSplitPage), TranslateModule.forChild() ], diff --git a/src/core/grades/pages/grade/grade.html b/src/core/grades/pages/grade/grade.html index dd9d671a1..054450669 100644 --- a/src/core/grades/pages/grade/grade.html +++ b/src/core/grades/pages/grade/grade.html @@ -1,5 +1,5 @@ - + {{ 'core.grades.grade' | translate }} diff --git a/src/core/login/pages/credentials/credentials.html b/src/core/login/pages/credentials/credentials.html index 98e9582ac..d8e061f4c 100644 --- a/src/core/login/pages/credentials/credentials.html +++ b/src/core/login/pages/credentials/credentials.html @@ -1,5 +1,5 @@ - + {{ 'core.login.login' | translate }} diff --git a/src/core/login/pages/email-signup/email-signup.html b/src/core/login/pages/email-signup/email-signup.html index c958c3eeb..88d5a62a4 100644 --- a/src/core/login/pages/email-signup/email-signup.html +++ b/src/core/login/pages/email-signup/email-signup.html @@ -1,5 +1,5 @@ - + {{ 'core.login.newaccount' | translate }} diff --git a/src/core/login/pages/forgotten-password/forgotten-password.html b/src/core/login/pages/forgotten-password/forgotten-password.html index 23b78cc15..f78d6229e 100644 --- a/src/core/login/pages/forgotten-password/forgotten-password.html +++ b/src/core/login/pages/forgotten-password/forgotten-password.html @@ -1,5 +1,5 @@ - + {{ 'core.login.passwordforgotten' | translate }} diff --git a/src/core/login/pages/reconnect/reconnect.html b/src/core/login/pages/reconnect/reconnect.html index f80e1836c..5ede05a72 100644 --- a/src/core/login/pages/reconnect/reconnect.html +++ b/src/core/login/pages/reconnect/reconnect.html @@ -1,5 +1,5 @@ - + {{ 'core.login.reconnect' | translate }} diff --git a/src/core/login/pages/site-error/site-error.html b/src/core/login/pages/site-error/site-error.html index fef796622..110a93a72 100644 --- a/src/core/login/pages/site-error/site-error.html +++ b/src/core/login/pages/site-error/site-error.html @@ -1,5 +1,5 @@ - + {{ 'core.error' | translate }} diff --git a/src/core/login/pages/site-help/site-help.html b/src/core/login/pages/site-help/site-help.html index 9c9b4bdd4..2dc77ffc6 100644 --- a/src/core/login/pages/site-help/site-help.html +++ b/src/core/login/pages/site-help/site-help.html @@ -1,5 +1,5 @@ - + {{ 'core.login.help' | translate }} diff --git a/src/core/login/pages/site-policy/site-policy.html b/src/core/login/pages/site-policy/site-policy.html index 0b646391d..f905ece59 100644 --- a/src/core/login/pages/site-policy/site-policy.html +++ b/src/core/login/pages/site-policy/site-policy.html @@ -1,5 +1,5 @@ - + {{ 'core.login.policyagreement' | translate }} diff --git a/src/core/login/pages/site/site.html b/src/core/login/pages/site/site.html index a07eebbbd..6632e4278 100644 --- a/src/core/login/pages/site/site.html +++ b/src/core/login/pages/site/site.html @@ -1,5 +1,5 @@ - + {{ 'core.login.connecttomoodle' | translate }} diff --git a/src/core/login/pages/sites/sites.html b/src/core/login/pages/sites/sites.html index bebed6b2c..5caca3ac3 100644 --- a/src/core/login/pages/sites/sites.html +++ b/src/core/login/pages/sites/sites.html @@ -1,5 +1,5 @@ - + {{ 'core.settings.sites' | translate }} diff --git a/src/core/mainmenu/pages/more/more.html b/src/core/mainmenu/pages/more/more.html index ab1b24eb6..b7b585c76 100644 --- a/src/core/mainmenu/pages/more/more.html +++ b/src/core/mainmenu/pages/more/more.html @@ -1,5 +1,5 @@ - + diff --git a/src/core/settings/pages/about/about.html b/src/core/settings/pages/about/about.html index c7dc40e2e..25127ea4f 100644 --- a/src/core/settings/pages/about/about.html +++ b/src/core/settings/pages/about/about.html @@ -1,5 +1,5 @@ - + {{ 'core.settings.about' | translate }} diff --git a/src/core/settings/pages/general/general.html b/src/core/settings/pages/general/general.html index d1be96153..dbfb02209 100644 --- a/src/core/settings/pages/general/general.html +++ b/src/core/settings/pages/general/general.html @@ -1,5 +1,5 @@ - + {{ 'core.settings.general' | translate }} diff --git a/src/core/settings/pages/list/list.html b/src/core/settings/pages/list/list.html index dc0a63ce8..4cdf4958f 100644 --- a/src/core/settings/pages/list/list.html +++ b/src/core/settings/pages/list/list.html @@ -1,5 +1,5 @@ - + {{ 'core.settings.settings' | translate}} diff --git a/src/core/settings/pages/space-usage/space-usage.html b/src/core/settings/pages/space-usage/space-usage.html index bf32f7e80..9ff095758 100644 --- a/src/core/settings/pages/space-usage/space-usage.html +++ b/src/core/settings/pages/space-usage/space-usage.html @@ -1,5 +1,5 @@ - + {{ 'core.settings.spaceusage' | translate }} diff --git a/src/core/settings/pages/synchronization/synchronization.html b/src/core/settings/pages/synchronization/synchronization.html index b3a5338f5..8bc615145 100644 --- a/src/core/settings/pages/synchronization/synchronization.html +++ b/src/core/settings/pages/synchronization/synchronization.html @@ -1,5 +1,5 @@ - + {{ 'core.settings.synchronization' | translate }} diff --git a/src/core/settings/settings.module.ts b/src/core/settings/settings.module.ts index e658b90f5..6098d4c91 100644 --- a/src/core/settings/settings.module.ts +++ b/src/core/settings/settings.module.ts @@ -13,6 +13,7 @@ // limitations under the License. import { NgModule } from '@angular/core'; +import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreSettingsDelegate } from './providers/delegate'; import { CoreSettingsHelper } from './providers/helper'; @@ -20,6 +21,7 @@ import { CoreSettingsHelper } from './providers/helper'; declarations: [ ], imports: [ + CoreDirectivesModule, ], providers: [ CoreSettingsDelegate, diff --git a/src/core/sharedfiles/pages/choose-site/choose-site.html b/src/core/sharedfiles/pages/choose-site/choose-site.html index cb275173d..eab31f622 100644 --- a/src/core/sharedfiles/pages/choose-site/choose-site.html +++ b/src/core/sharedfiles/pages/choose-site/choose-site.html @@ -1,5 +1,5 @@ - + {{ 'core.sharedfiles.sharedfiles' | translate }} diff --git a/src/core/sharedfiles/pages/list/list.html b/src/core/sharedfiles/pages/list/list.html index ee14a99a6..3da41008d 100644 --- a/src/core/sharedfiles/pages/list/list.html +++ b/src/core/sharedfiles/pages/list/list.html @@ -1,5 +1,5 @@ - + diff --git a/src/core/sitehome/pages/index/index.html b/src/core/sitehome/pages/index/index.html index 74eb41ec8..6e1e28c3f 100644 --- a/src/core/sitehome/pages/index/index.html +++ b/src/core/sitehome/pages/index/index.html @@ -1,5 +1,5 @@ - + {{ 'core.sitehome.sitehome' | translate }} diff --git a/src/core/sitehome/pages/index/index.module.ts b/src/core/sitehome/pages/index/index.module.ts index ce04e8590..c9fb97017 100644 --- a/src/core/sitehome/pages/index/index.module.ts +++ b/src/core/sitehome/pages/index/index.module.ts @@ -15,6 +15,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; +import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreSiteHomeIndexPage } from './index'; import { CoreSiteHomeComponentsModule } from '../../components/components.module'; @@ -23,6 +24,7 @@ import { CoreSiteHomeComponentsModule } from '../../components/components.module CoreSiteHomeIndexPage, ], imports: [ + CoreDirectivesModule, CoreSiteHomeComponentsModule, IonicPageModule.forChild(CoreSiteHomeIndexPage), TranslateModule.forChild() diff --git a/src/core/siteplugins/pages/module-index/module-index.html b/src/core/siteplugins/pages/module-index/module-index.html index cf7a5dfad..99b109494 100644 --- a/src/core/siteplugins/pages/module-index/module-index.html +++ b/src/core/siteplugins/pages/module-index/module-index.html @@ -1,5 +1,5 @@ - + {{ title }} diff --git a/src/core/siteplugins/pages/module-index/module-index.module.ts b/src/core/siteplugins/pages/module-index/module-index.module.ts index cd9e5a003..0f5f72666 100644 --- a/src/core/siteplugins/pages/module-index/module-index.module.ts +++ b/src/core/siteplugins/pages/module-index/module-index.module.ts @@ -15,6 +15,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; +import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreSitePluginsModuleIndexPage } from './module-index'; import { CoreSitePluginsComponentsModule } from '../../components/components.module'; @@ -26,6 +27,7 @@ import { CoreSitePluginsComponentsModule } from '../../components/components.mod CoreSitePluginsModuleIndexPage ], imports: [ + CoreDirectivesModule, CoreSitePluginsComponentsModule, IonicPageModule.forChild(CoreSitePluginsModuleIndexPage), TranslateModule.forChild() diff --git a/src/core/siteplugins/pages/plugin-page/plugin-page.html b/src/core/siteplugins/pages/plugin-page/plugin-page.html index 22c2ebe07..f93ce1351 100644 --- a/src/core/siteplugins/pages/plugin-page/plugin-page.html +++ b/src/core/siteplugins/pages/plugin-page/plugin-page.html @@ -1,5 +1,5 @@ - + {{ title | translate }} diff --git a/src/core/siteplugins/pages/plugin-page/plugin-page.module.ts b/src/core/siteplugins/pages/plugin-page/plugin-page.module.ts index 396df5702..a0637d5e6 100644 --- a/src/core/siteplugins/pages/plugin-page/plugin-page.module.ts +++ b/src/core/siteplugins/pages/plugin-page/plugin-page.module.ts @@ -15,6 +15,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; +import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreSitePluginsPluginPage } from './plugin-page'; import { CoreSitePluginsComponentsModule } from '../../components/components.module'; @@ -26,6 +27,7 @@ import { CoreSitePluginsComponentsModule } from '../../components/components.mod CoreSitePluginsPluginPage ], imports: [ + CoreDirectivesModule, CoreSitePluginsComponentsModule, IonicPageModule.forChild(CoreSitePluginsPluginPage), TranslateModule.forChild() diff --git a/src/core/user/pages/about/about.html b/src/core/user/pages/about/about.html index f56825db7..f5db37701 100644 --- a/src/core/user/pages/about/about.html +++ b/src/core/user/pages/about/about.html @@ -1,5 +1,5 @@ - + diff --git a/src/core/user/pages/participants/participants.html b/src/core/user/pages/participants/participants.html index ec0f41e69..f83aee482 100644 --- a/src/core/user/pages/participants/participants.html +++ b/src/core/user/pages/participants/participants.html @@ -1,5 +1,5 @@ - + {{ 'core.user.participants' | translate }} diff --git a/src/core/user/pages/participants/participants.module.ts b/src/core/user/pages/participants/participants.module.ts index 29089cd65..57d0d5e5d 100644 --- a/src/core/user/pages/participants/participants.module.ts +++ b/src/core/user/pages/participants/participants.module.ts @@ -16,6 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; import { CoreUserComponentsModule } from '../../components/components.module'; +import { CoreDirectivesModule } from '@directives/directives.module'; import { CoreUserParticipantsPage } from './participants'; @NgModule({ @@ -24,6 +25,7 @@ import { CoreUserParticipantsPage } from './participants'; ], imports: [ CoreUserComponentsModule, + CoreDirectivesModule, IonicPageModule.forChild(CoreUserParticipantsPage), TranslateModule.forChild() ], diff --git a/src/core/user/pages/profile/profile.html b/src/core/user/pages/profile/profile.html index 7d1d61a69..c601e97db 100644 --- a/src/core/user/pages/profile/profile.html +++ b/src/core/user/pages/profile/profile.html @@ -1,5 +1,5 @@ - + diff --git a/src/core/viewer/pages/iframe/iframe.html b/src/core/viewer/pages/iframe/iframe.html index e070ebb9d..52707ab5c 100644 --- a/src/core/viewer/pages/iframe/iframe.html +++ b/src/core/viewer/pages/iframe/iframe.html @@ -1,5 +1,5 @@ - + {{ title }} diff --git a/src/core/viewer/pages/iframe/iframe.module.ts b/src/core/viewer/pages/iframe/iframe.module.ts index d2dab2f6b..0430f4a0c 100644 --- a/src/core/viewer/pages/iframe/iframe.module.ts +++ b/src/core/viewer/pages/iframe/iframe.module.ts @@ -16,6 +16,7 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { CoreViewerIframePage } from './iframe'; import { CoreComponentsModule } from '@components/components.module'; +import { CoreDirectivesModule } from '@directives/directives.module'; @NgModule({ declarations: [ @@ -23,6 +24,7 @@ import { CoreComponentsModule } from '@components/components.module'; ], imports: [ CoreComponentsModule, + CoreDirectivesModule, IonicPageModule.forChild(CoreViewerIframePage) ] }) diff --git a/src/core/viewer/pages/image/image.html b/src/core/viewer/pages/image/image.html index 613033daa..7d400b9e5 100644 --- a/src/core/viewer/pages/image/image.html +++ b/src/core/viewer/pages/image/image.html @@ -1,5 +1,5 @@ - + {{ title }} diff --git a/src/core/viewer/pages/text/text.html b/src/core/viewer/pages/text/text.html index f2419198c..56fc902a9 100644 --- a/src/core/viewer/pages/text/text.html +++ b/src/core/viewer/pages/text/text.html @@ -1,5 +1,5 @@ - + {{ title }} diff --git a/src/directives/back-button.ts b/src/directives/back-button.ts new file mode 100644 index 000000000..100c2adfd --- /dev/null +++ b/src/directives/back-button.ts @@ -0,0 +1,63 @@ +// (C) Copyright 2015 Martin Dougiamas +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { Directive, OnInit, OnDestroy } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; +import { Navbar, Platform } from 'ionic-angular'; +import { CoreEventsProvider } from '@providers/events'; + +/** + * Directive to tramslate the back button of navigation bars in iOS. + * + * @description + * Usage: + * ... + */ +@Directive({ + selector: 'ion-navbar[core-back-button]' +}) +export class CoreBackButtonDirective implements OnInit, OnDestroy { + protected languageObserver: any; + + constructor(private host: Navbar, private platform: Platform, + private translate: TranslateService, private eventsProvider: CoreEventsProvider) {} + + /** + * Component being initialized. + */ + ngOnInit(): void { + this.setTranslatedBackButtonText(); + this.languageObserver = this.eventsProvider.on(CoreEventsProvider.LANGUAGE_CHANGED, () => { + this.setTranslatedBackButtonText(); + }); + } + + /** + * Component being destroyed. + */ + ngOnDestroy(): void { + if (this.languageObserver) { + this.languageObserver.off(); + } + } + + /** + * Set the trasnlated back button text in iOS. + */ + protected setTranslatedBackButtonText(): void { + if (this.host && this.platform.is('ios')) { + this.host.setBackButtonText(this.translate.instant('core.back')); + } + } +} diff --git a/src/directives/directives.module.ts b/src/directives/directives.module.ts index 8cf70bd62..28db74390 100644 --- a/src/directives/directives.module.ts +++ b/src/directives/directives.module.ts @@ -23,6 +23,7 @@ import { CoreUserLinkDirective } from './user-link'; import { CoreAutoRowsDirective } from './auto-rows'; import { CoreLongPressDirective } from './long-press'; import { CoreChartDirective } from './chart'; +import { CoreBackButtonDirective } from './back-button'; @NgModule({ declarations: [ @@ -35,7 +36,8 @@ import { CoreChartDirective } from './chart'; CoreUserLinkDirective, CoreAutoRowsDirective, CoreLongPressDirective, - CoreChartDirective + CoreChartDirective, + CoreBackButtonDirective ], imports: [], exports: [ @@ -48,7 +50,8 @@ import { CoreChartDirective } from './chart'; CoreUserLinkDirective, CoreAutoRowsDirective, CoreLongPressDirective, - CoreChartDirective + CoreChartDirective, + CoreBackButtonDirective ] }) export class CoreDirectivesModule {}