"use strict"; /***********************/ /* FILTRE : traduction */ /***********************/ /* OBJECTIF: traduire des éléments, tant des urls que du texte. UTILISATION: - Dans le template: 1. comme un filtre: {{ clé | customTranslate }} - Dans un controlleur: Même si les filtres sont d'abord prévus pour être utilisés dans le template, on peut les appeler dans les controlleurs. 1. Ajouter le service dans l'en-tête du controlleur 2. Appeler le service avec la fonction $filter EXEMPLE: controller:function($http, $filter){... var traduction = $filter('customTranslate')('cleTrad'); ...} CONFIGURATION: L'ajout de traduction se fait à travers des objets. La clé indique le terme à utiliser dans le template ou le controlleur pour ensuite renvoyer la traduction. Les noms associés n'appaaraissent donc pas tels quels. La structure de chaque élément traduit disponible est comme suit: clé1:{ fr: traductionFrançaise en: traductionAnglaise }, clé2:{ fr: traductionFrançaise en: traductionAnglaise } */ (function () { var custom_translate_module = angular.module('customTranslateFilter', []) .filter('customTranslate', ['$translate', function($translate){ return function(txt){ var trad = { costWarningScan:{ fr: "Service payant: les collaborateurs et les étudiants de l’EPFL peuvent bénéficier de ce service gratuitement, en utilisant le formulaire:", en: "Fee-based service: EPFL employees and students can benefit from this service free of charge by using the form:", de: "Kostenpflichtiger Service: Mitarbeitern und Studenten der EPFL steht dieser Dienst über das Fernleihe-Formular gratis zur Verfügung.", it: "Servizio a pagamento: I dipendenti e gli studenti dell'EPFL possono usufruire gratuitamente di questo servizio utilizzando il modulo:" }, costWarningScanEPFL:{ fr: "Service gratuit pour les collaborateurs et les étudiants EPFL.", en: "Free of charge for EPFL staff and students.", de: "Service für Mitarbeiter und Studenten der EPFL kostenlos", it: "Servizio gratuito per i dipendenti e gli studenti dell’EPFL." }, costWarningNetworkLoan:{ fr: "Service gratuit en cas de retrait à la Bibliothèque de l’EPFL.", en: "Free of charge if withdrawal at the EPFL Library.", de: "Service bei Abholung in der EPFL-Bibliothek kostenlos.", it: "Servizio gratuito in caso di ritiro alla Biblioteca dell’EPFL" }, costWarningPEB:{ fr: "Service gratuit pour les collaborateurs et les étudiants de l’EPFL. Avant de passer une commande d’un document physique via le prêt entre bibliothèques, merci de vous assurer que ce document n'est pas disponible dans d’autres bibliothèques du réseau SLSP dans swisscovery.", en: "Free of charge for EPFL staff and students. Before placing an order for a physical document via the interlibrary loan, please make sure that this document is not available in other SLSP network libraries on swisscovery.", de: "Kostenloser Service für Mitarbeiter und Studenten der EPFL. Bevor Sie ein Medium über die Fernleihe bestellen, vergewissern Sie sich bitte zunächst in swisscovery, dass es nicht in einer anderen Bibliothek des SLSP-Netzwerks verfügbar ist.", it: "Servizio gratuito per i dipendenti e gli studenti dell’EPFL. Prima di ordinare un documento cartaceo tramite il prestito interbibliotecario, assicuratevi che questo documento non sia disponibile in altre biblioteche della rete SLSP in swisscovery." }, mainTitle:{ fr: "Catalogue BEAST", en: "BEAST discovery tool", de: "BEAST Wissensportal", it: "Catalogo BEAST" }, subTitle:{ fr: "Le point d\'accès à toutes les ressources de la Bibliothèque de l\'EPFL", en: "The access portal to all the resources of the EPFL Library", de: "Der Zugangspunkt zu allen Ressourcen der EPFL Bibliothek", it: "Il punto d’accesso a tutte le risorse della Biblioteca dell’EPFL" }, switchEduID:{ fr: "Modifier vos informations personnelles sur", en: "Change your personal data on", de: "Ändern Sie Ihre persönlichen Daten auf", it: "Modifica i tuoi dati personali sul" }, illButton:{ fr: "Prêt entre bibliothèques (PEB)", en: "Inter Library Loan (ILL)", de: "Fernleihe", it: "Prestito interbibliotecario" }, feedbackLink:{ fr: "Signaler un problème d'accès", en: "Report an access problem", de: "Zugriffsproblem melden", it: "Segnalare un problema di accesso" }, vpnMSG:{ fr: "Les ressources électroniques sont accessibles depuis tous les postes de l’EPFL, et à distance via le VPN EPFL.", en: "Electronic resources are accessible from all EPFL workstations, and remotely via the EPFL VPN.", de: "Elektronische Informationsressourcen sind an allen EPFL-Arbeitsplätzen und per EPFL VPN abrufbar.", it: "Le risorse elettroniche sono accessibili da tutte le postazioni di lavoro dell'EPFL e a distanza tramite VPN EPFL." }, // vpnLink:{ // fr: "https://www.epfl.ch/campus/services/ressources-informatiques/network-services-reseau/acces-intranet-a-distance/clients-vpn-disponibles/", // en: "https://www.epfl.ch/campus/services/en/it-services/network-services/remote-intranet-access/vpn-clients-available/", // de: "https://www.epfl.ch/campus/services/en/it-services/network-services/remote-intranet-access/vpn-clients-available/", // it: "https://www.epfl.ch/campus/services/en/it-services/network-services/remote-intranet-access/vpn-clients-available/" // }, feedbackLinkMSG:{ fr: "I have a problem accessing the electronic resource below. Please let me know when the access will be restored.", en: "I have a problem accessing the electronic resource below. Please let me know when the access will be restored.", de: "I have a problem accessing the electronic resource below. Please let me know when the access will be restored.", it: "I have a problem accessing the electronic resource below. Please let me know when the access will be restored." }, pdfAccess:{ fr: "Accès direct au pdf", en: "Direct access to the pdf", de: "Direct access to the pdf", it: "Direct access to the pdf" } }; if (['en', 'fr', 'it', 'de'].includes($translate.use())) { return trad[txt][$translate.use()] } else { return trad[txt].fr } }; }]); }) ()