From f87c8681356760dceeac596bac4138e18849eb33 Mon Sep 17 00:00:00 2001 From: Georg Fischer Date: Wed, 30 Dec 2015 13:38:59 +0100 Subject: [PATCH] move functions --- scripts/models/localisationmodel.js | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/scripts/models/localisationmodel.js b/scripts/models/localisationmodel.js index 2bb1cd4..ffe64aa 100644 --- a/scripts/models/localisationmodel.js +++ b/scripts/models/localisationmodel.js @@ -26,6 +26,24 @@ define( } } + function settingUpdated ( name, value ) { + if ( name === 'language' && value !== currentLanguage ) { + loadLanguage( value ); + } + } + + function localizeText ( el, attribute, key ) { + if ( el && attribute && key ) { + textElData.push( { el: el, attribute: attribute, key: key, wasUpdated: false, args: getArgs( arguments ) } ); + } else { + if ( typeof el === 'string' ) { + return getTextForKey( el, getArgs( arguments, 1 ) ); + } + } + + updateAllTexts(); + } + function loadLanguage ( languageName ) { languageWasLoaded = false; @@ -128,24 +146,6 @@ define( return result; } - function settingUpdated ( name, value ) { - if ( name === 'language' && value !== currentLanguage ) { - loadLanguage( value ); - } - } - - function localizeText ( el, attribute, key ) { - if ( el && attribute && key ) { - textElData.push( { el: el, attribute: attribute, key: key, wasUpdated: false, args: getArgs( arguments ) } ); - } else { - if ( typeof el === 'string' ) { - return getTextForKey( el, getArgs( arguments, 1 ) ); - } - } - - updateAllTexts(); - } - self.setLanguage = setLanguage; self.localizeText = localizeText; self.settingUpdated = settingUpdated;