Skip to content
Snippets Groups Projects
Commit b98abbd2 authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Übersetzungsfunktion erweitert und Dokumentiert

parent 6aee52c1
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
translations = { // Speichert die Übersetzungen
var translations = {
'de': { 'de': {
'key': 'Bitte mindestens 1 Suchmaschine auswählen.' 'key': 'Bitte mindestens 1 Suchmaschine auswählen.'
}, },
...@@ -10,4 +11,26 @@ translations = { ...@@ -10,4 +11,26 @@ translations = {
'es': { 'es': {
'key': 'Por favor, seleccione al menos un motor de búsqueda.' 'key': 'Por favor, seleccione al menos un motor de búsqueda.'
} }
} }
\ No newline at end of file
/**
* Übersetzt den gegebenen Schlüssel in der gegebenen Sprache
* @param {string} key Zu übersetzender Schlüssel
* @param {string} lang Zu verwendende Sprache
*/
function t(key, lang) {
if (translations[lang] && translations[lang][key]) {
return translations[lang][key];
} else {
return '';
}
}
/**
* Übersetzt den gegebenen Schlüssel in der aktuellen Sprache des HTML-Dokuments (<html lang="...">)
* @param {string} key Zu übersetzender Schlüssel
*/
function t(key) {
var lang = $('html').attr('lang');
return t(key, lang);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment